Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/pr113033.c

raw
1 /* PR target/113033: ICE with vector left rotate */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -mlasx" } */
4
5 typedef unsigned __attribute__ ((vector_size (16))) v4si;
6 typedef unsigned __attribute__ ((vector_size (32))) v8si;
7 typedef unsigned long long __attribute__ ((vector_size (16))) v2di;
8 typedef unsigned long long __attribute__ ((vector_size (32))) v4di;
9
10 #define TEST(tp) \
11 extern tp data_##tp; \
12 tp \
13 test_##tp (int x) \
14 { \
15 const int bit = sizeof (data_##tp[0]) * __CHAR_BIT__; \
16 data_##tp = data_##tp << (x & (bit - 1)) \
17 | data_##tp >> (bit - x & (bit - 1)); \
18 }
19
20 TEST (v4si)
21 TEST (v8si)
22 TEST (v2di)
23 TEST (v4di)