File: fold-rotate-1.c

package info (click to toggle)
gcc-riscv64-unknown-elf 8.3.0.2019.08%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680,956 kB
  • sloc: ansic: 3,237,715; cpp: 896,882; ada: 772,854; f90: 144,254; asm: 68,788; makefile: 67,456; sh: 29,743; exp: 28,045; objc: 15,273; fortran: 11,885; python: 7,369; pascal: 5,375; awk: 3,725; perl: 2,872; yacc: 316; xml: 311; ml: 285; lex: 198; haskell: 122
file content (73 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* PR middle-end/29749 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */

#if __SCHAR_MAX__ == 127

unsigned char
e1 (unsigned char a)
{
  return a >> 5 | a << 3;
}

unsigned char
e2 (unsigned char a)
{
  return (a & 0xe0) >> 5 | (a & 0x1f) << 3;
}

unsigned char
e3 (unsigned char a)
{
  return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
}

#endif

#if __SHRT_MAX__ == 32767

unsigned short
f1 (unsigned short a)
{
  return a >> 8 | a << 8;
}

unsigned short
f2 (unsigned short a)
{
  return (a & 0xff00) >> 8 | (a & 0x00ff) << 8;
}

unsigned short
f3 (unsigned short a)
{
  return ((a >> 8) & 0x00ff) | ((a << 8) & 0xff00);
}

#endif

#if __INT_MAX__ == 2147483647

unsigned int
g1 (unsigned int a)
{
  return a >> 24 | a << 8;
}

unsigned int
g2 (unsigned int a)
{
  return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
}

unsigned int
g3 (unsigned int a)
{
  return ((a >> 24) & 0x000000ff) | ((a << 8) & 0xffffff00U);
}

#endif

int i;

/* { dg-final { scan-tree-dump-times "&" 0 "original" } } */