Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/imm-load1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mabi=lp64d -O2" } */
3 /* { dg-final { scan-assembler-not "test:.*lu52i\.d.*\n\taddi\.w.*\n\.L2:" } } */
4 /* { dg-final { scan-assembler "test:.*lu12i\.w.*\n\tbstrins\.d.*\n\.L2:" } } */
5
6
7 extern long long b[10];
8 static inline long long
9 repeat_bytes (void)
10 {
11 long long r = 0x0101010101010101;
12
13 return r;
14 }
15
16 static inline long long
17 highbit_mask (long long m)
18 {
19 return m & repeat_bytes ();
20 }
21
22 void test(long long *a)
23 {
24 for (int i = 0; i < 10; i++)
25 b[i] = highbit_mask (a[i]);
26
27 }