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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [rotatetest.c] - Blame information for rev 701

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run { target { x86_64-*-* && lp64 } } } */
2
/* { dg-options "-g" } */
3
 
4
volatile int vv;
5
 
6
__attribute__((noclone, noinline)) long
7
f1 (unsigned long x)
8
{
9
  long f = (x << 12) | (x >> (64 - 12));
10
  long g = f;
11
  asm volatile ("" : "+r" (f));
12
  vv++;         /* { dg-final { gdb-test 12 "g" "f" } } */
13
  return f;
14
}
15
 
16
__attribute__((noclone, noinline)) long
17
f2 (unsigned long x, int y)
18
{
19
  long f = (x << y) | (x >> (64 - y));
20
  long g = f;
21
  asm volatile ("" : "+r" (f));
22
  vv++;         /* { dg-final { gdb-test 22 "g" "f" } } */
23
  return f;
24
}
25
 
26
__attribute__((noclone, noinline)) long
27
f3 (unsigned long x, int y)
28
{
29
  long f = (x >> y) | (x << (64 - y));
30
  long g = f;
31
  asm volatile ("" : "+r" (f));
32
  vv++;         /* { dg-final { gdb-test 32 "g" "f" } } */
33
  return f;
34
}
35
 
36
__attribute__((noclone, noinline)) unsigned int
37
f4 (unsigned int x)
38
{
39
  unsigned int f = (x << 12) | (x >> (32 - 12));
40
  unsigned int g = f;
41
  asm volatile ("" : "+r" (f));
42
  vv++;         /* { dg-final { gdb-test 42 "g" "f" } } */
43
  return f;
44
}
45
 
46
__attribute__((noclone, noinline)) unsigned int
47
f5 (unsigned int x, int y)
48
{
49
  unsigned int f = (x << y) | (x >> (32 - y));
50
  unsigned int g = f;
51
  asm volatile ("" : "+r" (f));
52
  vv++;         /* { dg-final { gdb-test 52 "g" "f" } } */
53
  return f;
54
}
55
 
56
__attribute__((noclone, noinline)) unsigned int
57
f6 (unsigned int x, int y)
58
{
59
  unsigned int f = (x >> y) | (x << (32 - y));
60
  unsigned int g = f;
61
  asm volatile ("" : "+r" (f));
62
  vv++;         /* { dg-final { gdb-test 62 "g" "f" } } */
63
  return f;
64
}
65
 
66
int
67
main ()
68
{
69
  f1 (0x123456789abcde0fUL);
70
  f2 (0x123456789abcde0fUL, 18);
71
  f3 (0x123456789abcde0fUL, 17);
72
  f4 (0x12345678);
73
  f5 (0x12345678, 18);
74
  f6 (0x12345678, 17);
75
  return 0;
76
}

powered by: WebSVN 2.1.0

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