OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [fold-rotate-1.c] - Blame information for rev 696

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR middle-end/29749 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -fdump-tree-original" } */
4
 
5
#if __SCHAR_MAX__ == 127
6
 
7
unsigned char
8
e1 (unsigned char a)
9
{
10
  return a >> 5 | a << 3;
11
}
12
 
13
unsigned char
14
e2 (unsigned char a)
15
{
16
  return (a & 0xe0) >> 5 | (a & 0x1f) << 3;
17
}
18
 
19
unsigned char
20
e3 (unsigned char a)
21
{
22
  return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
23
}
24
 
25
#endif
26
 
27
#if __SHRT_MAX__ == 32767
28
 
29
unsigned short
30
f1 (unsigned short a)
31
{
32
  return a >> 8 | a << 8;
33
}
34
 
35
unsigned short
36
f2 (unsigned short a)
37
{
38
  return (a & 0xff00) >> 8 | (a & 0x00ff) << 8;
39
}
40
 
41
unsigned short
42
f3 (unsigned short a)
43
{
44
  return ((a >> 8) & 0x00ff) | ((a << 8) & 0xff00);
45
}
46
 
47
#endif
48
 
49
#if __INT_MAX__ == 2147483647
50
 
51
unsigned int
52
g1 (unsigned int a)
53
{
54
  return a >> 24 | a << 8;
55
}
56
 
57
unsigned int
58
g2 (unsigned int a)
59
{
60
  return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
61
}
62
 
63
unsigned int
64
g3 (unsigned int a)
65
{
66
  return ((a >> 24) & 0x000000ff) | ((a << 8) & 0xffffff00U);
67
}
68
 
69
#endif
70
 
71
int i;
72
 
73
/* { dg-final { scan-tree-dump-times "&" 0 "original" } } */
74
/* { dg-final { cleanup-tree-dump "original" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.