Mercurial > hg > CbC > CbC_llvm
comparison llvm/test/TableGen/if.td @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
9 | 9 |
10 let n{11} = !if(y{3}, 1, | 10 let n{11} = !if(y{3}, 1, |
11 !if(y{2}, x{0}, | 11 !if(y{2}, x{0}, |
12 !if(y{1}, x{1}, | 12 !if(y{1}, x{1}, |
13 !if(y{0}, x{2}, ?)))); | 13 !if(y{0}, x{2}, ?)))); |
14 let n{10-9}= !if(x{2}, y{3-2}, | 14 let n{10...9}= !if(x{2}, y{3...2}, |
15 !if(x{1}, y{2-1}, | 15 !if(x{1}, y{2...1}, |
16 !if(x{0}, y{1-0}, ?))); | 16 !if(x{0}, y{1...0}, ?))); |
17 let n{8-6} = !if(x{2}, 0b010, 0b110); | 17 let n{8...6} = !if(x{2}, 0b010, 0b110); |
18 let n{5-4} = !if(x{1}, y{3-2}, {0, 1}); | 18 let n{5...4} = !if(x{1}, y{3...2}, {0, 1}); |
19 let n{3-0} = !if(x{0}, y{3-0}, {z, y{2}, y{1}, y{0}}); | 19 let n{3...0} = !if(x{0}, y{3...0}, {z, y{2}, y{1}, y{0}}); |
20 } | 20 } |
21 | 21 |
22 def C1 : C<{1, 0, 1}, {0, 1, 0, 1}, 0>; | 22 def C1 : C<{1, 0, 1}, {0, 1, 0, 1}, 0>; |
23 def C2 : C<{0, 1, 0}, {1, 0, 1, 0}, 1>; | 23 def C2 : C<{0, 1, 0}, {1, 0, 1, 0}, 1>; |
24 def C3 : C<{0, 0, 0}, {1, 0, 1, 0}, 0>; | 24 def C3 : C<{0, 0, 0}, {1, 0, 1, 0}, 0>; |
95 def E2d : E2<0>; | 95 def E2d : E2<0>; |
96 | 96 |
97 def EXd1 : EX<1, E1d, E2d>; | 97 def EXd1 : EX<1, E1d, E2d>; |
98 def EXd2 : EX<0, E1d, E2d>; | 98 def EXd2 : EX<0, E1d, E2d>; |
99 | 99 |
100 // CHECK: def Not1 | |
101 // CHECK: Result1a = "OK" | |
102 // CHECK: Result1b = "OK" | |
103 // CHECK: Result1c = "OK" | |
104 // CHECK: Result1d = "OK" | |
105 // CHECK: Result1e = "OK" | |
106 // CHECK: def Not2 | |
107 // CHECK: Result2a = "OK" | |
108 // CHECK: Result2b = "OK" | |
109 // CHECK: Result2c = "OK" | |
110 // CHECK: Result2d = "OK" | |
111 | |
112 def Not1 { | |
113 bit True = 1; | |
114 string Result1a = !if(True, "OK", "not OK"); | |
115 string Result1b = !if(!not(True), "not OK", "OK"); | |
116 | |
117 bit False = 0; | |
118 string Result1c = !if(False, "not OK", "OK"); | |
119 string Result1d = !if(!not(False), "OK", "not OK"); | |
120 string Result1e = !if(!not(!not(False)), "not OK", "OK"); | |
121 } | |
122 | |
123 def Not2 { | |
124 int one = 1; | |
125 string Result2a = !if(one, "OK", "not OK"); | |
126 string Result2b = !if(!not(one), "not OK", "OK"); | |
127 | |
128 int zero = 0; | |
129 string Result2c = !if(zero, "not OK", "OK"); | |
130 string Result2d = !if(!not(zero), "OK", "not OK"); | |
131 } | |
132 | |
100 // CHECK: def One | 133 // CHECK: def One |
101 // CHECK-NEXT: list<int> first = [1, 2, 3]; | 134 // CHECK-NEXT: list<int> first = [1, 2, 3]; |
102 // CHECK-NEXT: list<int> rest = [1, 2, 3]; | 135 // CHECK-NEXT: list<int> rest = [1, 2, 3]; |
103 | 136 |
104 // CHECK: def OneB | 137 // CHECK: def OneB |