++
Assignee: unassigned at gcc dot gnu.org
Reporter: lisyarus at gmail dot com
Target Milestone: ---
Based on a discussion on stackoverflow:
https://stackoverflow.com/questions/57673825/how-to-force-gcc-to-assume-that-a-floating-point-expression-is-non-negative.
With gcc-trunk and '
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645
--- Comment #2 from Nikita Lisitsa ---
If by 'isless(y, 0.0)' you mean 'y < 0.f', then no, it doesn't change anything,
it produces the same 'ucomiss ... call sqrtf' boilerplate. May I have
misunderstood you?
By the way, what about '#pragma GCC o
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645
--- Comment #5 from Nikita Lisitsa ---
Oh, thank you a lot! Indeed, this version compiles to just mulss & sqrtss
float test (float x)
{
float y = x*x;
if (std::isless(y, 0.f))
__builtin_unreachable();
return std::sqrt(y);
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89062
Nikita Lisitsa changed:
What|Removed |Added
CC||lisyarus at gmail dot com
--- Comment