[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2023-06-22 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm abandoned this revision. arsenm added a comment. Herald added a subscriber: StephenFan. Obsoleted by D112932 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140294/new/ https://reviews.llvm.org/D140294

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. As mentioned in another review, using `fcmp` to represent `isnormal` in IR as well as any other classification function would result in incorrect code in strict mode. The source: inline __attribute__((always_inline)) _Bool func(float x) { return __builtin_isnorm

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-20 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment. In D140294#4007073 , @sepavloff wrote: > This change can have negative consequences in some cases. Some targets have > dedicated instruction to test FP class and often this instruction is faster > than arithmetic operations. Repl

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. This change can have negative consequences in some cases. Some targets have dedicated instruction to test FP class and often this instruction is faster than arithmetic operations. Replacement of one operation with two arithmetic and two logic plus cost of FP constant

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-19 Thread Jay Foad via Phabricator via cfe-commits
foad added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3308 case Builtin::BI__builtin_isnormal: { -// isnormal(x) --> x == x && fabsf(x) < infinity && fabsf(x) >= float_min +// isnormal(x) --> fabs(x) < infinity && !(fabs(x) < float_min) CodeGenFu

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-19 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm created this revision. arsenm added reviewers: bkramer, foad, sepavloff, andrew.w.kaylor, kpn. Herald added a project: All. arsenm requested review of this revision. Herald added a subscriber: wdng. This was doing an explicit non-canonical isnan check, then two unordered comparisons. We can