aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2021-03-11 11:08:49 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2021-05-24 13:38:09 +0000
commit4eaf65ed6a6fbeefae28bd850329fb226e76f861 (patch)
treeb71bee81bc4ba41043bad313727715559ea3b6c0 /gcc/config/arm
parent5ba5e856f327b1d6b69d51a11ef63ce89bfbc868 (diff)
downloadgcc-4eaf65ed6a6fbeefae28bd850329fb226e76f861.zip
gcc-4eaf65ed6a6fbeefae28bd850329fb226e76f861.tar.gz
gcc-4eaf65ed6a6fbeefae28bd850329fb226e76f861.tar.bz2
arm: Auto-vectorization for MVE: vld4/vst4
This patch enables MVE vld4/vst4 instructions for auto-vectorization. We move the existing expanders from neon.md and enable them for MVE, calling the respective emitter. 2021-03-12 Christophe Lyon <christophe.lyon@linaro.org> gcc/ * config/arm/neon.md (vec_load_lanesxi<mode>) (vec_store_lanexoi<mode>): Move ... * config/arm/vec-common.md: here. gcc/testsuite/ * gcc.target/arm/simd/mve-vld4.c: New test, derived from slp-perm-3.c
Diffstat (limited to 'gcc/config/arm')
-rw-r--r--gcc/config/arm/neon.md20
-rw-r--r--gcc/config/arm/vec-common.md26
2 files changed, 26 insertions, 20 deletions
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 25d4252..977adef 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -5620,16 +5620,6 @@ if (BYTES_BIG_ENDIAN)
(const_string "neon_load4_4reg<q>")))]
)
-(define_expand "vec_load_lanesxi<mode>"
- [(match_operand:XI 0 "s_register_operand")
- (match_operand:XI 1 "neon_struct_operand")
- (unspec:VQ2 [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
- "TARGET_NEON"
-{
- emit_insn (gen_neon_vld4<mode> (operands[0], operands[1]));
- DONE;
-})
-
(define_expand "neon_vld4<mode>"
[(match_operand:XI 0 "s_register_operand")
(match_operand:XI 1 "neon_struct_operand")
@@ -5821,16 +5811,6 @@ if (BYTES_BIG_ENDIAN)
(const_string "neon_store4_4reg<q>")))]
)
-(define_expand "vec_store_lanesxi<mode>"
- [(match_operand:XI 0 "neon_struct_operand")
- (match_operand:XI 1 "s_register_operand")
- (unspec:VQ2 [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
- "TARGET_NEON"
-{
- emit_insn (gen_neon_vst4<mode> (operands[0], operands[1]));
- DONE;
-})
-
(define_expand "neon_vst4<mode>"
[(match_operand:XI 0 "neon_struct_operand")
(match_operand:XI 1 "s_register_operand")
diff --git a/gcc/config/arm/vec-common.md b/gcc/config/arm/vec-common.md
index 0b79e68..e8b2901 100644
--- a/gcc/config/arm/vec-common.md
+++ b/gcc/config/arm/vec-common.md
@@ -513,3 +513,29 @@
emit_insn (gen_mve_vst2q<mode> (operands[0], operands[1]));
DONE;
})
+
+(define_expand "vec_load_lanesxi<mode>"
+ [(match_operand:XI 0 "s_register_operand")
+ (match_operand:XI 1 "neon_struct_operand")
+ (unspec:VQ2 [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
+ "TARGET_NEON || TARGET_HAVE_MVE"
+{
+ if (TARGET_NEON)
+ emit_insn (gen_neon_vld4<mode> (operands[0], operands[1]));
+ else
+ emit_insn (gen_mve_vld4q<mode> (operands[0], operands[1]));
+ DONE;
+})
+
+(define_expand "vec_store_lanesxi<mode>"
+ [(match_operand:XI 0 "neon_struct_operand")
+ (match_operand:XI 1 "s_register_operand")
+ (unspec:VQ2 [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
+ "TARGET_NEON || TARGET_HAVE_MVE"
+{
+ if (TARGET_NEON)
+ emit_insn (gen_neon_vst4<mode> (operands[0], operands[1]));
+ else
+ emit_insn (gen_mve_vst4q<mode> (operands[0], operands[1]));
+ DONE;
+})