Ping
________________________________________
From: gcc-patches-ow...@gcc.gnu.org <gcc-patches-ow...@gcc.gnu.org> on behalf 
of Tamar Christina <tamar.christ...@arm.com>
Sent: Wednesday, March 15, 2017 4:04:35 PM
To: GCC Patches
Cc: nd; James Greenhalgh; Richard Earnshaw; Marcus Shawcroft
Subject: [PATCH][GCC][AArch64] Fix subreg bug in scalar copysign

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?

Thanks,
Tamar

gcc/
2017-03-15  Tamar Christina  <tamar.christ...@arm.com>

        * config/aarch64/aarch64.md
        (copysignsf3): Fix mask generation.

Reply via email to