This is an archive of the discontinued LLVM Phabricator instance.

Refer to IEEE 754-2019 in langref instead of 2018 draft
AcceptedPublic

Authored by stuart on Sep 12 2019, 9:42 AM.

Details

Summary

The language reference refers to drafts of IEEE 754-2018, but the spec has now been published as IEEE 754-2019 with no further changes to the semantics in question. Update the language reference to refer to the actual standard, instead.

Diff Detail

Event Timeline

stuart created this revision.Sep 12 2019, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2019, 9:42 AM

@hans, is it too late for this to be considered as a candidate for the 9.0.0 release?

tlively accepted this revision.Sep 12 2019, 9:56 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 12 2019, 9:56 AM
majnemer added inline comments.
docs/LangRef.rst
2705

2019

12185

minNum -> minimumNumber

12194

2019

12235–12244

Ditto.

stuart marked 4 inline comments as done.Sep 12 2019, 10:51 AM
stuart added inline comments.
docs/LangRef.rst
2705

Excuse the naïve question, but is it now actually incorrect for us to say that we use the IEEE 754-2008 floating point formats, or is this just a matter of it being generally better to refer to the most recent revision of the standard?

12185

I believe that we should say minNum here, as this refers to the old IEEE 754-2008 minNum semantics, and not the new IEEE 754-2019 minumumNumber semantics. That is to say, the llvm.minnum.* intrinsics have been deliberately kept with the IEEE 754-2008 semantics, and new intrinsics named llvm.minimum.* have been added for IEEE 754-2019 semantics.

That said, IMO, this should be updated to refer to IEEE 754-2008 explicitly in all places.

If we intend to update the 9.0.0 docs, should this be part of the update?

12194

This should be left as IEEE 754-2008 as the intrinsic matches the semantics of the older standard.

12235–12244

Ditto.

stuart marked 4 inline comments as not done.Sep 12 2019, 10:55 AM
stuart added inline comments.Sep 12 2019, 11:19 AM
docs/LangRef.rst
12185

Correction: I now realise that the new NaN-propagating operations in IEEE 754-2019 are actually named minimum and maximum, not minimumNumber and maximumNumber. We should explicitly mention the names of these operations in the documentation for the llvm.minimum.* and llvm.maximum.* intrinsics, below.

However, IEEE 754-2019 also adds "number-favoring" operations named minimumNumber and maximumNumber that are broadly the same as minNum and maxNum, but alter the semantics regarding sNaNs. I am not aware of the semantics for the llvm.minnum.* and llvm.maxnum.* intrinsics having been changed to those of the IEEE 754-2019 minimumNumber and maximumNumber operations, though, so I am still not certain of this change.

Should the llvm.minnum.* and llvm.maxnum.* intrinsics be documented as undefined as to whether they have the semantics of the either the IEEE 754-2008 minNum and maxNum operations or the IEEE 754-2019 minimumNumber and maximumNumber operations, or should this explicitly reference the semantics of the IEEE 754-2008 minNum and maxNum operations, or should this explicitly reference the semantics of the IEEE 754-2019 minimumNumber and maximumNumber operations?

If the change in this review is acceptable, then I would suggest that the changes for llvm.minnum.* and llvm.maxnum.* can be done in a subsequent review, but we do need to determine what changes will be required.

hans added a comment.Sep 13 2019, 12:54 AM

@hans, is it too late for this to be considered as a candidate for the 9.0.0 release?

Yes, at this point I'd prefer not to merge anything that's not critical.

Should the changes to llvm.minimum / llvm.maximum be applied now?

@stuart Any movement on this?

qiucf added a subscriber: qiucf.Oct 27 2021, 1:24 AM

Reverse ping..?