Debian Codegraph @

gcc/testsuite/gcc.target/mips/mips16e2-cmov.c

raw
1 /* { dg-options "-mno-abicalls -mgpopt -G8 -mabi=32 -mips16 -mmips16e2 -mbranch-cost=2" } */
2 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
3
4 /* Test MOVN. */
5
6 /* { dg-final { scan-assembler-times "test01:.*\tmovn\t.*test01\n" 1 } } */
7 int
8 test01 (int a, int b, int c)
9 {
10 return (a==0) ? b : c;
11 }
12
13 /* { dg-final { scan-assembler-times "test02:.*\tmovn\t\\\$.,\\\$0.*test02\n" 1 } } */
14 int
15 test02 (int a, int b, int c)
16 {
17 return (a==0) ? b : 0;
18 }
19
20 /* Test MOVZ. */
21
22 /* { dg-final { scan-assembler-times "test03:.*\tmovz\t.*test03\n" 1 } } */
23 int
24 test03 (int a, int b, int c)
25 {
26 return a ? b : c;
27 }
28
29 /* { dg-final { scan-assembler-times "test04:.*\tmovz\t\\\$.,\\\$0.*test04\n" 1 } } */
30 int
31 test04 (int a, int b, int c)
32 {
33 return a ? b : 0;
34 }
35
36 /* Test MOVTN. */
37
38 /* { dg-final { scan-assembler-times "test05:.*\tmovtn\t.*test05\n" 1 } } */
39 int
40 test05 (int a, int b, int c, int d)
41 {
42 return a >= b ? c : d;
43 }
44
45 /* { dg-final { scan-assembler-times "test06:.*\tmovtn\t\\\$2,\\\$0.*test06\n" 1 } } */
46 int
47 test06 (int a, int b, int c, int d)
48 {
49 return a >= b ? c : 0;
50 }
51
52 /* Test MOVTZ. */
53
54 /* { dg-final { scan-assembler-times "test07:.*\tmovtz\t.*test07\n" 1 } } */
55 int
56 test07 (int a, int b, int c, int d)
57 {
58 return a < b ? c : d;
59 }
60
61 /* { dg-final { scan-assembler-times "test08:.*\tmovtz\t\\\$.,\\\$0.*test08\n" 1 } } */
62 int
63 test08 (int a, int b, int c, int d)
64 {
65 return a < b ? c : 0;
66 }
67
68