[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. @john.brawn Are you OK with treating those functions as not setting inexact, as per the C23 clarification, as the committed version does? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129231/new/

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D129231#3716363 , @scanon wrote: >>> Looking at implementations of these functions, it looks like GNU libm >>> doesn't raise inexact, but the bionic libm does. I think I'm leaning >>> towards marking all of them as "fng" as

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-11 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. In any event, from the standpoint of the C(23) language, these operations do not set inexact, so I believe that it is appropriate to optimize them as if they do not set inexact. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-11 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. >> Looking at implementations of these functions, it looks like GNU libm >> doesn't raise inexact, but the bionic libm does. I think I'm leaning towards >> marking all of them as "fng" as it's the more cautious of the two. > > Hmm, bionic's behavior sounds a bit

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:1409 -LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-11 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGef110a491f70: [Builtins] Do not claim most libfuncs are readnone with trapping math. (authored by fhahn). Changed prior to commit: https://reviews.llvm.org/D129231?vs=448628=451800#toc Repository:

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-08 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. The CFP working group and C23 have since clarified this in Annex F: > The returned value is exact and is independent of the current rounding > direction mode. They never set inexact on an implementation that claims 60559 conformance. The only flag that these operations

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-08 Thread John Brawn via Phabricator via cfe-commits
john.brawn added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:1409 -LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-05 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:1409 -LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-05 Thread John Brawn via Phabricator via cfe-commits
john.brawn accepted this revision. john.brawn added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129231/new/ https://reviews.llvm.org/D129231

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-08-05 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129231/new/ https://reviews.llvm.org/D129231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-07-29 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 448628. fhahn added a comment. In D129231#3638946 , @john.brawn wrote: > Looking at the descriptions of maths functions in C99 (and I expect C11 will > be the same) it looks like there are three kinds: > > - Those

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-07-08 Thread John Brawn via Phabricator via cfe-commits
john.brawn added a comment. Looking at the descriptions of maths functions in C99 (and I expect C11 will be the same) it looks like there are three kinds: - Those that can report error by errno and floating-point exeption, and may also raise the inexact exception - Those that don't set errno,

[PATCH] D129231: [Builtins] Do not claim all libfuncs are readnone with trapping math.

2022-07-06 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: kpn, efriedma, scanon, john.brawn, sepavloff. Herald added a project: All. fhahn requested review of this revision. Herald added a project: clang. At the moment, Clang only considers errno when deciding if a builtin is const. This ignores the