On Sun, May 14, 2023 at 12:44 AM Alexander Monakov via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > On Sun, 14 May 2023, Alexander Monakov wrote: > > > On Sat, 13 May 2023, Andrew Pinski via Gcc-patches wrote: > > > > > +/* signbit(x) != 0 ? -x : x -> abs(x) > > > + signbit(x) == 0 ? -x : x -> -abs(x) */ > > > +(for sign (SIGNBIT) > > > > Surprised to see a dummy iterator here. Was this meant to include > > float and long double versions of the builtin too (SIGNBITF and SIGNBITL)?
It is NOT a dummy iterator. SIGNBIT is a operator list that expands to "BUILT_IN_SIGNBITF BUILT_IN_SIGNBIT BUILT_IN_SIGNBITL IFN_SIGNBIT". > > On the other hand, the following clauses both use SIGNBIT directly, and > it would be nice to be consistent. You cannot use the operator list directly if you have a for loop expansion too. So it is internally consistent already. Thanks, Andrew Pinski > > > > + (for neeq (ne eq) > > > + (simplify > > > + (cond (neeq (sign @0) integer_zerop) (negate @0) @0) > > > + (if (neeq == NE_EXPR) > > > + (abs @0) > > > + (negate (abs @0)))))) > > > + > > > (simplify > > > /* signbit(x) -> 0 if x is nonnegative. */ > > > (SIGNBIT tree_expr_nonnegative_p@0) > > > > Thanks. > > Alexander > >