Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/vect-rotr.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mlasx" } */
3 /* { dg-final { scan-assembler "\tvrotr\.w\t" } } */
4 /* { dg-final { scan-assembler "\txvrotr\.w\t" } } */
5 /* { dg-final { scan-assembler "\tvrotri\.w\t\[^\n\]*7\n" } } */
6 /* { dg-final { scan-assembler "\txvrotri\.w\t\[^\n\]*7\n" } } */
7
8 unsigned int a[8], b[8];
9
10 void
11 test1 (void)
12 {
13 for (int i = 0; i < 4; i++)
14 a[i] = a[i] >> b[i] | a[i] << (32 - b[i]);
15 }
16
17 void
18 test2 (void)
19 {
20 for (int i = 0; i < 8; i++)
21 a[i] = a[i] >> b[i] | a[i] << (32 - b[i]);
22 }
23
24 void
25 test3 (void)
26 {
27 for (int i = 0; i < 4; i++)
28 a[i] = a[i] >> 7 | a[i] << 25;
29 }
30
31 void
32 test4 (void)
33 {
34 for (int i = 0; i < 8; i++)
35 a[i] = a[i] >> 7 | a[i] << 25;
36 }