Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr55583.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wno-shift-count-overflow" } */
3 /* { dg-additional-options "-mno-sse -mno-mmx" { target ia32 } } */
4 /* { dg-final { scan-assembler-times {(?n)shrd[ql]?[\t ]*\$2} 4 } } */
5 /* { dg-final { scan-assembler-times {(?n)shld[ql]?[\t ]*\$2} 2 } } */
6
7 typedef unsigned long long u64;
8 typedef unsigned int u32;
9 typedef unsigned short u16;
10
11 long long a, b;
12 int c, d;
13 short e, f;
14 const int n = 2;
15
16 void test64r () { b = ((u64)b >> n) | (a << (64 - n)); }
17 void test32r () { d = ((u32)d >> n) | (c << (32 - n)); }
18
19 unsigned long long ua, ub;
20 unsigned int uc, ud;
21 unsigned short ue, uf;
22
23 void testu64l () { ub = (ub << n) | (ua >> (64 - n)); }
24 void testu64r () { ub = (ub >> n) | (ua << (64 - n)); }
25 void testu32l () { ud = (ud << n) | (uc >> (32 - n)); }
26 void testu32r () { ud = (ud >> n) | (uc << (32 - n)); }