[ARM] Cleanup DImode shifts
authorWilco Dijkstra <wdijkstr@arm.com>
Thu, 22 Aug 2019 15:06:37 +0000 (15:06 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Thu, 22 Aug 2019 15:06:37 +0000 (15:06 +0000)
commit5c7c6c5fc13503b2b71aee34d57370ae03531809
treef35d539176f8246d76b17e80ae30101e41847f26
parentcdfc0e863a03698a80c74896cbdc9f5c8c652e64
[ARM] Cleanup DImode shifts

Like the logical operations, expand all shifts early rather than only
sometimes.  The Neon shift expansions are never emitted (not even with
-fneon-for-64bits), so they are not useful.  So all the late expansions
and Neon shift patterns can be removed, and shifts are more optimized
as a result.  Since some extend patterns use Neon DImode shifts, remove
the Neon extend variants and related splits.

A simple example now generates the same efficient code after this
patch with -mfpu=neon and -mfpu=vfp (previously just the fact of
having Neon enabled resulted inefficient code for no reason).

unsigned long long f(unsigned long long x, unsigned long long y)
{ return x & (y >> 33); }

Before:
strd    r4, r5, [sp, #-8]!
lsr     r4, r3, #1
mov     r5, #0
and     r1, r1, r5
and     r0, r0, r4
ldrd    r4, r5, [sp]
add     sp, sp, #8
bx      lr

After:
and     r0, r0, r3, lsr #1
mov     r1, #0
bx      lr

Bootstrap and regress OK on arm-none-linux-gnueabihf --with-cpu=cortex-a57

    gcc/
* config/arm/iterators.md (qhs_extenddi_cstr): Update.
(qhs_extenddi_cstr): Likewise.
* config/arm/arm.md (ashldi3): Always expand early.
(ashlsi3): Likewise.
(ashrsi3): Likewise.
(zero_extend<mode>di2): Remove Neon variants.
(extend<mode>di2): Likewise.
* config/arm/neon.md (ashldi3_neon_noclobber): Remove.
(signed_shift_di3_neon): Likewise.
(unsigned_shift_di3_neon): Likewise.
(ashrdi3_neon_imm_noclobber): Likewise.
(lshrdi3_neon_imm_noclobber): Likewise.
(<shift>di3_neon): Likewise.
(split extend): Remove DI extend split patterns.

   gcc/testsuite/
* gcc.target/arm/neon-extend-1.c: Remove test.
* gcc.target/arm/neon-extend-2.c: Remove test.

From-SVN: r274824
gcc/ChangeLog
gcc/config/arm/arm.md
gcc/config/arm/iterators.md
gcc/config/arm/neon.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/neon-extend-1.c [deleted file]
gcc/testsuite/gcc.target/arm/neon-extend-2.c [deleted file]