This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC][AArch64] Fix subreg bug in scalar copysign
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Tamar Christina <Tamar dot Christina at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Tue, 6 Jun 2017 14:34:14 +0100
- Subject: Re: [PATCH][GCC][AArch64] Fix subreg bug in scalar copysign
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <VI1PR0801MB2031C64CEFD6A5AB99C97737FF270@VI1PR0801MB2031.eurprd08.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Wed, Mar 15, 2017 at 04:04:35PM +0000, Tamar Christina wrote:
> Hi All,
>
> This fixes a bug in the scalar version of copysign where due to a subreg
> were generating less than efficient code.
>
> This patch replaces
>
> return x * __builtin_copysignf (150.0f, y);
>
> which used to generate
>
> adrp x1, .LC1
> mov x0, 2147483648
> ins v3.d[0], x0
> ldr s2, [x1, #:lo12:.LC1]
> bsl v3.8b, v1.8b, v2.8b
> fmul s0, s0, s3
> ret
>
> .LC1:
> .word 1125515264
>
> with
> mov x0, 1125515264
> movi v2.2s, 0x80, lsl 24
> fmov d3, x0
> bit v3.8b, v1.8b, v2.8b
> fmul s0, s0, s3
> ret
>
> removing the incorrect ins.
>
> Regression tested on aarch64-none-linux-gnu and no regressions.
>
> OK for trunk?
OK.
Thanks,
James
> gcc/
> 2017-03-15 Tamar Christina <tamar.christina@arm.com>
>
> * config/aarch64/aarch64.md
> (copysignsf3): Fix mask generation.