This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [Bug middle-end/33187] Missed cmove opportunity



double sgn (double __x)
{
  return __x >= 0.0 ? 1.0 : -1.0;
}
For this testcase with -ffast-math, can't we just do copysign (1.0, __x) ?
No, because -0.0 >= 0.0

Even with -ffast-math? IIRC, there [are | should be] no signed zeros with fast math.

Right. What I meant was that the copysign implementation does not know that. copysign (a, b) could be folded as (b >= 0 ? save_expr<abs(a)> : -save_expr<abs(a)>) at -ffast-math, but we don't do that yet.


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]