This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR55152
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Sun, 16 Oct 2016 13:57:34 -0700
- Subject: Re: [PATCH] Fix PR55152
- Authentication-results: sourceware.org; auth=none
- References: <alpine.LSU.2.11.1609281614110.26629@t29.fhfr.qr> <alpine.DEB.2.20.1609281727030.7282@digraph.polyomino.org.uk> <alpine.LSU.2.11.1609290921490.26629@t29.fhfr.qr> <alpine.LSU.2.11.1609291423160.26629@t29.fhfr.qr> <CA+=Sn1k+B17JqZZbUOeyZD7f=o2PE8ntd-sMUvCf5sh6hPxNrQ@mail.gmail.com> <alpine.LSU.2.11.1610040915210.26629@t29.fhfr.qr> <alpine.DEB.2.20.1610041138090.3285@laptop-mg.saclay.inria.fr> <alpine.LSU.2.11.1610041146490.26629@t29.fhfr.qr>
On Tue, Oct 4, 2016 at 2:50 AM, Richard Biener <rguenther@suse.de> wrote:
> On Tue, 4 Oct 2016, Marc Glisse wrote:
>
>> On Tue, 4 Oct 2016, Richard Biener wrote:
>>
>> > Possibly. Though then for FP we also want - abs (a) -> copysign (a, -1).
>>
>> I thought this might fix PR 62055, but at least on x86_64, we generate much
>> worse code for copysign(,-1) than for -abs :-(
>
> I would have expected copysign(,-1) to be a simple IOR ...
>
> double foo (double x)
> {
> return __builtin_copysign (x, -1.);
> }
>
> foo:
> .LFB0:
> .cfi_startproc
> movsd .LC0(%rip), %xmm1
> movapd %xmm1, %xmm2
> andpd .LC2(%rip), %xmm2
> andpd .LC1(%rip), %xmm0
> orpd %xmm2, %xmm0
> ret
>
> ICK. -fabs (x) yields
>
> foo:
> .LFB0:
> .cfi_startproc
> andpd .LC0(%rip), %xmm0
> xorpd .LC1(%rip), %xmm0
> ret
>
> I expected a simple orpd .LC0(%rip), %xmm0 ...
That is recorded already as PR62055 :).
Thanks,
Andrew
>
> Richard.