Debian Codegraph @

gcc/testsuite/gcc.target/i386/dec-cmov-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-additional-options "-march=pentiumpro -mregparm=3" { target ia32 } } */
4
5 int foo_m1(int x)
6 {
7 x--;
8 if (x == 0)
9 x = 16;
10 return x;
11 }
12
13 int foo_m2(int x)
14 {
15 x -= 2;
16 if (x == 0)
17 x = 16;
18 return x;
19 }
20
21 int foo_p1(int x)
22 {
23 x++;
24 if (x == 0)
25 x = 16;
26 return x;
27 }
28
29 int foo_p2(int x)
30 {
31 x += 2;
32 if (x == 0)
33 x = 16;
34 return x;
35 }
36
37
38 #ifdef __x86_64__
39 long long fool_m1(long long x)
40 {
41 x--;
42 if (x == 0)
43 x = 16;
44 return x;
45 }
46
47 long long fool_m2(long long x)
48 {
49 x -= 2;
50 if (x == 0)
51 x = 16;
52 return x;
53 }
54
55 long long fool_p1(long long x)
56 {
57 x++;
58 if (x == 0)
59 x = 16;
60 return x;
61 }
62
63 long long fool_p2(long long x)
64 {
65 x += 2;
66 if (x == 0)
67 x = 16;
68 return x;
69 }
70 #endif /* __X86_64__ */
71
72 short foos_m1(short x)
73 {
74 x--;
75 if (x == 0)
76 x = 16;
77 return x;
78 }
79
80 short foos_m2(short x)
81 {
82 x -= 2;
83 if (x == 0)
84 x = 16;
85 return x;
86 }
87
88 short foos_p1(short x)
89 {
90 x++;
91 if (x == 0)
92 x = 16;
93 return x;
94 }
95
96 short foos_p2(short x)
97 {
98 x += 2;
99 if (x == 0)
100 x = 16;
101 return x;
102 }
103
104 /* { dg-final { scan-assembler-not "mov(l|q)\[ \\t\]*%(e|r)(cx|di), %(e|r)ax" } } */
105