On Thu, Oct 23, 2025 at 7:10 AM H.J. Lu <[email protected]> wrote:
>
> On Mon, Oct 20, 2025 at 2:12 PM Uros Bizjak <[email protected]> wrote:
> >
> > On Sun, Oct 19, 2025 at 11:35 PM H.J. Lu <[email protected]> wrote:
> > >
> > > After
> > >
> > > commit 3f176e1adc6bc9cc2c21222d776b51d9f43cb66b
> > > Author: Tamar Christina <[email protected]>
> > > Date:   Thu Nov 9 13:59:39 2023 +0000
> > >
> > >     middle-end: optimize fneg (fabs (x)) to copysign (x, -1) [PR109154]
> > >
> > > fneg (fabs (x)) is expanded to copysign (x, -1).  Swap constraints for
> > > operands[1] and operands[2] in copysign<mode>3 pattern to optimize
> > >
> > >   y = copysign (x, const_double)
> > >
> > > instead of
> > >
> > >   y = copysign (const_double, x)
> > >
> > > Simplify
> > >
> > >   y = copysign (x, positive_const_double)
> > >
> > > to
> > >
> > >   y = ~signbit_mask & x
> > >
> > > and
> > >
> > >   y = copysign (x, negative_const_double)
> > >
> > > to
> > >
> > >   y = signbit_mask | x
> > >
> > > gcc/
> > >
> > > PR target/99930
> > > PR target/122323
> > > * config/i386/i386-expand.cc (ix86_expand_copysign): Swap
> > > operands[1] with operands[2].  Optimize copysign (x, const_double)
> > > instead of copysign (const_double, x).
> > > * config/i386/i386.md (copysign<mode>3): Swap constraints for
> > > operands[1] and operands[2].
> > >
> > > gcc/testsuite/
> > >
> > > PR target/99930
> > > PR target/122323
> > > * gcc.target/i386/builtin-copysign-2.c: New test.
> > > * gcc.target/i386/builtin-copysign-3.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-4.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-5.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-6.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-7.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-8a.c: Likewise.
> > > * gcc.target/i386/builtin-copysign-8b.c: Likewise.
> > > * gcc.target/i386/builtin-fabs-1.c: Likewise.
> > > * gcc.target/i386/builtin-fabs-2.c: Likewise.
> >
> > OK.
> >
> > Thanks,
> > Uros.
>
> OK to backport it to release branches?

OK, since the patch fixes a regression from gcc-13.

Thanks,
Uros.

Reply via email to