aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Lawrence <alan.lawrence@arm.com>2014-05-07 10:51:15 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2014-05-07 10:51:15 +0000
commite0e906bc1412542eee3d98f369e3e4c7f12670db (patch)
tree89fb8fdbd1a2a9885a415dd0ce670e2658ae3b1c
parent1d175503d523c7c2404393bbdc08f4dd4cdb9054 (diff)
downloadgcc-e0e906bc1412542eee3d98f369e3e4c7f12670db.zip
gcc-e0e906bc1412542eee3d98f369e3e4c7f12670db.tar.gz
gcc-e0e906bc1412542eee3d98f369e3e4c7f12670db.tar.bz2
Add execution + assembler tests of AArch64 EXT intrinsics.
gcc.target/aarch64/simd/ext_f32.x: New file. gcc.target/aarch64/simd/ext_f32_1.c: New file. gcc.target/aarch64/simd/ext_p16.x: New file. gcc.target/aarch64/simd/ext_p16_1.c: New file. gcc.target/aarch64/simd/ext_p8.x: New file. gcc.target/aarch64/simd/ext_p8_1.c: New file. gcc.target/aarch64/simd/ext_s16.x: New file. gcc.target/aarch64/simd/ext_s16_1.c: New file. gcc.target/aarch64/simd/ext_s32.x: New file. gcc.target/aarch64/simd/ext_s32_1.c: New file. gcc.target/aarch64/simd/ext_s64.x: New file. gcc.target/aarch64/simd/ext_s64_1.c: New file. gcc.target/aarch64/simd/ext_s8.x: New file. gcc.target/aarch64/simd/ext_s8_1.c: New file. gcc.target/aarch64/simd/ext_u16.x: New file. gcc.target/aarch64/simd/ext_u16_1.c: New file. gcc.target/aarch64/simd/ext_u32.x: New file. gcc.target/aarch64/simd/ext_u32_1.c: New file. gcc.target/aarch64/simd/ext_u64.x: New file. gcc.target/aarch64/simd/ext_u64_1.c: New file. gcc.target/aarch64/simd/ext_u8.x: New file. gcc.target/aarch64/simd/ext_u8_1.c: New file. gcc.target/aarch64/simd/ext_f64.c: New file. gcc.target/aarch64/simd/extq_f32.x: New file. gcc.target/aarch64/simd/extq_f32_1.c: New file. gcc.target/aarch64/simd/extq_p16.x: New file. gcc.target/aarch64/simd/extq_p16_1.c: New file. gcc.target/aarch64/simd/extq_p8.x: New file. gcc.target/aarch64/simd/extq_p8_1.c: New file. gcc.target/aarch64/simd/extq_s16.x: New file. gcc.target/aarch64/simd/extq_s16_1.c: New file. gcc.target/aarch64/simd/extq_s32.x: New file. gcc.target/aarch64/simd/extq_s32_1.c: New file. gcc.target/aarch64/simd/extq_s64.x: New file. gcc.target/aarch64/simd/extq_s64_1.c: New file. gcc.target/aarch64/simd/extq_s8.x: New file. gcc.target/aarch64/simd/extq_s8_1.c: New file. gcc.target/aarch64/simd/extq_u16.x: New file. gcc.target/aarch64/simd/extq_u16_1.c: New file. gcc.target/aarch64/simd/extq_u32.x: New file. gcc.target/aarch64/simd/extq_u32_1.c: New file. gcc.target/aarch64/simd/extq_u64.x: New file. gcc.target/aarch64/simd/extq_u64_1.c: New file. gcc.target/aarch64/simd/extq_u8.x: New file. gcc.target/aarch64/simd/extq_u8_1.c: New file. gcc.target/aarch64/simd/extq_f64.c: New file. From-SVN: r210152
-rw-r--r--gcc/testsuite/ChangeLog49
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_f32.x30
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_f32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_f64_1.c25
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_p16.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_p16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_p8.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_p8_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s16.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s32.x30
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s64.x17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s64_1.c11
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s8.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_s8_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u16.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u32.x30
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u64.x17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u64_1.c11
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u8.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/ext_u8_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_f32.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_f32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_f64_1.c36
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_p16.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_p16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_p8.x227
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_p8_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s16.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s32.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s64.x30
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s8.x227
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_s8_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u16.x114
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u16_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u32.x58
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u32_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u64.x30
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u64_1.c10
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u8.x227
-rw-r--r--gcc/testsuite/gcc.target/aarch64/simd/extq_u8_1.c10
47 files changed, 2229 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c38d663..656de70 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,54 @@
2014-05-07 Alan Lawrence <alan.lawrence@arm.com>
+ gcc.target/aarch64/simd/ext_f32.x: New file.
+ gcc.target/aarch64/simd/ext_f32_1.c: New file.
+ gcc.target/aarch64/simd/ext_p16.x: New file.
+ gcc.target/aarch64/simd/ext_p16_1.c: New file.
+ gcc.target/aarch64/simd/ext_p8.x: New file.
+ gcc.target/aarch64/simd/ext_p8_1.c: New file.
+ gcc.target/aarch64/simd/ext_s16.x: New file.
+ gcc.target/aarch64/simd/ext_s16_1.c: New file.
+ gcc.target/aarch64/simd/ext_s32.x: New file.
+ gcc.target/aarch64/simd/ext_s32_1.c: New file.
+ gcc.target/aarch64/simd/ext_s64.x: New file.
+ gcc.target/aarch64/simd/ext_s64_1.c: New file.
+ gcc.target/aarch64/simd/ext_s8.x: New file.
+ gcc.target/aarch64/simd/ext_s8_1.c: New file.
+ gcc.target/aarch64/simd/ext_u16.x: New file.
+ gcc.target/aarch64/simd/ext_u16_1.c: New file.
+ gcc.target/aarch64/simd/ext_u32.x: New file.
+ gcc.target/aarch64/simd/ext_u32_1.c: New file.
+ gcc.target/aarch64/simd/ext_u64.x: New file.
+ gcc.target/aarch64/simd/ext_u64_1.c: New file.
+ gcc.target/aarch64/simd/ext_u8.x: New file.
+ gcc.target/aarch64/simd/ext_u8_1.c: New file.
+ gcc.target/aarch64/simd/ext_f64.c: New file.
+ gcc.target/aarch64/simd/extq_f32.x: New file.
+ gcc.target/aarch64/simd/extq_f32_1.c: New file.
+ gcc.target/aarch64/simd/extq_p16.x: New file.
+ gcc.target/aarch64/simd/extq_p16_1.c: New file.
+ gcc.target/aarch64/simd/extq_p8.x: New file.
+ gcc.target/aarch64/simd/extq_p8_1.c: New file.
+ gcc.target/aarch64/simd/extq_s16.x: New file.
+ gcc.target/aarch64/simd/extq_s16_1.c: New file.
+ gcc.target/aarch64/simd/extq_s32.x: New file.
+ gcc.target/aarch64/simd/extq_s32_1.c: New file.
+ gcc.target/aarch64/simd/extq_s64.x: New file.
+ gcc.target/aarch64/simd/extq_s64_1.c: New file.
+ gcc.target/aarch64/simd/extq_s8.x: New file.
+ gcc.target/aarch64/simd/extq_s8_1.c: New file.
+ gcc.target/aarch64/simd/extq_u16.x: New file.
+ gcc.target/aarch64/simd/extq_u16_1.c: New file.
+ gcc.target/aarch64/simd/extq_u32.x: New file.
+ gcc.target/aarch64/simd/extq_u32_1.c: New file.
+ gcc.target/aarch64/simd/extq_u64.x: New file.
+ gcc.target/aarch64/simd/extq_u64_1.c: New file.
+ gcc.target/aarch64/simd/extq_u8.x: New file.
+ gcc.target/aarch64/simd/extq_u8_1.c: New file.
+ gcc.target/aarch64/simd/extq_f64.c: New file.
+
+2014-05-07 Alan Lawrence <alan.lawrence@arm.com>
+
* gcc.target/aarch64/vtrns32.c: Expect zip[12] insn rather than trn[12].
* gcc.target/aarch64/vtrnu32.c: Likewise.
* gcc.target/aarch64/vtrnf32.c: Likewise.
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_f32.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_f32.x
new file mode 100644
index 0000000..b511e51
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_f32.x
@@ -0,0 +1,30 @@
+extern void abort (void);
+
+float32x2_t
+test_vext_f32_1 (float32x2_t a, float32x2_t b)
+{
+ return vext_f32 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ float32_t arr1[] = {0, 1};
+ float32x2_t in1 = vld1_f32 (arr1);
+ float32_t arr2[] = {2, 3};
+ float32x2_t in2 = vld1_f32 (arr2);
+ float32_t exp[2];
+ float32x2_t expected;
+ float32x2_t actual = test_vext_f32_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ exp[i] = i + 1;
+ expected = vld1_f32 (exp);
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_f32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_f32_1.c
new file mode 100644
index 0000000..806c10a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_f32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextf32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_f32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_f64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_f64_1.c
new file mode 100644
index 0000000..09aecba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_f64_1.c
@@ -0,0 +1,25 @@
+/* Test the `vextf64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+
+extern void abort (void);
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ float64x1_t in1 = {0};
+ float64x1_t in2 = {1};
+ float64x1_t actual = vext_f64 (in1, in2, 0);
+ if (actual != in1)
+ abort ();
+
+ return 0;
+}
+
+/* Do not scan-assembler. An EXT instruction could be emitted, but would merely
+ return its first argument, so it is legitimate to optimize it out. */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_p16.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_p16.x
new file mode 100644
index 0000000..b5b3814
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_p16.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+poly16x4_t
+test_vext_p16_1 (poly16x4_t a, poly16x4_t b)
+{
+ return vext_p16 (a, b, 1);
+}
+
+poly16x4_t
+test_vext_p16_2 (poly16x4_t a, poly16x4_t b)
+{
+ return vext_p16 (a, b, 2);
+}
+
+poly16x4_t
+test_vext_p16_3 (poly16x4_t a, poly16x4_t b)
+{
+ return vext_p16 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ poly16_t arr1[] = {0, 1, 2, 3};
+ poly16x4_t in1 = vld1_p16 (arr1);
+ poly16_t arr2[] = {4, 5, 6, 7};
+ poly16x4_t in2 = vld1_p16 (arr2);
+ poly16_t exp[4];
+ poly16x4_t expected;
+ poly16x4_t actual = test_vext_p16_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1_p16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p16_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1_p16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p16_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1_p16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_p16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_p16_1.c
new file mode 100644
index 0000000..86b8660
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_p16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextp16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_p16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_p8.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_p8.x
new file mode 100644
index 0000000..95b37b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_p8.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+poly8x8_t
+test_vext_p8_1 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 1);
+}
+
+poly8x8_t
+test_vext_p8_2 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 2);
+}
+
+poly8x8_t
+test_vext_p8_3 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 3);
+}
+
+poly8x8_t
+test_vext_p8_4 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 4);
+}
+
+poly8x8_t
+test_vext_p8_5 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 5);
+}
+
+poly8x8_t
+test_vext_p8_6 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 6);
+}
+
+poly8x8_t
+test_vext_p8_7 (poly8x8_t a, poly8x8_t b)
+{
+ return vext_p8 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ poly8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ poly8x8_t in1 = vld1_p8 (arr1);
+ poly8_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ poly8x8_t in2 = vld1_p8 (arr2);
+ poly8_t exp[8];
+ poly8x8_t expected;
+ poly8x8_t actual = test_vext_p8_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_p8_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1_p8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_p8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_p8_1.c
new file mode 100644
index 0000000..aae0575
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_p8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextp8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_p8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#?\[0-9\]+\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s16.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_s16.x
new file mode 100644
index 0000000..78ef0ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s16.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+int16x4_t
+test_vext_s16_1 (int16x4_t a, int16x4_t b)
+{
+ return vext_s16 (a, b, 1);
+}
+
+int16x4_t
+test_vext_s16_2 (int16x4_t a, int16x4_t b)
+{
+ return vext_s16 (a, b, 2);
+}
+
+int16x4_t
+test_vext_s16_3 (int16x4_t a, int16x4_t b)
+{
+ return vext_s16 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int16_t arr1[] = {0, 1, 2, 3};
+ int16x4_t in1 = vld1_s16 (arr1);
+ int16_t arr2[] = {4, 5, 6, 7};
+ int16x4_t in2 = vld1_s16 (arr2);
+ int16_t exp[4];
+ int16x4_t expected;
+ int16x4_t actual = test_vext_s16_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1_s16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s16_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1_s16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s16_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1_s16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_s16_1.c
new file mode 100644
index 0000000..fd9ebd9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vexts16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_s16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s32.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_s32.x
new file mode 100644
index 0000000..066ceac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s32.x
@@ -0,0 +1,30 @@
+extern void abort (void);
+
+int32x2_t
+test_vext_s32_1 (int32x2_t a, int32x2_t b)
+{
+ return vext_s32 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int32_t arr1[] = {0, 1};
+ int32x2_t in1 = vld1_s32 (arr1);
+ int32_t arr2[] = {2, 3};
+ int32x2_t in2 = vld1_s32 (arr2);
+ int32_t exp[2];
+ int32x2_t expected;
+ int32x2_t actual = test_vext_s32_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ exp[i] = i + 1;
+ expected = vld1_s32 (exp);
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_s32_1.c
new file mode 100644
index 0000000..05c5d60
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vexts32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_s32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s64.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_s64.x
new file mode 100644
index 0000000..c71011a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s64.x
@@ -0,0 +1,17 @@
+extern void abort (void);
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int64_t arr1[] = {0};
+ int64x1_t in1 = vld1_s64 (arr1);
+ int64_t arr2[] = {1};
+ int64x1_t in2 = vld1_s64 (arr2);
+ int64x1_t actual = vext_s64 (in1, in2, 0);
+ if (actual != in1)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_s64_1.c
new file mode 100644
index 0000000..1e2748d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s64_1.c
@@ -0,0 +1,11 @@
+/* Test the `vexts64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_s64.x"
+
+/* Do not scan-assembler. An EXT instruction could be emitted, but would merely
+ return its first argument, so it is legitimate to optimize it out. */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s8.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_s8.x
new file mode 100644
index 0000000..e79ef0a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s8.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+int8x8_t
+test_vext_s8_1 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 1);
+}
+
+int8x8_t
+test_vext_s8_2 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 2);
+}
+
+int8x8_t
+test_vext_s8_3 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 3);
+}
+
+int8x8_t
+test_vext_s8_4 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 4);
+}
+
+int8x8_t
+test_vext_s8_5 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 5);
+}
+
+int8x8_t
+test_vext_s8_6 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 6);
+}
+
+int8x8_t
+test_vext_s8_7 (int8x8_t a, int8x8_t b)
+{
+ return vext_s8 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ int8x8_t in1 = vld1_s8 (arr1);
+ int8_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ int8x8_t in2 = vld1_s8 (arr2);
+ int8_t exp[8];
+ int8x8_t expected;
+ int8x8_t actual = test_vext_s8_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_s8_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1_s8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_s8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_s8_1.c
new file mode 100644
index 0000000..c368eba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_s8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vexts8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_s8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#?\[0-9\]+\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u16.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_u16.x
new file mode 100644
index 0000000..5a16ef3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u16.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+uint16x4_t
+test_vext_u16_1 (uint16x4_t a, uint16x4_t b)
+{
+ return vext_u16 (a, b, 1);
+}
+
+uint16x4_t
+test_vext_u16_2 (uint16x4_t a, uint16x4_t b)
+{
+ return vext_u16 (a, b, 2);
+}
+
+uint16x4_t
+test_vext_u16_3 (uint16x4_t a, uint16x4_t b)
+{
+ return vext_u16 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint16_t arr1[] = {0, 1, 2, 3};
+ uint16x4_t in1 = vld1_u16 (arr1);
+ uint16_t arr2[] = {4, 5, 6, 7};
+ uint16x4_t in2 = vld1_u16 (arr2);
+ uint16_t exp[4];
+ uint16x4_t expected;
+ uint16x4_t actual = test_vext_u16_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1_u16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u16_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1_u16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u16_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1_u16 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_u16_1.c
new file mode 100644
index 0000000..83b1f97
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextu16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_u16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u32.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_u32.x
new file mode 100644
index 0000000..a5c3dd4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u32.x
@@ -0,0 +1,30 @@
+extern void abort (void);
+
+uint32x2_t
+test_vext_u32_1 (uint32x2_t a, uint32x2_t b)
+{
+ return vext_u32 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint32_t arr1[] = {0, 1};
+ uint32x2_t in1 = vld1_u32 (arr1);
+ uint32_t arr2[] = {2, 3};
+ uint32x2_t in2 = vld1_u32 (arr2);
+ uint32_t exp[2];
+ uint32x2_t expected;
+ uint32x2_t actual = test_vext_u32_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ exp[i] = i + 1;
+ expected = vld1_u32 (exp);
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_u32_1.c
new file mode 100644
index 0000000..6ed6508
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextu32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_u32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u64.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_u64.x
new file mode 100644
index 0000000..8d5072b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u64.x
@@ -0,0 +1,17 @@
+extern void abort (void);
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint64_t arr1[] = {0};
+ uint64x1_t in1 = vld1_u64 (arr1);
+ uint64_t arr2[] = {1};
+ uint64x1_t in2 = vld1_u64 (arr2);
+ uint64x1_t actual = vext_u64 (in1, in2, 0);
+ if (actual != in1)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_u64_1.c
new file mode 100644
index 0000000..e6779f7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u64_1.c
@@ -0,0 +1,11 @@
+/* Test the `vextu64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_u64.x"
+
+/* Do not scan-assembler. An EXT instruction could be emitted, but would merely
+ return its first argument, so it is legitimate to optimize it out. */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u8.x b/gcc/testsuite/gcc.target/aarch64/simd/ext_u8.x
new file mode 100644
index 0000000..4d58057
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u8.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+uint8x8_t
+test_vext_u8_1 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 1);
+}
+
+uint8x8_t
+test_vext_u8_2 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 2);
+}
+
+uint8x8_t
+test_vext_u8_3 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 3);
+}
+
+uint8x8_t
+test_vext_u8_4 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 4);
+}
+
+uint8x8_t
+test_vext_u8_5 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 5);
+}
+
+uint8x8_t
+test_vext_u8_6 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 6);
+}
+
+uint8x8_t
+test_vext_u8_7 (uint8x8_t a, uint8x8_t b)
+{
+ return vext_u8 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ uint8x8_t in1 = vld1_u8 (arr1);
+ uint8_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ uint8x8_t in2 = vld1_u8 (arr2);
+ uint8_t exp[8];
+ uint8x8_t expected;
+ uint8x8_t actual = test_vext_u8_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vext_u8_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1_u8 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/ext_u8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/ext_u8_1.c
new file mode 100644
index 0000000..8e91b61
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/ext_u8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextu8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "ext_u8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?\[vV\]\[0-9\]+\.8\[bB\], ?#?\[0-9\]+\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_f32.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_f32.x
new file mode 100644
index 0000000..b8059d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_f32.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+float32x4_t
+test_vextq_f32_1 (float32x4_t a, float32x4_t b)
+{
+ return vextq_f32 (a, b, 1);
+}
+
+float32x4_t
+test_vextq_f32_2 (float32x4_t a, float32x4_t b)
+{
+ return vextq_f32 (a, b, 2);
+}
+
+float32x4_t
+test_vextq_f32_3 (float32x4_t a, float32x4_t b)
+{
+ return vextq_f32 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ float32_t arr1[] = {0, 1, 2, 3};
+ float32x4_t in1 = vld1q_f32 (arr1);
+ float32_t arr2[] = {4, 5, 6, 7};
+ float32x4_t in2 = vld1q_f32 (arr2);
+ float32_t exp[4];
+ float32x4_t expected;
+ float32x4_t actual = test_vextq_f32_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1q_f32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_f32_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1q_f32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_f32_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1q_f32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_f32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_f32_1.c
new file mode 100644
index 0000000..94bce1a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_f32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQf32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_f32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_f64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_f64_1.c
new file mode 100644
index 0000000..c60b1f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_f64_1.c
@@ -0,0 +1,36 @@
+/* Test the `vextq_f64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+extern void abort (void);
+#include <stdio.h>
+
+float64x2_t
+test_vextq_f64_1 (float64x2_t a, float64x2_t b)
+{
+ return vextq_f64 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ float64_t arr1[] = {0, 1};
+ float64x2_t in1 = vld1q_f64 (arr1);
+ float64_t arr2[] = {2, 3};
+ float64x2_t in2 = vld1q_f64 (arr2);
+ float64_t exp[] = {1, 2};
+ float64x2_t expected = vld1q_f64 (exp);
+ float64x2_t actual = test_vextq_f64_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.8\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_p16.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_p16.x
new file mode 100644
index 0000000..9b7cf4e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_p16.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+poly16x8_t
+test_vextq_p16_1 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 1);
+}
+
+poly16x8_t
+test_vextq_p16_2 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 2);
+}
+
+poly16x8_t
+test_vextq_p16_3 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 3);
+}
+
+poly16x8_t
+test_vextq_p16_4 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 4);
+}
+
+poly16x8_t
+test_vextq_p16_5 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 5);
+}
+
+poly16x8_t
+test_vextq_p16_6 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 6);
+}
+
+poly16x8_t
+test_vextq_p16_7 (poly16x8_t a, poly16x8_t b)
+{
+ return vextq_p16 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ poly16_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ poly16x8_t in1 = vld1q_p16 (arr1);
+ poly16_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ poly16x8_t in2 = vld1q_p16 (arr2);
+ poly16_t exp[8];
+ poly16x8_t expected;
+ poly16x8_t actual = test_vextq_p16_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p16_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1q_p16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_p16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_p16_1.c
new file mode 100644
index 0000000..8f73eef
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_p16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQp16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_p16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_p8.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_p8.x
new file mode 100644
index 0000000..1f53060
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_p8.x
@@ -0,0 +1,227 @@
+extern void abort (void);
+
+poly8x16_t
+test_vextq_p8_1 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 1);
+}
+
+poly8x16_t
+test_vextq_p8_2 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 2);
+}
+
+poly8x16_t
+test_vextq_p8_3 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 3);
+}
+
+poly8x16_t
+test_vextq_p8_4 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 4);
+}
+
+poly8x16_t
+test_vextq_p8_5 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 5);
+}
+
+poly8x16_t
+test_vextq_p8_6 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 6);
+}
+
+poly8x16_t
+test_vextq_p8_7 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 7);
+}
+
+poly8x16_t
+test_vextq_p8_8 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 8);
+}
+
+poly8x16_t
+test_vextq_p8_9 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 9);
+}
+
+poly8x16_t
+test_vextq_p8_10 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 10);
+}
+
+poly8x16_t
+test_vextq_p8_11 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 11);
+}
+
+poly8x16_t
+test_vextq_p8_12 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 12);
+}
+
+poly8x16_t
+test_vextq_p8_13 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 13);
+}
+
+poly8x16_t
+test_vextq_p8_14 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 14);
+}
+
+poly8x16_t
+test_vextq_p8_15 (poly8x16_t a, poly8x16_t b)
+{
+ return vextq_p8 (a, b, 15);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ poly8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ poly8x16_t in1 = vld1q_p8 (arr1);
+ poly8_t arr2[] =
+ {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
+ poly8x16_t in2 = vld1q_p8 (arr2);
+ poly8_t exp[16];
+ poly8x16_t expected;
+ poly8x16_t actual = test_vextq_p8_1 (in1, in2);
+
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 1;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_2 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 2;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_3 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 3;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_4 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 4;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_5 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 5;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_6 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 6;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_7 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 7;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_8 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 8;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_9 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 9;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_10 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 10;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_11 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 11;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_12 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 12;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_13 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 13;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_14 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 14;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_p8_15 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 15;
+ expected = vld1q_p8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_p8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_p8_1.c
new file mode 100644
index 0000000..ea2d399
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_p8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQp8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_p8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#?\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 15 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s16.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_s16.x
new file mode 100644
index 0000000..f5573c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s16.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+int16x8_t
+test_vextq_s16_1 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 1);
+}
+
+int16x8_t
+test_vextq_s16_2 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 2);
+}
+
+int16x8_t
+test_vextq_s16_3 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 3);
+}
+
+int16x8_t
+test_vextq_s16_4 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 4);
+}
+
+int16x8_t
+test_vextq_s16_5 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 5);
+}
+
+int16x8_t
+test_vextq_s16_6 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 6);
+}
+
+int16x8_t
+test_vextq_s16_7 (int16x8_t a, int16x8_t b)
+{
+ return vextq_s16 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int16_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ int16x8_t in1 = vld1q_s16 (arr1);
+ int16_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ int16x8_t in2 = vld1q_s16 (arr2);
+ int16_t exp[8];
+ int16x8_t expected;
+ int16x8_t actual = test_vextq_s16_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s16_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1q_s16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_s16_1.c
new file mode 100644
index 0000000..8b3d5fb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQs16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_s16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s32.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_s32.x
new file mode 100644
index 0000000..02cb78b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s32.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+int32x4_t
+test_vextq_s32_1 (int32x4_t a, int32x4_t b)
+{
+ return vextq_s32 (a, b, 1);
+}
+
+int32x4_t
+test_vextq_s32_2 (int32x4_t a, int32x4_t b)
+{
+ return vextq_s32 (a, b, 2);
+}
+
+int32x4_t
+test_vextq_s32_3 (int32x4_t a, int32x4_t b)
+{
+ return vextq_s32 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int32_t arr1[] = {0, 1, 2, 3};
+ int32x4_t in1 = vld1q_s32 (arr1);
+ int32_t arr2[] = {4, 5, 6, 7};
+ int32x4_t in2 = vld1q_s32 (arr2);
+ int32_t exp[4];
+ int32x4_t expected;
+ int32x4_t actual = test_vextq_s32_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1q_s32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s32_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1q_s32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s32_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1q_s32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_s32_1.c
new file mode 100644
index 0000000..4f1b08b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQs32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_s32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s64.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_s64.x
new file mode 100644
index 0000000..8068bf8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s64.x
@@ -0,0 +1,30 @@
+extern void abort (void);
+
+int64x2_t
+test_vextq_s64_1 (int64x2_t a, int64x2_t b)
+{
+ return vextq_s64 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ int64_t arr1[] = {0, 1};
+ int64x2_t in1 = vld1q_s64 (arr1);
+ int64_t arr2[] = {2, 3};
+ int64x2_t in2 = vld1q_s64 (arr2);
+ int64_t exp[2];
+ int64x2_t expected;
+ int64x2_t actual = test_vextq_s64_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ exp[i] = i + 1;
+ expected = vld1q_s64 (exp);
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_s64_1.c
new file mode 100644
index 0000000..cb308fb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s64_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQs64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_s64.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.8\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s8.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_s8.x
new file mode 100644
index 0000000..012a858
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s8.x
@@ -0,0 +1,227 @@
+extern void abort (void);
+
+int8x16_t
+test_vextq_s8_1 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 1);
+}
+
+int8x16_t
+test_vextq_s8_2 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 2);
+}
+
+int8x16_t
+test_vextq_s8_3 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 3);
+}
+
+int8x16_t
+test_vextq_s8_4 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 4);
+}
+
+int8x16_t
+test_vextq_s8_5 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 5);
+}
+
+int8x16_t
+test_vextq_s8_6 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 6);
+}
+
+int8x16_t
+test_vextq_s8_7 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 7);
+}
+
+int8x16_t
+test_vextq_s8_8 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 8);
+}
+
+int8x16_t
+test_vextq_s8_9 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 9);
+}
+
+int8x16_t
+test_vextq_s8_10 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 10);
+}
+
+int8x16_t
+test_vextq_s8_11 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 11);
+}
+
+int8x16_t
+test_vextq_s8_12 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 12);
+}
+
+int8x16_t
+test_vextq_s8_13 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 13);
+}
+
+int8x16_t
+test_vextq_s8_14 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 14);
+}
+
+int8x16_t
+test_vextq_s8_15 (int8x16_t a, int8x16_t b)
+{
+ return vextq_s8 (a, b, 15);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ int8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ int8x16_t in1 = vld1q_s8 (arr1);
+ int8_t arr2[] =
+ {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
+ int8x16_t in2 = vld1q_s8 (arr2);
+ int8_t exp[16];
+ int8x16_t expected;
+ int8x16_t actual = test_vextq_s8_1 (in1, in2);
+
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 1;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_2 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 2;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_3 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 3;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_4 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 4;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_5 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 5;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_6 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 6;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_7 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 7;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_8 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 8;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_9 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 9;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_10 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 10;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_11 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 11;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_12 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 12;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_13 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 13;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_14 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 14;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_s8_15 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 15;
+ expected = vld1q_s8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_s8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_s8_1.c
new file mode 100644
index 0000000..7e1e50a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_s8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQs8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_s8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#?\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 15 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u16.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_u16.x
new file mode 100644
index 0000000..66bc9f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u16.x
@@ -0,0 +1,114 @@
+extern void abort (void);
+
+uint16x8_t
+test_vextq_u16_1 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 1);
+}
+
+uint16x8_t
+test_vextq_u16_2 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 2);
+}
+
+uint16x8_t
+test_vextq_u16_3 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 3);
+}
+
+uint16x8_t
+test_vextq_u16_4 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 4);
+}
+
+uint16x8_t
+test_vextq_u16_5 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 5);
+}
+
+uint16x8_t
+test_vextq_u16_6 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 6);
+}
+
+uint16x8_t
+test_vextq_u16_7 (uint16x8_t a, uint16x8_t b)
+{
+ return vextq_u16 (a, b, 7);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint16_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ uint16x8_t in1 = vld1q_u16 (arr1);
+ uint16_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
+ uint16x8_t in2 = vld1q_u16 (arr2);
+ uint16_t exp[8];
+ uint16x8_t expected;
+ uint16x8_t actual = test_vextq_u16_1 (in1, in2);
+
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 1;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_2 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 2;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_3 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 3;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_4 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 4;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_5 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 5;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_6 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 6;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u16_7 (in1, in2);
+ for (i = 0; i < 8; i++)
+ exp[i] = i + 7;
+ expected = vld1q_u16 (exp);
+ for (i = 0; i < 8; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u16_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_u16_1.c
new file mode 100644
index 0000000..edf3efd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u16_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQu16' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_u16.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 7 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u32.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_u32.x
new file mode 100644
index 0000000..61bec8b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u32.x
@@ -0,0 +1,58 @@
+extern void abort (void);
+
+uint32x4_t
+test_vextq_u32_1 (uint32x4_t a, uint32x4_t b)
+{
+ return vextq_u32 (a, b, 1);
+}
+
+uint32x4_t
+test_vextq_u32_2 (uint32x4_t a, uint32x4_t b)
+{
+ return vextq_u32 (a, b, 2);
+}
+
+uint32x4_t
+test_vextq_u32_3 (uint32x4_t a, uint32x4_t b)
+{
+ return vextq_u32 (a, b, 3);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint32_t arr1[] = {0, 1, 2, 3};
+ uint32x4_t in1 = vld1q_u32 (arr1);
+ uint32_t arr2[] = {4, 5, 6, 7};
+ uint32x4_t in2 = vld1q_u32 (arr2);
+ uint32_t exp[4];
+ uint32x4_t expected;
+ uint32x4_t actual = test_vextq_u32_1 (in1, in2);
+
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 1;
+ expected = vld1q_u32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u32_2 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 2;
+ expected = vld1q_u32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u32_3 (in1, in2);
+ for (i = 0; i < 4; i++)
+ exp[i] = i + 3;
+ expected = vld1q_u32 (exp);
+ for (i = 0; i < 4; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_u32_1.c
new file mode 100644
index 0000000..f3eb56e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u32_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQu32' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_u32.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.4)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 3 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u64.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_u64.x
new file mode 100644
index 0000000..e1bd267
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u64.x
@@ -0,0 +1,30 @@
+extern void abort (void);
+
+uint64x2_t
+test_vextq_u64_1 (uint64x2_t a, uint64x2_t b)
+{
+ return vextq_u64 (a, b, 1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, off;
+ uint64_t arr1[] = {0, 1};
+ uint64x2_t in1 = vld1q_u64 (arr1);
+ uint64_t arr2[] = {2, 3};
+ uint64x2_t in2 = vld1q_u64 (arr2);
+ uint64_t exp[2];
+ uint64x2_t expected;
+ uint64x2_t actual = test_vextq_u64_1 (in1, in2);
+
+ for (i = 0; i < 2; i++)
+ exp[i] = i + 1;
+ expected = vld1q_u64 (exp);
+ for (i = 0; i < 2; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_u64_1.c
new file mode 100644
index 0000000..d999c2c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u64_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQu64' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_u64.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#\[0-9\]+\(?:.8\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 1 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u8.x b/gcc/testsuite/gcc.target/aarch64/simd/extq_u8.x
new file mode 100644
index 0000000..2b25dec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u8.x
@@ -0,0 +1,227 @@
+extern void abort (void);
+
+uint8x16_t
+test_vextq_u8_1 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 1);
+}
+
+uint8x16_t
+test_vextq_u8_2 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 2);
+}
+
+uint8x16_t
+test_vextq_u8_3 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 3);
+}
+
+uint8x16_t
+test_vextq_u8_4 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 4);
+}
+
+uint8x16_t
+test_vextq_u8_5 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 5);
+}
+
+uint8x16_t
+test_vextq_u8_6 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 6);
+}
+
+uint8x16_t
+test_vextq_u8_7 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 7);
+}
+
+uint8x16_t
+test_vextq_u8_8 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 8);
+}
+
+uint8x16_t
+test_vextq_u8_9 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 9);
+}
+
+uint8x16_t
+test_vextq_u8_10 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 10);
+}
+
+uint8x16_t
+test_vextq_u8_11 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 11);
+}
+
+uint8x16_t
+test_vextq_u8_12 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 12);
+}
+
+uint8x16_t
+test_vextq_u8_13 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 13);
+}
+
+uint8x16_t
+test_vextq_u8_14 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 14);
+}
+
+uint8x16_t
+test_vextq_u8_15 (uint8x16_t a, uint8x16_t b)
+{
+ return vextq_u8 (a, b, 15);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ uint8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ uint8x16_t in1 = vld1q_u8 (arr1);
+ uint8_t arr2[] =
+ {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
+ uint8x16_t in2 = vld1q_u8 (arr2);
+ uint8_t exp[16];
+ uint8x16_t expected;
+ uint8x16_t actual = test_vextq_u8_1 (in1, in2);
+
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 1;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_2 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 2;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_3 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 3;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_4 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 4;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_5 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 5;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_6 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 6;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_7 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 7;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_8 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 8;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_9 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 9;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_10 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 10;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_11 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 11;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_12 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 12;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_13 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 13;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_14 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 14;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ actual = test_vextq_u8_15 (in1, in2);
+ for (i = 0; i < 16; i++)
+ exp[i] = i + 15;
+ expected = vld1q_u8 (exp);
+ for (i = 0; i < 16; i++)
+ if (actual[i] != expected[i])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/extq_u8_1.c b/gcc/testsuite/gcc.target/aarch64/simd/extq_u8_1.c
new file mode 100644
index 0000000..30df9ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/simd/extq_u8_1.c
@@ -0,0 +1,10 @@
+/* Test the `vextQu8' AArch64 SIMD intrinsic. */
+
+/* { dg-do run } */
+/* { dg-options "-save-temps -O3 -fno-inline" } */
+
+#include "arm_neon.h"
+#include "extq_u8.x"
+
+/* { dg-final { scan-assembler-times "ext\[ \t\]+\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?\[vV\]\[0-9\]+\.16\[bB\], ?#?\[0-9\]+\(?:.2\)?\(?:\[ \t\]+@\[a-zA-Z0-9 \]+\)?\n" 15 } } */
+/* { dg-final { cleanup-saved-temps } } */