From 0b4eefd5a8b3b626915cbd49ac7d956424c8b467 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Mon, 24 Nov 2014 15:23:28 +0000 Subject: [PATCH] [AArch64]Add vec_shr pattern for 64-bit vectors using ush{l,r}; enable tests. gcc/: * config/aarch64/aarch64-simd.md (vec_shr): New. gcc/testsuite/: * lib/target-supports.exp (check_effective_target_whole_vector_shift): Add aarch64{,_be}. From-SVN: r218022 --- gcc/ChangeLog | 4 ++++ gcc/config/aarch64/aarch64-simd.md | 15 +++++++++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/target-supports.exp | 1 + 4 files changed, 25 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1171a7d7cb..ee51e9bb72d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-24 Alan Lawrence + + * config/aarch64/aarch64-simd.md (vec_shr): New. + 2014-11-24 Alan Lawrence * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index eed01cf7754..8e31456381f 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -795,6 +795,21 @@ } ) +;; For 64-bit modes we use ushl/r, as this does not require a SIMD zero. +(define_insn "vec_shr_" + [(set (match_operand:VD 0 "register_operand" "=w") + (lshiftrt:VD (match_operand:VD 1 "register_operand" "w") + (match_operand:SI 2 "immediate_operand" "i")))] + "TARGET_SIMD" + { + if (BYTES_BIG_ENDIAN) + return "ushl %d0, %d1, %2"; + else + return "ushr %d0, %d1, %2"; + } + [(set_attr "type" "neon_shift_imm")] +) + (define_insn "aarch64_simd_vec_setv2di" [(set (match_operand:V2DI 0 "register_operand" "=w,w") (vec_merge:V2DI diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7db895bd2a2..e67389395c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-24 Alan Lawrence + + * lib/target-supports.exp (check_effective_target_whole_vector_shift): + Add aarch64{,_be}. + 2014-11-24 Richard Biener PR tree-optimization/63679 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 02b2b778418..ac04d95f7c5 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3399,6 +3399,7 @@ proc check_effective_target_vect_shift { } { proc check_effective_target_whole_vector_shift { } { if { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget ia64-*-*] + || [istarget aarch64*-*-*] || ([check_effective_target_arm32] && [check_effective_target_arm_little_endian]) || ([istarget mips*-*-*] -- 2.30.2