Add execution + assembler tests of AArch64 TRN Intrinsics.
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / simd / vtrnqs16.x
blob17b2db881a5a1dc464dd0f276cb5f25c5ef79ea0
1 extern void abort (void);
3 int16x8x2_t
4 test_vtrnqs16 (int16x8_t _a, int16x8_t _b)
6   return vtrnq_s16 (_a, _b);
9 int
10 main (int argc, char **argv)
12   int i;
13   int16_t first[] = {1, 2, 3, 4, 5, 6, 7, 8};
14   int16_t second[] = {9, 10, 11, 12, 13, 14, 15, 16};
15   int16x8x2_t result = test_vtrnqs16 (vld1q_s16 (first), vld1q_s16 (second));
16   int16x8_t res1 = result.val[0], res2 = result.val[1];
17   int16_t exp1[] = {1, 9, 3, 11, 5, 13, 7, 15};
18   int16_t exp2[] = {2, 10, 4, 12, 6, 14, 8, 16};
19   int16x8_t expected1 = vld1q_s16 (exp1);
20   int16x8_t expected2 = vld1q_s16 (exp2);
22   for (i = 0; i < 8; i++)
23     if ((res1[i] != expected1[i]) || (res2[i] != expected2[i]))
24       abort ();
26   return 0;