Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/xar_neon_modes.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3
4 #pragma GCC target "+sve2+nosha3"
5
6 typedef char __attribute__ ((vector_size (16))) v16qi;
7 typedef unsigned short __attribute__ ((vector_size (16))) v8hi;
8 typedef unsigned int __attribute__ ((vector_size (16))) v4si;
9 typedef unsigned long long __attribute__ ((vector_size (16))) v2di;
10
11 v16qi
12 xar_v16qi (v16qi a, v16qi b) {
13 v16qi c = a ^ b;
14 return (c << 2) ^ (c >> 6);
15 }
16 /* { dg-final { scan-assembler {\txar\tz0.b, z[0-9]+.b, z[0-9]+.b, #6} } } */
17
18 v8hi
19 xar_v8hi (v8hi a, v8hi b) {
20 v8hi c = a ^ b;
21 return (c << 13) ^ (c >> 3);
22 }
23 /* { dg-final { scan-assembler {\txar\tz0.h, z[0-9]+.h, z[0-9]+.h, #3} } } */
24
25 v4si
26 xar_v4si (v4si a, v4si b) {
27 v4si c = a ^ b;
28 return (c << 9) ^ (c >> 23);
29 }
30 /* { dg-final { scan-assembler {\txar\tz0.s, z[0-9]+.s, z[0-9]+.s, #23} } } */
31
32 /* When +sha3 for Advanced SIMD is not available we should still use the
33 SVE2 form of XAR. */
34 v2di
35 xar_v2di (v2di a, v2di b) {
36 v2di c = a ^ b;
37 return (c << 22) ^ (c >> 42);
38 }
39 /* { dg-final { scan-assembler {\txar\tz0.d, z[0-9]+.d, z[0-9]+.d, #42} } } */