Debian Codegraph @

gcc/testsuite/g++.target/aarch64/sve/tls_2.C

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target tls } */
3 /* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */
4 /* { dg-require-effective-target fpic } */
5
6 #include <stdint.h>
7
8 typedef int8_t v32qi __attribute__((vector_size (32)));
9
10 extern __thread int z;
11
12 void
13 foo (v32qi *a, int *b)
14 {
15 v32qi x = a[0], y = a[1];
16 asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0,
17 -1, -1, -1, -1, 0, 0, 0, 0,
18 -1, -1, -1, -1, -1, -1, -1, -1,
19 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y)
20 : "memory");
21 if (*b)
22 {
23 x = a[2], y = a[3];
24 asm volatile ("" :: "w" ((v32qi) { -1, 0, 0, -1, -1, -1, 0, 0,
25 -1, -1, -1, -1, 0, 0, 0, 0,
26 -1, -1, -1, -1, -1, -1, -1, -1,
27 0, 0, 0, 0, 0, 0, 0, 0 } ? x : y),
28 "r" (z));
29 }
30 }
31
32 /* { dg-final { scan-assembler-times {\tldr\tp[0-9]} 2 } } */