AArch64: Implement vstrq_p128 intrinsic
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 23 Sep 2020 09:29:17 +0000 (10:29 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 23 Sep 2020 09:29:17 +0000 (10:29 +0100)
This patch implements the missing vstrq_p128 intrinsic.
It just performs a store of the poly128_t argument to a memory location.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/71233
* config/aarch64/arm_neon.h (vstrq_p128): Define.

gcc/testsuite/
PR target/71233
* gcc.target/aarch64/simd/vstrq_p128_1.c: New test.

gcc/config/aarch64/arm_neon.h
gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c [new file with mode: 0644]

index 341019bc648babcddb0311c36652814609aab22f..fe1ab0ddd17902df044b9037866c654a636e0e3c 100644 (file)
@@ -30167,6 +30167,13 @@ vst4q_p64 (poly64_t * __a, poly64x2x4_t __val)
   __builtin_aarch64_st4v2di ((__builtin_aarch64_simd_di *) __a, __o);
 }
 
+__extension__ extern __inline void
+__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
+vstrq_p128 (poly128_t * __ptr, poly128_t __val)
+{
+  *__ptr = __val;
+}
+
 /* vsub */
 
 __extension__ extern __inline int64_t
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c
new file mode 100644 (file)
index 0000000..8d036fd
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+#include <arm_neon.h>
+
+void
+test (poly128_t *ptr, poly128_t a)
+{
+  vstrq_p128 (ptr, a);
+}
+
+/* { dg-final { scan-assembler-times {stp.*x2,.*x3,.*[x0]} 1 } } */