Lines Matching refs:m
25 RawMachineAssemblerTester<int32_t> m; in TEST() local
26 Node* add = m.Int32Add(m.Int32Constant(0), m.Int32Constant(1)); in TEST()
27 m.Return(add); in TEST()
28 CHECK_EQ(1, m.Call()); in TEST()
33 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
34 if (!m.machine()->Word32Ctz().IsSupported()) { in TEST()
38 m.Return(m.AddNode(m.machine()->Word32Ctz().op(), m.Parameter(0))); in TEST()
40 CHECK_EQ(32, m.Call(uint32_t(0x00000000))); in TEST()
41 CHECK_EQ(31, m.Call(uint32_t(0x80000000))); in TEST()
42 CHECK_EQ(30, m.Call(uint32_t(0x40000000))); in TEST()
43 CHECK_EQ(29, m.Call(uint32_t(0x20000000))); in TEST()
44 CHECK_EQ(28, m.Call(uint32_t(0x10000000))); in TEST()
45 CHECK_EQ(27, m.Call(uint32_t(0xa8000000))); in TEST()
46 CHECK_EQ(26, m.Call(uint32_t(0xf4000000))); in TEST()
47 CHECK_EQ(25, m.Call(uint32_t(0x62000000))); in TEST()
48 CHECK_EQ(24, m.Call(uint32_t(0x91000000))); in TEST()
49 CHECK_EQ(23, m.Call(uint32_t(0xcd800000))); in TEST()
50 CHECK_EQ(22, m.Call(uint32_t(0x09400000))); in TEST()
51 CHECK_EQ(21, m.Call(uint32_t(0xaf200000))); in TEST()
52 CHECK_EQ(20, m.Call(uint32_t(0xac100000))); in TEST()
53 CHECK_EQ(19, m.Call(uint32_t(0xe0b80000))); in TEST()
54 CHECK_EQ(18, m.Call(uint32_t(0x9ce40000))); in TEST()
55 CHECK_EQ(17, m.Call(uint32_t(0xc7920000))); in TEST()
56 CHECK_EQ(16, m.Call(uint32_t(0xb8f10000))); in TEST()
57 CHECK_EQ(15, m.Call(uint32_t(0x3b9f8000))); in TEST()
58 CHECK_EQ(14, m.Call(uint32_t(0xdb4c4000))); in TEST()
59 CHECK_EQ(13, m.Call(uint32_t(0xe9a32000))); in TEST()
60 CHECK_EQ(12, m.Call(uint32_t(0xfca61000))); in TEST()
61 CHECK_EQ(11, m.Call(uint32_t(0x6c8a7800))); in TEST()
62 CHECK_EQ(10, m.Call(uint32_t(0x8ce5a400))); in TEST()
63 CHECK_EQ(9, m.Call(uint32_t(0xcb7d0200))); in TEST()
64 CHECK_EQ(8, m.Call(uint32_t(0xcb4dc100))); in TEST()
65 CHECK_EQ(7, m.Call(uint32_t(0xdfbec580))); in TEST()
66 CHECK_EQ(6, m.Call(uint32_t(0x27a9db40))); in TEST()
67 CHECK_EQ(5, m.Call(uint32_t(0xde3bcb20))); in TEST()
68 CHECK_EQ(4, m.Call(uint32_t(0xd7e8a610))); in TEST()
69 CHECK_EQ(3, m.Call(uint32_t(0x9afdbc88))); in TEST()
70 CHECK_EQ(2, m.Call(uint32_t(0x9afdbc84))); in TEST()
71 CHECK_EQ(1, m.Call(uint32_t(0x9afdbc82))); in TEST()
72 CHECK_EQ(0, m.Call(uint32_t(0x9afdbc81))); in TEST()
77 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
78 m.Return(m.Word32Clz(m.Parameter(0))); in TEST()
80 CHECK_EQ(0, m.Call(uint32_t(0x80001000))); in TEST()
81 CHECK_EQ(1, m.Call(uint32_t(0x40000500))); in TEST()
82 CHECK_EQ(2, m.Call(uint32_t(0x20000300))); in TEST()
83 CHECK_EQ(3, m.Call(uint32_t(0x10000003))); in TEST()
84 CHECK_EQ(4, m.Call(uint32_t(0x08050000))); in TEST()
85 CHECK_EQ(5, m.Call(uint32_t(0x04006000))); in TEST()
86 CHECK_EQ(6, m.Call(uint32_t(0x02000000))); in TEST()
87 CHECK_EQ(7, m.Call(uint32_t(0x010000a0))); in TEST()
88 CHECK_EQ(8, m.Call(uint32_t(0x00800c00))); in TEST()
89 CHECK_EQ(9, m.Call(uint32_t(0x00400000))); in TEST()
90 CHECK_EQ(10, m.Call(uint32_t(0x0020000d))); in TEST()
91 CHECK_EQ(11, m.Call(uint32_t(0x00100f00))); in TEST()
92 CHECK_EQ(12, m.Call(uint32_t(0x00080000))); in TEST()
93 CHECK_EQ(13, m.Call(uint32_t(0x00041000))); in TEST()
94 CHECK_EQ(14, m.Call(uint32_t(0x00020020))); in TEST()
95 CHECK_EQ(15, m.Call(uint32_t(0x00010300))); in TEST()
96 CHECK_EQ(16, m.Call(uint32_t(0x00008040))); in TEST()
97 CHECK_EQ(17, m.Call(uint32_t(0x00004005))); in TEST()
98 CHECK_EQ(18, m.Call(uint32_t(0x00002050))); in TEST()
99 CHECK_EQ(19, m.Call(uint32_t(0x00001700))); in TEST()
100 CHECK_EQ(20, m.Call(uint32_t(0x00000870))); in TEST()
101 CHECK_EQ(21, m.Call(uint32_t(0x00000405))); in TEST()
102 CHECK_EQ(22, m.Call(uint32_t(0x00000203))); in TEST()
103 CHECK_EQ(23, m.Call(uint32_t(0x00000101))); in TEST()
104 CHECK_EQ(24, m.Call(uint32_t(0x00000089))); in TEST()
105 CHECK_EQ(25, m.Call(uint32_t(0x00000041))); in TEST()
106 CHECK_EQ(26, m.Call(uint32_t(0x00000022))); in TEST()
107 CHECK_EQ(27, m.Call(uint32_t(0x00000013))); in TEST()
108 CHECK_EQ(28, m.Call(uint32_t(0x00000008))); in TEST()
109 CHECK_EQ(29, m.Call(uint32_t(0x00000004))); in TEST()
110 CHECK_EQ(30, m.Call(uint32_t(0x00000002))); in TEST()
111 CHECK_EQ(31, m.Call(uint32_t(0x00000001))); in TEST()
112 CHECK_EQ(32, m.Call(uint32_t(0x00000000))); in TEST()
117 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
118 if (!m.machine()->Word32Popcnt().IsSupported()) { in TEST()
122 m.Return(m.AddNode(m.machine()->Word32Popcnt().op(), m.Parameter(0))); in TEST()
124 CHECK_EQ(0, m.Call(uint32_t(0x00000000))); in TEST()
125 CHECK_EQ(1, m.Call(uint32_t(0x00000001))); in TEST()
126 CHECK_EQ(1, m.Call(uint32_t(0x80000000))); in TEST()
127 CHECK_EQ(32, m.Call(uint32_t(0xffffffff))); in TEST()
128 CHECK_EQ(6, m.Call(uint32_t(0x000dc100))); in TEST()
129 CHECK_EQ(9, m.Call(uint32_t(0xe00dc100))); in TEST()
130 CHECK_EQ(11, m.Call(uint32_t(0xe00dc103))); in TEST()
131 CHECK_EQ(9, m.Call(uint32_t(0x000dc107))); in TEST()
137 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint64()); in TEST() local
138 m.Return(m.Word64Clz(m.Parameter(0))); in TEST()
140 CHECK_EQ(0, m.Call(uint64_t(0x8000100000000000))); in TEST()
141 CHECK_EQ(1, m.Call(uint64_t(0x4000050000000000))); in TEST()
142 CHECK_EQ(2, m.Call(uint64_t(0x2000030000000000))); in TEST()
143 CHECK_EQ(3, m.Call(uint64_t(0x1000000300000000))); in TEST()
144 CHECK_EQ(4, m.Call(uint64_t(0x0805000000000000))); in TEST()
145 CHECK_EQ(5, m.Call(uint64_t(0x0400600000000000))); in TEST()
146 CHECK_EQ(6, m.Call(uint64_t(0x0200000000000000))); in TEST()
147 CHECK_EQ(7, m.Call(uint64_t(0x010000a000000000))); in TEST()
148 CHECK_EQ(8, m.Call(uint64_t(0x00800c0000000000))); in TEST()
149 CHECK_EQ(9, m.Call(uint64_t(0x0040000000000000))); in TEST()
150 CHECK_EQ(10, m.Call(uint64_t(0x0020000d00000000))); in TEST()
151 CHECK_EQ(11, m.Call(uint64_t(0x00100f0000000000))); in TEST()
152 CHECK_EQ(12, m.Call(uint64_t(0x0008000000000000))); in TEST()
153 CHECK_EQ(13, m.Call(uint64_t(0x0004100000000000))); in TEST()
154 CHECK_EQ(14, m.Call(uint64_t(0x0002002000000000))); in TEST()
155 CHECK_EQ(15, m.Call(uint64_t(0x0001030000000000))); in TEST()
156 CHECK_EQ(16, m.Call(uint64_t(0x0000804000000000))); in TEST()
157 CHECK_EQ(17, m.Call(uint64_t(0x0000400500000000))); in TEST()
158 CHECK_EQ(18, m.Call(uint64_t(0x0000205000000000))); in TEST()
159 CHECK_EQ(19, m.Call(uint64_t(0x0000170000000000))); in TEST()
160 CHECK_EQ(20, m.Call(uint64_t(0x0000087000000000))); in TEST()
161 CHECK_EQ(21, m.Call(uint64_t(0x0000040500000000))); in TEST()
162 CHECK_EQ(22, m.Call(uint64_t(0x0000020300000000))); in TEST()
163 CHECK_EQ(23, m.Call(uint64_t(0x0000010100000000))); in TEST()
164 CHECK_EQ(24, m.Call(uint64_t(0x0000008900000000))); in TEST()
165 CHECK_EQ(25, m.Call(uint64_t(0x0000004100000000))); in TEST()
166 CHECK_EQ(26, m.Call(uint64_t(0x0000002200000000))); in TEST()
167 CHECK_EQ(27, m.Call(uint64_t(0x0000001300000000))); in TEST()
168 CHECK_EQ(28, m.Call(uint64_t(0x0000000800000000))); in TEST()
169 CHECK_EQ(29, m.Call(uint64_t(0x0000000400000000))); in TEST()
170 CHECK_EQ(30, m.Call(uint64_t(0x0000000200000000))); in TEST()
171 CHECK_EQ(31, m.Call(uint64_t(0x0000000100000000))); in TEST()
172 CHECK_EQ(32, m.Call(uint64_t(0x0000000080001000))); in TEST()
173 CHECK_EQ(33, m.Call(uint64_t(0x0000000040000500))); in TEST()
174 CHECK_EQ(34, m.Call(uint64_t(0x0000000020000300))); in TEST()
175 CHECK_EQ(35, m.Call(uint64_t(0x0000000010000003))); in TEST()
176 CHECK_EQ(36, m.Call(uint64_t(0x0000000008050000))); in TEST()
177 CHECK_EQ(37, m.Call(uint64_t(0x0000000004006000))); in TEST()
178 CHECK_EQ(38, m.Call(uint64_t(0x0000000002000000))); in TEST()
179 CHECK_EQ(39, m.Call(uint64_t(0x00000000010000a0))); in TEST()
180 CHECK_EQ(40, m.Call(uint64_t(0x0000000000800c00))); in TEST()
181 CHECK_EQ(41, m.Call(uint64_t(0x0000000000400000))); in TEST()
182 CHECK_EQ(42, m.Call(uint64_t(0x000000000020000d))); in TEST()
183 CHECK_EQ(43, m.Call(uint64_t(0x0000000000100f00))); in TEST()
184 CHECK_EQ(44, m.Call(uint64_t(0x0000000000080000))); in TEST()
185 CHECK_EQ(45, m.Call(uint64_t(0x0000000000041000))); in TEST()
186 CHECK_EQ(46, m.Call(uint64_t(0x0000000000020020))); in TEST()
187 CHECK_EQ(47, m.Call(uint64_t(0x0000000000010300))); in TEST()
188 CHECK_EQ(48, m.Call(uint64_t(0x0000000000008040))); in TEST()
189 CHECK_EQ(49, m.Call(uint64_t(0x0000000000004005))); in TEST()
190 CHECK_EQ(50, m.Call(uint64_t(0x0000000000002050))); in TEST()
191 CHECK_EQ(51, m.Call(uint64_t(0x0000000000001700))); in TEST()
192 CHECK_EQ(52, m.Call(uint64_t(0x0000000000000870))); in TEST()
193 CHECK_EQ(53, m.Call(uint64_t(0x0000000000000405))); in TEST()
194 CHECK_EQ(54, m.Call(uint64_t(0x0000000000000203))); in TEST()
195 CHECK_EQ(55, m.Call(uint64_t(0x0000000000000101))); in TEST()
196 CHECK_EQ(56, m.Call(uint64_t(0x0000000000000089))); in TEST()
197 CHECK_EQ(57, m.Call(uint64_t(0x0000000000000041))); in TEST()
198 CHECK_EQ(58, m.Call(uint64_t(0x0000000000000022))); in TEST()
199 CHECK_EQ(59, m.Call(uint64_t(0x0000000000000013))); in TEST()
200 CHECK_EQ(60, m.Call(uint64_t(0x0000000000000008))); in TEST()
201 CHECK_EQ(61, m.Call(uint64_t(0x0000000000000004))); in TEST()
202 CHECK_EQ(62, m.Call(uint64_t(0x0000000000000002))); in TEST()
203 CHECK_EQ(63, m.Call(uint64_t(0x0000000000000001))); in TEST()
204 CHECK_EQ(64, m.Call(uint64_t(0x0000000000000000))); in TEST()
209 RawMachineAssemblerTester<int32_t> m(MachineType::Uint64()); in TEST() local
210 if (!m.machine()->Word64Ctz().IsSupported()) { in TEST()
214 m.Return(m.AddNode(m.machine()->Word64Ctz().op(), m.Parameter(0))); in TEST()
216 CHECK_EQ(64, m.Call(uint64_t(0x0000000000000000))); in TEST()
217 CHECK_EQ(63, m.Call(uint64_t(0x8000000000000000))); in TEST()
218 CHECK_EQ(62, m.Call(uint64_t(0x4000000000000000))); in TEST()
219 CHECK_EQ(61, m.Call(uint64_t(0x2000000000000000))); in TEST()
220 CHECK_EQ(60, m.Call(uint64_t(0x1000000000000000))); in TEST()
221 CHECK_EQ(59, m.Call(uint64_t(0xa800000000000000))); in TEST()
222 CHECK_EQ(58, m.Call(uint64_t(0xf400000000000000))); in TEST()
223 CHECK_EQ(57, m.Call(uint64_t(0x6200000000000000))); in TEST()
224 CHECK_EQ(56, m.Call(uint64_t(0x9100000000000000))); in TEST()
225 CHECK_EQ(55, m.Call(uint64_t(0xcd80000000000000))); in TEST()
226 CHECK_EQ(54, m.Call(uint64_t(0x0940000000000000))); in TEST()
227 CHECK_EQ(53, m.Call(uint64_t(0xaf20000000000000))); in TEST()
228 CHECK_EQ(52, m.Call(uint64_t(0xac10000000000000))); in TEST()
229 CHECK_EQ(51, m.Call(uint64_t(0xe0b8000000000000))); in TEST()
230 CHECK_EQ(50, m.Call(uint64_t(0x9ce4000000000000))); in TEST()
231 CHECK_EQ(49, m.Call(uint64_t(0xc792000000000000))); in TEST()
232 CHECK_EQ(48, m.Call(uint64_t(0xb8f1000000000000))); in TEST()
233 CHECK_EQ(47, m.Call(uint64_t(0x3b9f800000000000))); in TEST()
234 CHECK_EQ(46, m.Call(uint64_t(0xdb4c400000000000))); in TEST()
235 CHECK_EQ(45, m.Call(uint64_t(0xe9a3200000000000))); in TEST()
236 CHECK_EQ(44, m.Call(uint64_t(0xfca6100000000000))); in TEST()
237 CHECK_EQ(43, m.Call(uint64_t(0x6c8a780000000000))); in TEST()
238 CHECK_EQ(42, m.Call(uint64_t(0x8ce5a40000000000))); in TEST()
239 CHECK_EQ(41, m.Call(uint64_t(0xcb7d020000000000))); in TEST()
240 CHECK_EQ(40, m.Call(uint64_t(0xcb4dc10000000000))); in TEST()
241 CHECK_EQ(39, m.Call(uint64_t(0xdfbec58000000000))); in TEST()
242 CHECK_EQ(38, m.Call(uint64_t(0x27a9db4000000000))); in TEST()
243 CHECK_EQ(37, m.Call(uint64_t(0xde3bcb2000000000))); in TEST()
244 CHECK_EQ(36, m.Call(uint64_t(0xd7e8a61000000000))); in TEST()
245 CHECK_EQ(35, m.Call(uint64_t(0x9afdbc8800000000))); in TEST()
246 CHECK_EQ(34, m.Call(uint64_t(0x9afdbc8400000000))); in TEST()
247 CHECK_EQ(33, m.Call(uint64_t(0x9afdbc8200000000))); in TEST()
248 CHECK_EQ(32, m.Call(uint64_t(0x9afdbc8100000000))); in TEST()
249 CHECK_EQ(31, m.Call(uint64_t(0x0000000080000000))); in TEST()
250 CHECK_EQ(30, m.Call(uint64_t(0x0000000040000000))); in TEST()
251 CHECK_EQ(29, m.Call(uint64_t(0x0000000020000000))); in TEST()
252 CHECK_EQ(28, m.Call(uint64_t(0x0000000010000000))); in TEST()
253 CHECK_EQ(27, m.Call(uint64_t(0x00000000a8000000))); in TEST()
254 CHECK_EQ(26, m.Call(uint64_t(0x00000000f4000000))); in TEST()
255 CHECK_EQ(25, m.Call(uint64_t(0x0000000062000000))); in TEST()
256 CHECK_EQ(24, m.Call(uint64_t(0x0000000091000000))); in TEST()
257 CHECK_EQ(23, m.Call(uint64_t(0x00000000cd800000))); in TEST()
258 CHECK_EQ(22, m.Call(uint64_t(0x0000000009400000))); in TEST()
259 CHECK_EQ(21, m.Call(uint64_t(0x00000000af200000))); in TEST()
260 CHECK_EQ(20, m.Call(uint64_t(0x00000000ac100000))); in TEST()
261 CHECK_EQ(19, m.Call(uint64_t(0x00000000e0b80000))); in TEST()
262 CHECK_EQ(18, m.Call(uint64_t(0x000000009ce40000))); in TEST()
263 CHECK_EQ(17, m.Call(uint64_t(0x00000000c7920000))); in TEST()
264 CHECK_EQ(16, m.Call(uint64_t(0x00000000b8f10000))); in TEST()
265 CHECK_EQ(15, m.Call(uint64_t(0x000000003b9f8000))); in TEST()
266 CHECK_EQ(14, m.Call(uint64_t(0x00000000db4c4000))); in TEST()
267 CHECK_EQ(13, m.Call(uint64_t(0x00000000e9a32000))); in TEST()
268 CHECK_EQ(12, m.Call(uint64_t(0x00000000fca61000))); in TEST()
269 CHECK_EQ(11, m.Call(uint64_t(0x000000006c8a7800))); in TEST()
270 CHECK_EQ(10, m.Call(uint64_t(0x000000008ce5a400))); in TEST()
271 CHECK_EQ(9, m.Call(uint64_t(0x00000000cb7d0200))); in TEST()
272 CHECK_EQ(8, m.Call(uint64_t(0x00000000cb4dc100))); in TEST()
273 CHECK_EQ(7, m.Call(uint64_t(0x00000000dfbec580))); in TEST()
274 CHECK_EQ(6, m.Call(uint64_t(0x0000000027a9db40))); in TEST()
275 CHECK_EQ(5, m.Call(uint64_t(0x00000000de3bcb20))); in TEST()
276 CHECK_EQ(4, m.Call(uint64_t(0x00000000d7e8a610))); in TEST()
277 CHECK_EQ(3, m.Call(uint64_t(0x000000009afdbc88))); in TEST()
278 CHECK_EQ(2, m.Call(uint64_t(0x000000009afdbc84))); in TEST()
279 CHECK_EQ(1, m.Call(uint64_t(0x000000009afdbc82))); in TEST()
280 CHECK_EQ(0, m.Call(uint64_t(0x000000009afdbc81))); in TEST()
285 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint64()); in TEST() local
286 if (!m.machine()->Word64Popcnt().IsSupported()) { in TEST()
290 m.Return(m.AddNode(m.machine()->Word64Popcnt().op(), m.Parameter(0))); in TEST()
292 CHECK_EQ(0, m.Call(uint64_t(0x0000000000000000))); in TEST()
293 CHECK_EQ(1, m.Call(uint64_t(0x0000000000000001))); in TEST()
294 CHECK_EQ(1, m.Call(uint64_t(0x8000000000000000))); in TEST()
295 CHECK_EQ(64, m.Call(uint64_t(0xffffffffffffffff))); in TEST()
296 CHECK_EQ(12, m.Call(uint64_t(0x000dc100000dc100))); in TEST()
297 CHECK_EQ(18, m.Call(uint64_t(0xe00dc100e00dc100))); in TEST()
298 CHECK_EQ(22, m.Call(uint64_t(0xe00dc103e00dc103))); in TEST()
299 CHECK_EQ(18, m.Call(uint64_t(0x000dc107000dc107))); in TEST()
304 static Node* Int32Input(RawMachineAssemblerTester<int32_t>* m, int index) { in Int32Input() argument
307 return m->Parameter(0); in Int32Input()
309 return m->Parameter(1); in Int32Input()
311 return m->Int32Constant(0); in Int32Input()
313 return m->Int32Constant(1); in Int32Input()
315 return m->Int32Constant(-1); in Int32Input()
317 return m->Int32Constant(0xff); in Int32Input()
319 return m->Int32Constant(0x01234567); in Int32Input()
321 return m->Load(MachineType::Int32(), m->PointerConstant(NULL)); in Int32Input()
329 RawMachineAssemblerTester<void> m; in TEST() local
332 m.machine()->Word32And(), m.machine()->Word32Or(), in TEST()
333 m.machine()->Word32Xor(), m.machine()->Word32Shl(), in TEST()
334 m.machine()->Word32Shr(), m.machine()->Word32Sar(), in TEST()
335 m.machine()->Word32Equal(), m.machine()->Int32Add(), in TEST()
336 m.machine()->Int32Sub(), m.machine()->Int32Mul(), in TEST()
337 m.machine()->Int32MulHigh(), m.machine()->Int32Div(), in TEST()
338 m.machine()->Uint32Div(), m.machine()->Int32Mod(), in TEST()
339 m.machine()->Uint32Mod(), m.machine()->Uint32MulHigh(), in TEST()
340 m.machine()->Int32LessThan(), m.machine()->Int32LessThanOrEqual(), in TEST()
341 m.machine()->Uint32LessThan(), m.machine()->Uint32LessThanOrEqual()}; in TEST()
346 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
348 Node* a = Int32Input(&m, j); in TEST()
349 Node* b = Int32Input(&m, k); in TEST()
350 m.Return(m.AddNode(kOps[i], a, b)); in TEST()
351 m.GenerateCode(); in TEST()
359 RawMachineAssemblerTester<void> m; in TEST() local
360 m.Return(m.Int32Constant(0)); in TEST()
361 m.GenerateCode(); in TEST()
366 static Node* Int64Input(RawMachineAssemblerTester<int64_t>* m, int index) { in Int64Input() argument
369 return m->Parameter(0); in Int64Input()
371 return m->Parameter(1); in Int64Input()
373 return m->Int64Constant(0); in Int64Input()
375 return m->Int64Constant(1); in Int64Input()
377 return m->Int64Constant(-1); in Int64Input()
379 return m->Int64Constant(0xff); in Int64Input()
381 return m->Int64Constant(0x0123456789abcdefLL); in Int64Input()
383 return m->Load(MachineType::Int64(), m->PointerConstant(NULL)); in Int64Input()
391 RawMachineAssemblerTester<void> m; in TEST() local
394 m.machine()->Word64And(), m.machine()->Word64Or(), in TEST()
395 m.machine()->Word64Xor(), m.machine()->Word64Shl(), in TEST()
396 m.machine()->Word64Shr(), m.machine()->Word64Sar(), in TEST()
397 m.machine()->Word64Equal(), m.machine()->Int64Add(), in TEST()
398 m.machine()->Int64Sub(), m.machine()->Int64Mul(), m.machine()->Int64Div(), in TEST()
399 m.machine()->Uint64Div(), m.machine()->Int64Mod(), in TEST()
400 m.machine()->Uint64Mod(), m.machine()->Int64LessThan(), in TEST()
401 m.machine()->Int64LessThanOrEqual(), m.machine()->Uint64LessThan(), in TEST()
402 m.machine()->Uint64LessThanOrEqual()}; in TEST()
407 RawMachineAssemblerTester<int64_t> m(MachineType::Int64(), in TEST() local
409 Node* a = Int64Input(&m, j); in TEST()
410 Node* b = Int64Input(&m, k); in TEST()
411 m.Return(m.AddNode(kOps[i], a, b)); in TEST()
412 m.GenerateCode(); in TEST()
421 RawMachineAssemblerTester<int32_t> m; in TEST() local
422 Int64BinopTester bt(&m); in TEST()
423 Node* add = m.Int64AddWithOverflow(bt.param0, bt.param1); in TEST()
424 Node* val = m.Projection(0, add); in TEST()
425 Node* ovf = m.Projection(1, add); in TEST()
426 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
443 RawMachineAssemblerTester<int32_t> m(MachineType::Int64()); in TEST() local
444 Node* add = m.Int64AddWithOverflow(m.Int64Constant(*i), m.Parameter(0)); in TEST()
445 Node* val = m.Projection(0, add); in TEST()
446 Node* ovf = m.Projection(1, add); in TEST()
447 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
448 m.Return(ovf); in TEST()
451 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
456 RawMachineAssemblerTester<int32_t> m(MachineType::Int64()); in TEST() local
457 Node* add = m.Int64AddWithOverflow(m.Parameter(0), m.Int64Constant(*i)); in TEST()
458 Node* val = m.Projection(0, add); in TEST()
459 Node* ovf = m.Projection(1, add); in TEST()
460 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
461 m.Return(ovf); in TEST()
464 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
469 RawMachineAssemblerTester<int32_t> m; in TEST() local
471 m.Int64AddWithOverflow(m.Int64Constant(*i), m.Int64Constant(*j)); in TEST()
472 Node* val = m.Projection(0, add); in TEST()
473 Node* ovf = m.Projection(1, add); in TEST()
474 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
475 m.Return(ovf); in TEST()
477 CHECK_EQ(expected_ovf, m.Call()); in TEST()
487 RawMachineAssemblerTester<int32_t> m; in TEST() local
488 Int64BinopTester bt(&m); in TEST()
489 Node* add = m.Int64AddWithOverflow(bt.param0, bt.param1); in TEST()
490 Node* ovf = m.Projection(1, add); in TEST()
491 m.Branch(ovf, &blocka, &blockb); in TEST()
492 m.Bind(&blocka); in TEST()
493 bt.AddReturn(m.Int64Constant(constant)); in TEST()
494 m.Bind(&blockb); in TEST()
495 Node* val = m.Projection(0, add); in TEST()
496 Node* truncated = m.TruncateInt64ToInt32(val); in TEST()
513 RawMachineAssemblerTester<int32_t> m; in TEST() local
514 Int64BinopTester bt(&m); in TEST()
515 Node* add = m.Int64SubWithOverflow(bt.param0, bt.param1); in TEST()
516 Node* val = m.Projection(0, add); in TEST()
517 Node* ovf = m.Projection(1, add); in TEST()
518 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
535 RawMachineAssemblerTester<int32_t> m(MachineType::Int64()); in TEST() local
536 Node* add = m.Int64SubWithOverflow(m.Int64Constant(*i), m.Parameter(0)); in TEST()
537 Node* val = m.Projection(0, add); in TEST()
538 Node* ovf = m.Projection(1, add); in TEST()
539 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
540 m.Return(ovf); in TEST()
543 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
548 RawMachineAssemblerTester<int32_t> m(MachineType::Int64()); in TEST() local
549 Node* add = m.Int64SubWithOverflow(m.Parameter(0), m.Int64Constant(*i)); in TEST()
550 Node* val = m.Projection(0, add); in TEST()
551 Node* ovf = m.Projection(1, add); in TEST()
552 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
553 m.Return(ovf); in TEST()
556 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
561 RawMachineAssemblerTester<int32_t> m; in TEST() local
563 m.Int64SubWithOverflow(m.Int64Constant(*i), m.Int64Constant(*j)); in TEST()
564 Node* val = m.Projection(0, add); in TEST()
565 Node* ovf = m.Projection(1, add); in TEST()
566 m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val); in TEST()
567 m.Return(ovf); in TEST()
569 CHECK_EQ(expected_ovf, m.Call()); in TEST()
579 RawMachineAssemblerTester<int32_t> m; in TEST() local
580 Int64BinopTester bt(&m); in TEST()
581 Node* sub = m.Int64SubWithOverflow(bt.param0, bt.param1); in TEST()
582 Node* ovf = m.Projection(1, sub); in TEST()
583 m.Branch(ovf, &blocka, &blockb); in TEST()
584 m.Bind(&blocka); in TEST()
585 bt.AddReturn(m.Int64Constant(constant)); in TEST()
586 m.Bind(&blockb); in TEST()
587 Node* val = m.Projection(0, sub); in TEST()
588 Node* truncated = m.TruncateInt64ToInt32(val); in TEST()
608 RawMachineAssemblerTester<int32_t> m; in TEST() local
612 m.Goto(&next); in TEST()
613 m.Bind(&next); in TEST()
614 m.Return(m.Int32Constant(constant)); in TEST()
616 CHECK_EQ(constant, m.Call()); in TEST()
621 RawMachineAssemblerTester<int32_t> m; in TEST() local
626 m.Goto(&labels[i]); in TEST()
627 m.Bind(&labels[i]); in TEST()
629 m.Return(m.Int32Constant(constant)); in TEST()
631 CHECK_EQ(constant, m.Call()); in TEST()
636 RawMachineAssemblerTester<int32_t> m; in TEST() local
640 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
641 m.Bind(&blocka); in TEST()
642 m.Return(m.Int32Constant(0 - constant)); in TEST()
643 m.Bind(&blockb); in TEST()
644 m.Return(m.Int32Constant(constant)); in TEST()
646 CHECK_EQ(constant, m.Call()); in TEST()
651 RawMachineAssemblerTester<int32_t> m; in TEST() local
656 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
657 m.Bind(&blocka); in TEST()
658 m.Goto(&end); in TEST()
659 m.Bind(&blockb); in TEST()
660 m.Goto(&end); in TEST()
661 m.Bind(&end); in TEST()
662 m.Return(m.Int32Constant(constant)); in TEST()
664 CHECK_EQ(constant, m.Call()); in TEST()
669 RawMachineAssemblerTester<int32_t> m; in TEST() local
673 m.Goto(&header); in TEST()
674 m.Bind(&header); in TEST()
675 m.Branch(m.Int32Constant(0), &body, &exit); in TEST()
676 m.Bind(&body); in TEST()
677 m.Goto(&header); in TEST()
678 m.Bind(&exit); in TEST()
679 m.Return(m.Int32Constant(constant)); in TEST()
681 CHECK_EQ(constant, m.Call()); in TEST()
686 static void BuildDiamondPhi(RawMachineAssemblerTester<R>* m, Node* cond_node, in BuildDiamondPhi() argument
690 m->Branch(cond_node, &blocka, &blockb); in BuildDiamondPhi()
691 m->Bind(&blocka); in BuildDiamondPhi()
692 m->Goto(&end); in BuildDiamondPhi()
693 m->Bind(&blockb); in BuildDiamondPhi()
694 m->Goto(&end); in BuildDiamondPhi()
696 m->Bind(&end); in BuildDiamondPhi()
697 Node* phi = m->Phi(rep, true_node, false_node); in BuildDiamondPhi()
698 m->Return(phi); in BuildDiamondPhi()
703 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
706 Node* true_node = m.Int32Constant(true_val); in TEST()
707 Node* false_node = m.Int32Constant(false_val); in TEST()
708 BuildDiamondPhi(&m, m.Parameter(0), MachineRepresentation::kWord32, true_node, in TEST()
710 CHECK_EQ(false_val, m.Call(0)); in TEST()
711 CHECK_EQ(true_val, m.Call(1)); in TEST()
716 RawMachineAssemblerTester<Object*> m(MachineType::Int32()); in TEST() local
719 Node* true_node = m.NumberConstant(true_val); in TEST()
720 Node* false_node = m.NumberConstant(false_val); in TEST()
721 BuildDiamondPhi(&m, m.Parameter(0), MachineRepresentation::kTagged, true_node, in TEST()
723 m.CheckNumber(false_val, m.Call(0)); in TEST()
724 m.CheckNumber(true_val, m.Call(1)); in TEST()
729 RawMachineAssemblerTester<Object*> m(MachineType::Int32()); in TEST() local
732 Node* true_node = m.StringConstant(true_val); in TEST()
733 Node* false_node = m.StringConstant(false_val); in TEST()
734 BuildDiamondPhi(&m, m.Parameter(0), MachineRepresentation::kTagged, true_node, in TEST()
736 m.CheckString(false_val, m.Call(0)); in TEST()
737 m.CheckString(true_val, m.Call(1)); in TEST()
742 RawMachineAssemblerTester<int32_t> m( in TEST() local
744 BuildDiamondPhi(&m, m.Parameter(0), MachineRepresentation::kWord32, in TEST()
745 m.Parameter(1), m.Parameter(2)); in TEST()
748 int result = m.Call(0, c1, c2); in TEST()
750 result = m.Call(1, c1, c2); in TEST()
756 RawMachineAssemblerTester<int32_t> m; in TEST() local
760 Node* cond_node = m.Int32Constant(0); in TEST()
761 Node* true_node = m.Int32Constant(true_val); in TEST()
762 Node* false_node = m.Int32Constant(false_val); in TEST()
767 m.Goto(&header); in TEST()
768 m.Bind(&header); in TEST()
769 Node* phi = m.Phi(MachineRepresentation::kWord32, false_node, true_node); in TEST()
770 m.Branch(cond_node, &body, &end); in TEST()
771 m.Bind(&body); in TEST()
772 m.Goto(&header); in TEST()
773 m.Bind(&end); in TEST()
774 m.Return(phi); in TEST()
776 CHECK_EQ(false_val, m.Call()); in TEST()
781 RawMachineAssemblerTester<int32_t> m( in TEST() local
786 m.Goto(&blocka); in TEST()
788 m.Bind(&blocka); in TEST()
790 m.Phi(MachineRepresentation::kWord32, m.Parameter(1), m.Parameter(2)); in TEST()
792 m.Phi(MachineRepresentation::kWord32, m.Parameter(0), m.Int32Constant(0)); in TEST()
793 m.Branch(cond, &blockb, &end); in TEST()
795 m.Bind(&blockb); in TEST()
796 m.Goto(&blocka); in TEST()
798 m.Bind(&end); in TEST()
799 m.Return(phi); in TEST()
803 int result = m.Call(0, c1, c2); in TEST()
805 result = m.Call(1, c1, c2); in TEST()
811 RawMachineAssemblerTester<int32_t> m; in TEST() local
817 Node* false_node = m.Int32Constant(false_val); in TEST()
819 m.Goto(&header); in TEST()
821 m.Bind(&header); in TEST()
822 Node* phi = m.Phi(MachineRepresentation::kWord32, false_node, false_node); in TEST()
823 m.Branch(m.Int32Constant(0), &body, &end); in TEST()
825 m.Bind(&body); in TEST()
826 Node* add = m.Int32Add(phi, m.Int32Constant(1)); in TEST()
828 m.Goto(&header); in TEST()
830 m.Bind(&end); in TEST()
831 m.Return(phi); in TEST()
833 CHECK_EQ(false_val, m.Call()); in TEST()
838 RawMachineAssemblerTester<int32_t> m; in TEST() local
839 Int32BinopTester bt(&m); in TEST()
843 Node* zero = m.Int32Constant(0); in TEST()
845 m.Goto(&header); in TEST()
847 m.Bind(&header); in TEST()
848 Node* phi = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
849 m.Branch(m.WordXor(phi, bt.param0), &body, &end); in TEST()
851 m.Bind(&body); in TEST()
852 phi->ReplaceInput(1, m.Int32Add(phi, m.Int32Constant(1))); in TEST()
853 m.Goto(&header); in TEST()
855 m.Bind(&end); in TEST()
865 RawMachineAssemblerTester<int32_t> m; in TEST() local
866 Int32BinopTester bt(&m); in TEST()
870 Node* zero = m.Int32Constant(0); in TEST()
872 m.Goto(&header); in TEST()
874 m.Bind(&header); in TEST()
875 Node* phi = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
876 m.Branch(m.Int32LessThan(phi, bt.param0), &body, &end); in TEST()
878 m.Bind(&body); in TEST()
879 phi->ReplaceInput(1, m.Int32Add(phi, m.Int32Constant(1))); in TEST()
880 m.Goto(&header); in TEST()
882 m.Bind(&end); in TEST()
893 RawMachineAssemblerTester<int32_t> m; in TEST() local
894 Int32BinopTester bt(&m); in TEST()
898 Node* zero = m.Int32Constant(0); in TEST()
900 m.Goto(&header); in TEST()
902 m.Bind(&header); in TEST()
903 Node* phi = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
904 m.Branch(m.Uint32LessThan(phi, bt.param0), &body, &end); in TEST()
906 m.Bind(&body); in TEST()
907 phi->ReplaceInput(1, m.Int32Add(phi, m.Int32Constant(1))); in TEST()
908 m.Goto(&header); in TEST()
910 m.Bind(&end); in TEST()
921 RawMachineAssemblerTester<int32_t> m; in TEST() local
922 Int32BinopTester bt(&m); in TEST()
927 m.Goto(&header); in TEST()
929 m.Bind(&header); in TEST()
931 m.Phi(MachineRepresentation::kWord32, bt.param0, m.Int32Constant(0)); in TEST()
932 m.Branch(phi, &body, &end); in TEST()
934 m.Bind(&body); in TEST()
935 phi->ReplaceInput(1, m.Int32Sub(phi, m.Int32Constant(1))); in TEST()
936 m.Goto(&header); in TEST()
938 m.Bind(&end); in TEST()
948 RawMachineAssemblerTester<int32_t> m; in TEST() local
952 Node* minus_3 = m.Float32Constant(-3.0f); in TEST()
953 Node* ten = m.Float32Constant(10.0f); in TEST()
955 m.Goto(&header); in TEST()
957 m.Bind(&header); in TEST()
958 Node* phi = m.Phi(MachineRepresentation::kFloat32, minus_3, ten); in TEST()
959 m.Branch(m.Float32LessThan(phi, ten), &body, &end); in TEST()
961 m.Bind(&body); in TEST()
962 phi->ReplaceInput(1, m.Float32Add(phi, m.Float32Constant(0.5f))); in TEST()
963 m.Goto(&header); in TEST()
965 m.Bind(&end); in TEST()
966 m.Return(m.ChangeFloat64ToInt32(m.ChangeFloat32ToFloat64(phi))); in TEST()
968 CHECK_EQ(10, m.Call()); in TEST()
973 RawMachineAssemblerTester<int32_t> m; in TEST() local
977 Node* minus_3 = m.Float64Constant(-3.0); in TEST()
978 Node* ten = m.Float64Constant(10.0); in TEST()
980 m.Goto(&header); in TEST()
982 m.Bind(&header); in TEST()
983 Node* phi = m.Phi(MachineRepresentation::kFloat64, minus_3, ten); in TEST()
984 m.Branch(m.Float64LessThan(phi, ten), &body, &end); in TEST()
986 m.Bind(&body); in TEST()
987 phi->ReplaceInput(1, m.Float64Add(phi, m.Float64Constant(0.5))); in TEST()
988 m.Goto(&header); in TEST()
990 m.Bind(&end); in TEST()
991 m.Return(m.ChangeFloat64ToInt32(phi)); in TEST()
993 CHECK_EQ(10, m.Call()); in TEST()
998 RawMachineAssemblerTester<int32_t> m; in TEST() local
1005 m.Switch(m.Int32Constant(0), &def, case_values, case_labels, in TEST()
1007 m.Bind(&block0); in TEST()
1008 m.Goto(&end); in TEST()
1009 m.Bind(&block1); in TEST()
1010 m.Goto(&end); in TEST()
1011 m.Bind(&def); in TEST()
1012 m.Goto(&end); in TEST()
1013 m.Bind(&end); in TEST()
1014 m.Return(m.Int32Constant(constant)); in TEST()
1016 CHECK_EQ(constant, m.Call()); in TEST()
1021 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
1027 m.Switch(m.Parameter(0), &blockc, case_values, case_labels, in TEST()
1029 m.Bind(&blocka); in TEST()
1030 m.Return(m.Int32Constant(-1)); in TEST()
1031 m.Bind(&blockb); in TEST()
1032 m.Return(m.Int32Constant(1)); in TEST()
1033 m.Bind(&blockc); in TEST()
1034 m.Return(m.Int32Constant(0)); in TEST()
1036 CHECK_EQ(1, m.Call(std::numeric_limits<int32_t>::max())); in TEST()
1037 CHECK_EQ(-1, m.Call(std::numeric_limits<int32_t>::min())); in TEST()
1039 CHECK_EQ(0, m.Call(i)); in TEST()
1045 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
1051 m.Switch(m.Parameter(0), &blockc, case_values, case_labels, in TEST()
1053 m.Bind(&blocka); in TEST()
1054 m.Return(m.Int32Constant(0)); in TEST()
1055 m.Bind(&blockb); in TEST()
1056 m.Return(m.Int32Constant(1)); in TEST()
1057 m.Bind(&blockc); in TEST()
1058 m.Return(m.Int32Constant(2)); in TEST()
1060 CHECK_EQ(0, m.Call(std::numeric_limits<int32_t>::min() + 0)); in TEST()
1061 CHECK_EQ(1, m.Call(std::numeric_limits<int32_t>::min() + 1)); in TEST()
1063 CHECK_EQ(2, m.Call(i)); in TEST()
1069 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
1074 m.main_isolate()->random_number_generator()->NextBytes(values, in TEST()
1083 new (m.main_zone()->New(sizeof(RawMachineLabel))) RawMachineLabel; in TEST()
1085 m.Switch(m.Parameter(0), &def, case_values, case_labels, in TEST()
1088 m.Bind(case_labels[i]); in TEST()
1089 results[i] = m.Int32Constant(values[i]); in TEST()
1090 m.Goto(&end); in TEST()
1092 m.Bind(&def); in TEST()
1093 results[kNumCases] = m.Int32Constant(values[kNumCases]); in TEST()
1094 m.Goto(&end); in TEST()
1095 m.Bind(&end); in TEST()
1098 m.AddNode(m.common()->Phi(MachineRepresentation::kWord32, num_results), in TEST()
1100 m.Return(phi); in TEST()
1103 CHECK_EQ(values[i], m.Call(static_cast<int>(i))); in TEST()
1109 RawMachineAssemblerTester<int32_t> m; in TEST() local
1112 m.Return(m.LoadFromPointer(&p1, MachineType::Int32())); in TEST()
1116 CHECK_EQ(p1, m.Call()); in TEST()
1128 RawMachineAssemblerTester<int32_t> m; in TEST() local
1132 m.Return(m.LoadFromPointer(pointer, MachineType::Int32(), offset)); in TEST()
1136 CHECK_EQ(p1, m.Call()); in TEST()
1148 RawMachineAssemblerTester<int32_t> m; in TEST() local
1153 Node* load = m.Load(MachineType::Float32(), m.PointerConstant(from), in TEST()
1154 m.IntPtrConstant(offset)); in TEST()
1155 m.Store(MachineRepresentation::kFloat32, m.PointerConstant(to), in TEST()
1156 m.IntPtrConstant(offset), load, kNoWriteBarrier); in TEST()
1157 m.Return(m.Int32Constant(magic)); in TEST()
1162 CHECK_EQ(magic, m.Call()); in TEST()
1175 RawMachineAssemblerTester<int32_t> m; in TEST() local
1180 Node* load = m.Load(MachineType::Float64(), m.PointerConstant(from), in TEST()
1181 m.IntPtrConstant(offset)); in TEST()
1182 m.Store(MachineRepresentation::kFloat64, m.PointerConstant(to), in TEST()
1183 m.IntPtrConstant(offset), load, kNoWriteBarrier); in TEST()
1184 m.Return(m.Int32Constant(magic)); in TEST()
1189 CHECK_EQ(magic, m.Call()); in TEST()
1197 RawMachineAssemblerTester<int32_t> m; in TEST() local
1198 Int32BinopTester bt(&m); in TEST()
1200 bt.AddReturn(m.Int32Add(bt.param0, bt.param1)); in TEST()
1214 RawMachineAssemblerTester<int32_t> m( in TEST() local
1216 m.Return(m.Int32Add(m.Parameter(0), in TEST()
1217 m.Word32Equal(m.Parameter(1), m.Parameter(2)))); in TEST()
1224 CHECK_EQ(expected, m.Call(*i, *j, *k)); in TEST()
1230 RawMachineAssemblerTester<int32_t> m( in TEST() local
1232 m.Return(m.Int32Add(m.Word32Equal(m.Parameter(0), m.Parameter(1)), in TEST()
1233 m.Parameter(2))); in TEST()
1240 CHECK_EQ(expected, m.Call(*i, *j, *k)); in TEST()
1251 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
1253 m.Return(m.Int32Add(m.Int32Constant(*i), in TEST()
1254 m.Word32Equal(m.Parameter(0), m.Parameter(1)))); in TEST()
1260 CHECK_EQ(expected, m.Call(*j, *k)); in TEST()
1267 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
1269 m.Return(m.Int32Add(m.Word32Equal(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1270 m.Parameter(1))); in TEST()
1276 CHECK_EQ(expected, m.Call(*j, *k)); in TEST()
1286 RawMachineAssemblerTester<int32_t> m( in TEST() local
1288 m.Return(m.Int32Add(m.Parameter(0), in TEST()
1289 m.Word32NotEqual(m.Parameter(1), m.Parameter(2)))); in TEST()
1296 CHECK_EQ(expected, m.Call(*i, *j, *k)); in TEST()
1302 RawMachineAssemblerTester<int32_t> m( in TEST() local
1304 m.Return(m.Int32Add(m.Word32NotEqual(m.Parameter(0), m.Parameter(1)), in TEST()
1305 m.Parameter(2))); in TEST()
1312 CHECK_EQ(expected, m.Call(*i, *j, *k)); in TEST()
1323 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
1325 m.Return(m.Int32Add(m.Int32Constant(*i), in TEST()
1326 m.Word32NotEqual(m.Parameter(0), m.Parameter(1)))); in TEST()
1332 CHECK_EQ(expected, m.Call(*j, *k)); in TEST()
1339 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
1341 m.Return(m.Int32Add(m.Word32NotEqual(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1342 m.Parameter(1))); in TEST()
1348 CHECK_EQ(expected, m.Call(*j, *k)); in TEST()
1358 RawMachineAssemblerTester<int32_t> m( in TEST() local
1360 m.Return(m.Int32Add(m.Parameter(0), in TEST()
1361 m.Word32Sar(m.Parameter(1), m.Parameter(2)))); in TEST()
1367 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1373 RawMachineAssemblerTester<int32_t> m( in TEST() local
1375 m.Return(m.Int32Add(m.Word32Sar(m.Parameter(0), m.Parameter(1)), in TEST()
1376 m.Parameter(2))); in TEST()
1382 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1392 RawMachineAssemblerTester<int32_t> m( in TEST() local
1394 m.Return(m.Int32Add(m.Parameter(0), in TEST()
1395 m.Word32Shl(m.Parameter(1), m.Parameter(2)))); in TEST()
1401 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1407 RawMachineAssemblerTester<int32_t> m( in TEST() local
1409 m.Return(m.Int32Add(m.Word32Shl(m.Parameter(0), m.Parameter(1)), in TEST()
1410 m.Parameter(2))); in TEST()
1416 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1426 RawMachineAssemblerTester<int32_t> m( in TEST() local
1428 m.Return(m.Int32Add(m.Parameter(0), in TEST()
1429 m.Word32Shr(m.Parameter(1), m.Parameter(2)))); in TEST()
1435 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1441 RawMachineAssemblerTester<int32_t> m( in TEST() local
1443 m.Return(m.Int32Add(m.Word32Shr(m.Parameter(0), m.Parameter(1)), in TEST()
1444 m.Parameter(2))); in TEST()
1450 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1461 RawMachineAssemblerTester<int32_t> m; in TEST() local
1462 Int32BinopTester bt(&m); in TEST()
1464 m.Branch( in TEST()
1465 m.Word32Equal(m.Int32Add(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
1467 m.Bind(&blocka); in TEST()
1468 bt.AddReturn(m.Int32Constant(constant)); in TEST()
1469 m.Bind(&blockb); in TEST()
1470 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
1479 RawMachineAssemblerTester<int32_t> m; in TEST() local
1480 Int32BinopTester bt(&m); in TEST()
1482 m.Branch( in TEST()
1483 m.Word32NotEqual(m.Int32Add(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
1485 m.Bind(&blocka); in TEST()
1486 bt.AddReturn(m.Int32Constant(constant)); in TEST()
1487 m.Bind(&blockb); in TEST()
1488 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
1498 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1500 m.Branch(m.Word32Equal(m.Int32Add(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1501 m.Int32Constant(0)), in TEST()
1503 m.Bind(&blocka); in TEST()
1504 m.Return(m.Int32Constant(constant)); in TEST()
1505 m.Bind(&blockb); in TEST()
1506 m.Return(m.Int32Constant(0 - constant)); in TEST()
1509 CHECK_EQ(expected, m.Call(*j)); in TEST()
1515 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1517 m.Branch(m.Word32NotEqual(m.Int32Add(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1518 m.Int32Constant(0)), in TEST()
1520 m.Bind(&blocka); in TEST()
1521 m.Return(m.Int32Constant(constant)); in TEST()
1522 m.Bind(&blockb); in TEST()
1523 m.Return(m.Int32Constant(0 - constant)); in TEST()
1526 CHECK_EQ(expected, m.Call(*j)); in TEST()
1531 RawMachineAssemblerTester<void> m; in TEST() local
1532 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
1533 m.machine()->Word32Shl(), in TEST()
1534 m.machine()->Word32Shr()}; in TEST()
1536 RawMachineAssemblerTester<int32_t> m( in TEST() local
1539 m.Branch(m.Word32Equal(m.Int32Add(m.Parameter(0), in TEST()
1540 m.AddNode(shops[n], m.Parameter(1), in TEST()
1541 m.Parameter(2))), in TEST()
1542 m.Int32Constant(0)), in TEST()
1544 m.Bind(&blocka); in TEST()
1545 m.Return(m.Int32Constant(constant)); in TEST()
1546 m.Bind(&blockb); in TEST()
1547 m.Return(m.Int32Constant(0 - constant)); in TEST()
1566 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1577 RawMachineAssemblerTester<int32_t> m; in TEST() local
1578 Uint32BinopTester bt(&m); in TEST()
1580 m.Word32Equal(m.Int32Add(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
1589 RawMachineAssemblerTester<int32_t> m; in TEST() local
1590 Uint32BinopTester bt(&m); in TEST()
1592 m.Word32Equal(m.Int32Constant(0), m.Int32Add(bt.param0, bt.param1))); in TEST()
1602 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1603 m.Return(m.Word32Equal(m.Int32Add(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1604 m.Int32Constant(0))); in TEST()
1607 CHECK_EQ(expected, m.Call(*j)); in TEST()
1613 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1614 m.Return(m.Word32Equal(m.Int32Add(m.Parameter(0), m.Int32Constant(*i)), in TEST()
1615 m.Int32Constant(0))); in TEST()
1618 CHECK_EQ(expected, m.Call(*j)); in TEST()
1623 RawMachineAssemblerTester<void> m; in TEST() local
1624 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
1625 m.machine()->Word32Shl(), in TEST()
1626 m.machine()->Word32Shr()}; in TEST()
1628 RawMachineAssemblerTester<int32_t> m( in TEST() local
1630 m.Return(m.Word32Equal( in TEST()
1631 m.Int32Add(m.Parameter(0), in TEST()
1632 m.AddNode(shops[n], m.Parameter(1), m.Parameter(2))), in TEST()
1633 m.Int32Constant(0))); in TEST()
1652 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1662 RawMachineAssemblerTester<int32_t> m; in TEST() local
1663 Uint32BinopTester bt(&m); in TEST()
1665 m.Return(m.Int32Sub(bt.param0, bt.param1)); in TEST()
1679 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1680 m.Return(m.Int32Sub(m.Int32Constant(*i), m.Parameter(0))); in TEST()
1683 CHECK_EQ(expected, m.Call(*j)); in TEST()
1689 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1690 m.Return(m.Int32Sub(m.Parameter(0), m.Int32Constant(*i))); in TEST()
1693 CHECK_EQ(expected, m.Call(*j)); in TEST()
1702 RawMachineAssemblerTester<int32_t> m( in TEST() local
1704 m.Return(m.Int32Sub(m.Parameter(0), in TEST()
1705 m.Word32Sar(m.Parameter(1), m.Parameter(2)))); in TEST()
1710 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1716 RawMachineAssemblerTester<int32_t> m( in TEST() local
1718 m.Return(m.Int32Sub(m.Word32Sar(m.Parameter(0), m.Parameter(1)), in TEST()
1719 m.Parameter(2))); in TEST()
1724 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1734 RawMachineAssemblerTester<int32_t> m( in TEST() local
1736 m.Return(m.Int32Sub(m.Parameter(0), in TEST()
1737 m.Word32Shl(m.Parameter(1), m.Parameter(2)))); in TEST()
1742 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1748 RawMachineAssemblerTester<int32_t> m( in TEST() local
1750 m.Return(m.Int32Sub(m.Word32Shl(m.Parameter(0), m.Parameter(1)), in TEST()
1751 m.Parameter(2))); in TEST()
1757 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1767 RawMachineAssemblerTester<uint32_t> m( in TEST() local
1769 m.Return(m.Int32Sub(m.Parameter(0), in TEST()
1770 m.Word32Shr(m.Parameter(1), m.Parameter(2)))); in TEST()
1776 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1782 RawMachineAssemblerTester<uint32_t> m( in TEST() local
1784 m.Return(m.Int32Sub(m.Word32Shr(m.Parameter(0), m.Parameter(1)), in TEST()
1785 m.Parameter(2))); in TEST()
1791 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
1802 RawMachineAssemblerTester<int32_t> m; in TEST() local
1803 Int32BinopTester bt(&m); in TEST()
1805 m.Branch( in TEST()
1806 m.Word32Equal(m.Int32Sub(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
1808 m.Bind(&blocka); in TEST()
1809 bt.AddReturn(m.Int32Constant(constant)); in TEST()
1810 m.Bind(&blockb); in TEST()
1811 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
1820 RawMachineAssemblerTester<int32_t> m; in TEST() local
1821 Int32BinopTester bt(&m); in TEST()
1823 m.Branch( in TEST()
1824 m.Word32NotEqual(m.Int32Sub(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
1826 m.Bind(&blocka); in TEST()
1827 bt.AddReturn(m.Int32Constant(constant)); in TEST()
1828 m.Bind(&blockb); in TEST()
1829 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
1839 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1841 m.Branch(m.Word32Equal(m.Int32Sub(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1842 m.Int32Constant(0)), in TEST()
1844 m.Bind(&blocka); in TEST()
1845 m.Return(m.Int32Constant(constant)); in TEST()
1846 m.Bind(&blockb); in TEST()
1847 m.Return(m.Int32Constant(0 - constant)); in TEST()
1850 CHECK_EQ(expected, m.Call(*j)); in TEST()
1856 RawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
1858 m.Branch(m.Word32NotEqual(m.Int32Sub(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1859 m.Int32Constant(0)), in TEST()
1861 m.Bind(&blocka); in TEST()
1862 m.Return(m.Int32Constant(constant)); in TEST()
1863 m.Bind(&blockb); in TEST()
1864 m.Return(m.Int32Constant(0 - constant)); in TEST()
1867 CHECK_EQ(expected, m.Call(*j)); in TEST()
1872 RawMachineAssemblerTester<void> m; in TEST() local
1873 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
1874 m.machine()->Word32Shl(), in TEST()
1875 m.machine()->Word32Shr()}; in TEST()
1877 RawMachineAssemblerTester<int32_t> m( in TEST() local
1880 m.Branch(m.Word32Equal(m.Int32Sub(m.Parameter(0), in TEST()
1881 m.AddNode(shops[n], m.Parameter(1), in TEST()
1882 m.Parameter(2))), in TEST()
1883 m.Int32Constant(0)), in TEST()
1885 m.Bind(&blocka); in TEST()
1886 m.Return(m.Int32Constant(constant)); in TEST()
1887 m.Bind(&blockb); in TEST()
1888 m.Return(m.Int32Constant(0 - constant)); in TEST()
1907 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
1918 RawMachineAssemblerTester<int32_t> m; in TEST() local
1919 Uint32BinopTester bt(&m); in TEST()
1921 m.Word32Equal(m.Int32Sub(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
1930 RawMachineAssemblerTester<int32_t> m; in TEST() local
1931 Uint32BinopTester bt(&m); in TEST()
1933 m.Word32Equal(m.Int32Constant(0), m.Int32Sub(bt.param0, bt.param1))); in TEST()
1943 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1944 m.Return(m.Word32Equal(m.Int32Sub(m.Int32Constant(*i), m.Parameter(0)), in TEST()
1945 m.Int32Constant(0))); in TEST()
1948 CHECK_EQ(expected, m.Call(*j)); in TEST()
1954 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
1955 m.Return(m.Word32Equal(m.Int32Sub(m.Parameter(0), m.Int32Constant(*i)), in TEST()
1956 m.Int32Constant(0))); in TEST()
1959 CHECK_EQ(expected, m.Call(*j)); in TEST()
1964 RawMachineAssemblerTester<void> m; in TEST() local
1965 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
1966 m.machine()->Word32Shl(), in TEST()
1967 m.machine()->Word32Shr()}; in TEST()
1969 RawMachineAssemblerTester<int32_t> m( in TEST() local
1971 m.Return(m.Word32Equal( in TEST()
1972 m.Int32Sub(m.Parameter(0), in TEST()
1973 m.AddNode(shops[n], m.Parameter(1), m.Parameter(2))), in TEST()
1974 m.Int32Constant(0))); in TEST()
1993 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
2004 RawMachineAssemblerTester<int32_t> m; in TEST() local
2005 Int32BinopTester bt(&m); in TEST()
2006 bt.AddReturn(m.Int32Mul(bt.param0, bt.param1)); in TEST()
2015 RawMachineAssemblerTester<int32_t> m; in TEST() local
2016 Uint32BinopTester bt(&m); in TEST()
2017 bt.AddReturn(m.Int32Mul(bt.param0, bt.param1)); in TEST()
2029 RawMachineAssemblerTester<int32_t> m; in TEST() local
2030 Int32BinopTester bt(&m); in TEST()
2031 bt.AddReturn(m.Int32MulHigh(bt.param0, bt.param1)); in TEST()
2045 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2046 m.Return(m.Int32Mul(m.Int32Constant(*i), m.Parameter(0))); in TEST()
2049 CHECK_EQ(expected, m.Call(*j)); in TEST()
2055 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2056 m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant(*i))); in TEST()
2059 CHECK_EQ(expected, m.Call(*j)); in TEST()
2070 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
2073 m.Return(m.Int32Add(m.Int32Constant(p0), in TEST()
2074 m.Int32Mul(m.Parameter(0), m.Int32Constant(p1)))); in TEST()
2078 CHECK_EQ(expected, m.Call(p2)); in TEST()
2084 RawMachineAssemblerTester<int32_t> m( in TEST() local
2086 m.Return( in TEST()
2087 m.Int32Add(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2)))); in TEST()
2095 CHECK_EQ(expected, m.Call(p0, p1, p2)); in TEST()
2101 RawMachineAssemblerTester<int32_t> m( in TEST() local
2103 m.Return( in TEST()
2104 m.Int32Add(m.Int32Mul(m.Parameter(0), m.Parameter(1)), m.Parameter(2))); in TEST()
2112 CHECK_EQ(expected, m.Call(p0, p1, p2)); in TEST()
2119 RawMachineAssemblerTester<int32_t> m; in TEST() local
2120 Int32BinopTester bt(&m); in TEST()
2122 m.Int32Add(m.Int32Constant(*i), m.Int32Mul(bt.param0, bt.param1))); in TEST()
2138 RawMachineAssemblerTester<int32_t> m( in TEST() local
2140 m.Return( in TEST()
2141 m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2)))); in TEST()
2150 CHECK_EQ(expected, m.Call(p0, p1, p2)); in TEST()
2157 RawMachineAssemblerTester<int32_t> m; in TEST() local
2158 Int32BinopTester bt(&m); in TEST()
2160 m.Int32Sub(m.Int32Constant(*i), m.Int32Mul(bt.param0, bt.param1))); in TEST()
2176 RawMachineAssemblerTester<int32_t> m; in TEST() local
2177 Int32BinopTester bt(&m); in TEST()
2178 bt.AddReturn(m.Uint32MulHigh(bt.param0, bt.param1)); in TEST()
2191 RawMachineAssemblerTester<int32_t> m; in TEST() local
2192 Int32BinopTester bt(&m); in TEST()
2193 bt.AddReturn(m.Int32Div(bt.param0, bt.param1)); in TEST()
2206 RawMachineAssemblerTester<int32_t> m; in TEST() local
2207 Int32BinopTester bt(&m); in TEST()
2208 bt.AddReturn(m.Int32Add(bt.param0, m.Int32Div(bt.param0, bt.param1))); in TEST()
2225 RawMachineAssemblerTester<int32_t> m; in TEST() local
2226 Int32BinopTester bt(&m); in TEST()
2227 bt.AddReturn(m.Uint32Div(bt.param0, bt.param1)); in TEST()
2240 RawMachineAssemblerTester<int32_t> m; in TEST() local
2241 Int32BinopTester bt(&m); in TEST()
2242 bt.AddReturn(m.Int32Add(bt.param0, m.Uint32Div(bt.param0, bt.param1))); in TEST()
2259 RawMachineAssemblerTester<int32_t> m; in TEST() local
2260 Int32BinopTester bt(&m); in TEST()
2261 bt.AddReturn(m.Int32Mod(bt.param0, bt.param1)); in TEST()
2274 RawMachineAssemblerTester<int32_t> m; in TEST() local
2275 Int32BinopTester bt(&m); in TEST()
2276 bt.AddReturn(m.Int32Add(bt.param0, m.Int32Mod(bt.param0, bt.param1))); in TEST()
2293 RawMachineAssemblerTester<int32_t> m; in TEST() local
2294 Uint32BinopTester bt(&m); in TEST()
2295 bt.AddReturn(m.Uint32Mod(bt.param0, bt.param1)); in TEST()
2308 RawMachineAssemblerTester<int32_t> m; in TEST() local
2309 Uint32BinopTester bt(&m); in TEST()
2310 bt.AddReturn(m.Int32Add(bt.param0, m.Uint32Mod(bt.param0, bt.param1))); in TEST()
2327 RawMachineAssemblerTester<int32_t> m; in TEST() local
2328 Int32BinopTester bt(&m); in TEST()
2329 bt.AddReturn(m.Word32And(bt.param0, bt.param1)); in TEST()
2338 RawMachineAssemblerTester<int32_t> m; in TEST() local
2339 Int32BinopTester bt(&m); in TEST()
2340 bt.AddReturn(m.Word32And(bt.param0, m.Word32Not(bt.param1))); in TEST()
2349 RawMachineAssemblerTester<int32_t> m; in TEST() local
2350 Int32BinopTester bt(&m); in TEST()
2351 bt.AddReturn(m.Word32And(m.Word32Not(bt.param0), bt.param1)); in TEST()
2364 RawMachineAssemblerTester<int32_t> m; in TEST() local
2365 Uint32BinopTester bt(&m); in TEST()
2367 m.Word32Shl(bt.param0, m.Word32And(bt.param1, m.Int32Constant(0x1f)))); in TEST()
2376 RawMachineAssemblerTester<int32_t> m; in TEST() local
2377 Uint32BinopTester bt(&m); in TEST()
2379 m.Word32Shl(bt.param0, m.Word32And(m.Int32Constant(0x1f), bt.param1))); in TEST()
2392 RawMachineAssemblerTester<int32_t> m; in TEST() local
2393 Uint32BinopTester bt(&m); in TEST()
2395 m.Word32Shr(bt.param0, m.Word32And(bt.param1, m.Int32Constant(0x1f)))); in TEST()
2404 RawMachineAssemblerTester<int32_t> m; in TEST() local
2405 Uint32BinopTester bt(&m); in TEST()
2407 m.Word32Shr(bt.param0, m.Word32And(m.Int32Constant(0x1f), bt.param1))); in TEST()
2420 RawMachineAssemblerTester<int32_t> m; in TEST() local
2421 Int32BinopTester bt(&m); in TEST()
2423 m.Word32Sar(bt.param0, m.Word32And(bt.param1, m.Int32Constant(0x1f)))); in TEST()
2432 RawMachineAssemblerTester<int32_t> m; in TEST() local
2433 Int32BinopTester bt(&m); in TEST()
2435 m.Word32Sar(bt.param0, m.Word32And(m.Int32Constant(0x1f), bt.param1))); in TEST()
2449 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2450 m.Return(m.Word32And(m.Int32Constant(*i), m.Parameter(0))); in TEST()
2453 CHECK_EQ(expected, m.Call(*j)); in TEST()
2459 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2460 m.Return(m.Word32And(m.Int32Constant(*i), m.Word32Not(m.Parameter(0)))); in TEST()
2463 CHECK_EQ(expected, m.Call(*j)); in TEST()
2473 RawMachineAssemblerTester<int32_t> m; in TEST() local
2474 Int32BinopTester bt(&m); in TEST()
2476 m.Branch( in TEST()
2477 m.Word32Equal(m.Word32And(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2479 m.Bind(&blocka); in TEST()
2480 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2481 m.Bind(&blockb); in TEST()
2482 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2491 RawMachineAssemblerTester<int32_t> m; in TEST() local
2492 Int32BinopTester bt(&m); in TEST()
2494 m.Branch( in TEST()
2495 m.Word32NotEqual(m.Word32And(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2497 m.Bind(&blocka); in TEST()
2498 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2499 m.Bind(&blockb); in TEST()
2500 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2510 RawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
2512 m.Branch(m.Word32Equal(m.Word32And(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2513 m.Int32Constant(0)), in TEST()
2515 m.Bind(&blocka); in TEST()
2516 m.Return(m.Int32Constant(constant)); in TEST()
2517 m.Bind(&blockb); in TEST()
2518 m.Return(m.Int32Constant(0 - constant)); in TEST()
2521 CHECK_EQ(expected, m.Call(*j)); in TEST()
2527 RawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
2529 m.Branch( in TEST()
2530 m.Word32NotEqual(m.Word32And(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2531 m.Int32Constant(0)), in TEST()
2533 m.Bind(&blocka); in TEST()
2534 m.Return(m.Int32Constant(constant)); in TEST()
2535 m.Bind(&blockb); in TEST()
2536 m.Return(m.Int32Constant(0 - constant)); in TEST()
2539 CHECK_EQ(expected, m.Call(*j)); in TEST()
2544 RawMachineAssemblerTester<void> m; in TEST() local
2545 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
2546 m.machine()->Word32Shl(), in TEST()
2547 m.machine()->Word32Shr()}; in TEST()
2549 RawMachineAssemblerTester<int32_t> m( in TEST() local
2552 m.Branch(m.Word32Equal(m.Word32And(m.Parameter(0), in TEST()
2553 m.AddNode(shops[n], m.Parameter(1), in TEST()
2554 m.Parameter(2))), in TEST()
2555 m.Int32Constant(0)), in TEST()
2557 m.Bind(&blocka); in TEST()
2558 m.Return(m.Int32Constant(constant)); in TEST()
2559 m.Bind(&blockb); in TEST()
2560 m.Return(m.Int32Constant(0 - constant)); in TEST()
2579 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
2590 RawMachineAssemblerTester<int32_t> m; in TEST() local
2591 Uint32BinopTester bt(&m); in TEST()
2593 m.Word32Equal(m.Word32And(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
2602 RawMachineAssemblerTester<int32_t> m; in TEST() local
2603 Uint32BinopTester bt(&m); in TEST()
2605 m.Word32Equal(m.Int32Constant(0), m.Word32And(bt.param0, bt.param1))); in TEST()
2615 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2616 m.Return(m.Word32Equal(m.Word32And(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2617 m.Int32Constant(0))); in TEST()
2620 CHECK_EQ(expected, m.Call(*j)); in TEST()
2626 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2627 m.Return(m.Word32Equal(m.Word32And(m.Parameter(0), m.Int32Constant(*i)), in TEST()
2628 m.Int32Constant(0))); in TEST()
2631 CHECK_EQ(expected, m.Call(*j)); in TEST()
2640 RawMachineAssemblerTester<int32_t> m; in TEST() local
2641 Uint32BinopTester bt(&m); in TEST()
2642 bt.AddReturn(m.Word32Or(bt.param0, bt.param1)); in TEST()
2651 RawMachineAssemblerTester<int32_t> m; in TEST() local
2652 Uint32BinopTester bt(&m); in TEST()
2653 bt.AddReturn(m.Word32Or(bt.param0, m.Word32Not(bt.param1))); in TEST()
2662 RawMachineAssemblerTester<int32_t> m; in TEST() local
2663 Uint32BinopTester bt(&m); in TEST()
2664 bt.AddReturn(m.Word32Or(m.Word32Not(bt.param0), bt.param1)); in TEST()
2678 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2679 m.Return(m.Word32Or(m.Int32Constant(*i), m.Parameter(0))); in TEST()
2682 CHECK_EQ(expected, m.Call(*j)); in TEST()
2688 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2689 m.Return(m.Word32Or(m.Int32Constant(*i), m.Word32Not(m.Parameter(0)))); in TEST()
2692 CHECK_EQ(expected, m.Call(*j)); in TEST()
2702 RawMachineAssemblerTester<int32_t> m; in TEST() local
2703 Int32BinopTester bt(&m); in TEST()
2705 m.Branch( in TEST()
2706 m.Word32Equal(m.Word32Or(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2708 m.Bind(&blocka); in TEST()
2709 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2710 m.Bind(&blockb); in TEST()
2711 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2720 RawMachineAssemblerTester<int32_t> m; in TEST() local
2721 Int32BinopTester bt(&m); in TEST()
2723 m.Branch( in TEST()
2724 m.Word32NotEqual(m.Word32Or(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2726 m.Bind(&blocka); in TEST()
2727 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2728 m.Bind(&blockb); in TEST()
2729 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2739 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
2741 m.Branch(m.Word32Equal(m.Word32Or(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2742 m.Int32Constant(0)), in TEST()
2744 m.Bind(&blocka); in TEST()
2745 m.Return(m.Int32Constant(constant)); in TEST()
2746 m.Bind(&blockb); in TEST()
2747 m.Return(m.Int32Constant(0 - constant)); in TEST()
2750 CHECK_EQ(expected, m.Call(*j)); in TEST()
2756 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
2758 m.Branch(m.Word32NotEqual(m.Word32Or(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2759 m.Int32Constant(0)), in TEST()
2761 m.Bind(&blocka); in TEST()
2762 m.Return(m.Int32Constant(constant)); in TEST()
2763 m.Bind(&blockb); in TEST()
2764 m.Return(m.Int32Constant(0 - constant)); in TEST()
2767 CHECK_EQ(expected, m.Call(*j)); in TEST()
2772 RawMachineAssemblerTester<void> m; in TEST() local
2773 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
2774 m.machine()->Word32Shl(), in TEST()
2775 m.machine()->Word32Shr()}; in TEST()
2777 RawMachineAssemblerTester<int32_t> m( in TEST() local
2780 m.Branch(m.Word32Equal(m.Word32Or(m.Parameter(0), in TEST()
2781 m.AddNode(shops[n], m.Parameter(1), in TEST()
2782 m.Parameter(2))), in TEST()
2783 m.Int32Constant(0)), in TEST()
2785 m.Bind(&blocka); in TEST()
2786 m.Return(m.Int32Constant(constant)); in TEST()
2787 m.Bind(&blockb); in TEST()
2788 m.Return(m.Int32Constant(0 - constant)); in TEST()
2807 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
2818 RawMachineAssemblerTester<int32_t> m; in TEST() local
2819 Int32BinopTester bt(&m); in TEST()
2821 m.Word32Equal(m.Word32Or(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
2830 RawMachineAssemblerTester<int32_t> m; in TEST() local
2831 Int32BinopTester bt(&m); in TEST()
2833 m.Word32Equal(m.Int32Constant(0), m.Word32Or(bt.param0, bt.param1))); in TEST()
2843 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2844 m.Return(m.Word32Equal(m.Word32Or(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2845 m.Int32Constant(0))); in TEST()
2848 CHECK_EQ(expected, m.Call(*j)); in TEST()
2854 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2855 m.Return(m.Word32Equal(m.Word32Or(m.Parameter(0), m.Int32Constant(*i)), in TEST()
2856 m.Int32Constant(0))); in TEST()
2859 CHECK_EQ(expected, m.Call(*j)); in TEST()
2869 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2870 m.Return(m.Word32Xor(m.Int32Constant(*i), m.Parameter(0))); in TEST()
2873 CHECK_EQ(expected, m.Call(*j)); in TEST()
2878 RawMachineAssemblerTester<int32_t> m; in TEST() local
2879 Uint32BinopTester bt(&m); in TEST()
2880 bt.AddReturn(m.Word32Xor(bt.param0, bt.param1)); in TEST()
2889 RawMachineAssemblerTester<int32_t> m; in TEST() local
2890 Int32BinopTester bt(&m); in TEST()
2891 bt.AddReturn(m.Word32Xor(bt.param0, m.Word32Not(bt.param1))); in TEST()
2900 RawMachineAssemblerTester<int32_t> m; in TEST() local
2901 Int32BinopTester bt(&m); in TEST()
2902 bt.AddReturn(m.Word32Xor(m.Word32Not(bt.param0), bt.param1)); in TEST()
2912 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2913 m.Return(m.Word32Xor(m.Int32Constant(*i), m.Word32Not(m.Parameter(0)))); in TEST()
2916 CHECK_EQ(expected, m.Call(*j)); in TEST()
2926 RawMachineAssemblerTester<int32_t> m; in TEST() local
2927 Uint32BinopTester bt(&m); in TEST()
2929 m.Branch( in TEST()
2930 m.Word32Equal(m.Word32Xor(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2932 m.Bind(&blocka); in TEST()
2933 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2934 m.Bind(&blockb); in TEST()
2935 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2944 RawMachineAssemblerTester<int32_t> m; in TEST() local
2945 Uint32BinopTester bt(&m); in TEST()
2947 m.Branch( in TEST()
2948 m.Word32NotEqual(m.Word32Xor(bt.param0, bt.param1), m.Int32Constant(0)), in TEST()
2950 m.Bind(&blocka); in TEST()
2951 bt.AddReturn(m.Int32Constant(constant)); in TEST()
2952 m.Bind(&blockb); in TEST()
2953 bt.AddReturn(m.Int32Constant(0 - constant)); in TEST()
2963 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2965 m.Branch(m.Word32Equal(m.Word32Xor(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2966 m.Int32Constant(0)), in TEST()
2968 m.Bind(&blocka); in TEST()
2969 m.Return(m.Int32Constant(constant)); in TEST()
2970 m.Bind(&blockb); in TEST()
2971 m.Return(m.Int32Constant(0 - constant)); in TEST()
2974 CHECK_EQ(expected, m.Call(*j)); in TEST()
2980 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
2982 m.Branch( in TEST()
2983 m.Word32NotEqual(m.Word32Xor(m.Int32Constant(*i), m.Parameter(0)), in TEST()
2984 m.Int32Constant(0)), in TEST()
2986 m.Bind(&blocka); in TEST()
2987 m.Return(m.Int32Constant(constant)); in TEST()
2988 m.Bind(&blockb); in TEST()
2989 m.Return(m.Int32Constant(0 - constant)); in TEST()
2992 CHECK_EQ(expected, m.Call(*j)); in TEST()
2997 RawMachineAssemblerTester<void> m; in TEST() local
2998 const Operator* shops[] = {m.machine()->Word32Sar(), in TEST()
2999 m.machine()->Word32Shl(), in TEST()
3000 m.machine()->Word32Shr()}; in TEST()
3002 RawMachineAssemblerTester<int32_t> m( in TEST() local
3005 m.Branch(m.Word32Equal(m.Word32Xor(m.Parameter(0), in TEST()
3006 m.AddNode(shops[n], m.Parameter(1), in TEST()
3007 m.Parameter(2))), in TEST()
3008 m.Int32Constant(0)), in TEST()
3010 m.Bind(&blocka); in TEST()
3011 m.Return(m.Int32Constant(constant)); in TEST()
3012 m.Bind(&blockb); in TEST()
3013 m.Return(m.Int32Constant(0 - constant)); in TEST()
3032 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
3044 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3045 m.Return(m.Word32Shl(m.Parameter(0), m.Int32Constant(shift))); in TEST()
3048 CHECK_EQ(expected, m.Call(*j)); in TEST()
3053 RawMachineAssemblerTester<int32_t> m; in TEST() local
3054 Uint32BinopTester bt(&m); in TEST()
3055 bt.AddReturn(m.Word32Shl(bt.param0, bt.param1)); in TEST()
3068 RawMachineAssemblerTester<int32_t> m; in TEST() local
3069 Uint32BinopTester bt(&m); in TEST()
3071 m.Word32Equal(m.Word32Shl(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
3080 RawMachineAssemblerTester<int32_t> m; in TEST() local
3081 Uint32BinopTester bt(&m); in TEST()
3083 m.Word32Equal(m.Int32Constant(0), m.Word32Shl(bt.param0, bt.param1))); in TEST()
3093 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3094 m.Return( in TEST()
3095 m.Word32Equal(m.Int32Constant(0), in TEST()
3096 m.Word32Shl(m.Parameter(0), m.Int32Constant(shift)))); in TEST()
3099 CHECK_EQ(expected, m.Call(*i)); in TEST()
3105 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3106 m.Return( in TEST()
3107 m.Word32Equal(m.Word32Shl(m.Parameter(0), m.Int32Constant(shift)), in TEST()
3108 m.Int32Constant(0))); in TEST()
3111 CHECK_EQ(expected, m.Call(*i)); in TEST()
3121 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3122 m.Return(m.Word32Shr(m.Parameter(0), m.Int32Constant(shift))); in TEST()
3125 CHECK_EQ(expected, m.Call(*j)); in TEST()
3130 RawMachineAssemblerTester<int32_t> m; in TEST() local
3131 Uint32BinopTester bt(&m); in TEST()
3132 bt.AddReturn(m.Word32Shr(bt.param0, bt.param1)); in TEST()
3146 RawMachineAssemblerTester<int32_t> m; in TEST() local
3147 Uint32BinopTester bt(&m); in TEST()
3149 m.Word32Equal(m.Word32Shr(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
3158 RawMachineAssemblerTester<int32_t> m; in TEST() local
3159 Uint32BinopTester bt(&m); in TEST()
3161 m.Word32Equal(m.Int32Constant(0), m.Word32Shr(bt.param0, bt.param1))); in TEST()
3171 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3172 m.Return( in TEST()
3173 m.Word32Equal(m.Int32Constant(0), in TEST()
3174 m.Word32Shr(m.Parameter(0), m.Int32Constant(shift)))); in TEST()
3177 CHECK_EQ(expected, m.Call(*i)); in TEST()
3183 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3184 m.Return( in TEST()
3185 m.Word32Equal(m.Word32Shr(m.Parameter(0), m.Int32Constant(shift)), in TEST()
3186 m.Int32Constant(0))); in TEST()
3189 CHECK_EQ(expected, m.Call(*i)); in TEST()
3199 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
3200 m.Return(m.Word32Sar(m.Parameter(0), m.Int32Constant(shift))); in TEST()
3203 CHECK_EQ(expected, m.Call(*j)); in TEST()
3208 RawMachineAssemblerTester<int32_t> m; in TEST() local
3209 Int32BinopTester bt(&m); in TEST()
3210 bt.AddReturn(m.Word32Sar(bt.param0, bt.param1)); in TEST()
3224 RawMachineAssemblerTester<int32_t> m; in TEST() local
3225 Int32BinopTester bt(&m); in TEST()
3227 m.Word32Equal(m.Word32Sar(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
3236 RawMachineAssemblerTester<int32_t> m; in TEST() local
3237 Int32BinopTester bt(&m); in TEST()
3239 m.Word32Equal(m.Int32Constant(0), m.Word32Sar(bt.param0, bt.param1))); in TEST()
3249 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
3250 m.Return( in TEST()
3251 m.Word32Equal(m.Int32Constant(0), in TEST()
3252 m.Word32Sar(m.Parameter(0), m.Int32Constant(shift)))); in TEST()
3255 CHECK_EQ(expected, m.Call(*i)); in TEST()
3261 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
3262 m.Return( in TEST()
3263 m.Word32Equal(m.Word32Sar(m.Parameter(0), m.Int32Constant(shift)), in TEST()
3264 m.Int32Constant(0))); in TEST()
3267 CHECK_EQ(expected, m.Call(*i)); in TEST()
3277 RawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
3278 m.Return(m.Word32Ror(m.Parameter(0), m.Int32Constant(shift))); in TEST()
3281 CHECK_EQ(expected, m.Call(*j)); in TEST()
3286 RawMachineAssemblerTester<int32_t> m; in TEST() local
3287 Uint32BinopTester bt(&m); in TEST()
3288 bt.AddReturn(m.Word32Ror(bt.param0, bt.param1)); in TEST()
3301 RawMachineAssemblerTester<int32_t> m; in TEST() local
3302 Uint32BinopTester bt(&m); in TEST()
3304 m.Word32Equal(m.Word32Ror(bt.param0, bt.param1), m.Int32Constant(0))); in TEST()
3313 RawMachineAssemblerTester<int32_t> m; in TEST() local
3314 Uint32BinopTester bt(&m); in TEST()
3316 m.Word32Equal(m.Int32Constant(0), m.Word32Ror(bt.param0, bt.param1))); in TEST()
3326 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3327 m.Return( in TEST()
3328 m.Word32Equal(m.Int32Constant(0), in TEST()
3329 m.Word32Ror(m.Parameter(0), m.Int32Constant(shift)))); in TEST()
3332 CHECK_EQ(expected, m.Call(*i)); in TEST()
3338 RawMachineAssemblerTester<uint32_t> m(MachineType::Uint32()); in TEST() local
3339 m.Return( in TEST()
3340 m.Word32Equal(m.Word32Ror(m.Parameter(0), m.Int32Constant(shift)), in TEST()
3341 m.Int32Constant(0))); in TEST()
3344 CHECK_EQ(expected, m.Call(*i)); in TEST()
3352 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
3353 m.Return(m.Word32Not(m.Parameter(0))); in TEST()
3356 CHECK_EQ(expected, m.Call(*i)); in TEST()
3362 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
3363 m.Return(m.Int32Neg(m.Parameter(0))); in TEST()
3366 CHECK_EQ(expected, m.Call(*i)); in TEST()
3373 RawMachineAssemblerTester<int32_t> m( in TEST() local
3375 m.Return(m.Word32Equal(m.Parameter(0), in TEST()
3376 m.Word32Sar(m.Parameter(1), m.Parameter(2)))); in TEST()
3381 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
3387 RawMachineAssemblerTester<int32_t> m( in TEST() local
3389 m.Return(m.Word32Equal(m.Word32Sar(m.Parameter(0), m.Parameter(1)), in TEST()
3390 m.Parameter(2))); in TEST()
3395 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
3405 RawMachineAssemblerTester<int32_t> m( in TEST() local
3407 m.Return(m.Word32Equal(m.Parameter(0), in TEST()
3408 m.Word32Shl(m.Parameter(1), m.Parameter(2)))); in TEST()
3413 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
3419 RawMachineAssemblerTester<int32_t> m( in TEST() local
3421 m.Return(m.Word32Equal(m.Word32Shl(m.Parameter(0), m.Parameter(1)), in TEST()
3422 m.Parameter(2))); in TEST()
3427 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
3437 RawMachineAssemblerTester<int32_t> m( in TEST() local
3439 m.Return(m.Word32Equal(m.Parameter(0), in TEST()
3440 m.Word32Shr(m.Parameter(1), m.Parameter(2)))); in TEST()
3445 CHECK_EQ(expected, m.Call(*i, *j, shift)); in TEST()
3451 RawMachineAssemblerTester<int32_t> m( in TEST() local
3453 m.Return(m.Word32Equal(m.Word32Shr(m.Parameter(0), m.Parameter(1)), in TEST()
3454 m.Parameter(2))); in TEST()
3459 CHECK_EQ(expected, m.Call(*i, shift, *k)); in TEST()
3469 RawMachineAssemblerTester<int32_t> m(i == 5 ? MachineType::Int32() in TEST() local
3474 m.Int32Constant(44); in TEST()
3477 m.StringConstant("unused"); in TEST()
3480 m.NumberConstant(11.1); in TEST()
3483 m.PointerConstant(&constant); in TEST()
3486 m.LoadFromPointer(&constant, MachineType::Int32()); in TEST()
3489 m.Parameter(0); in TEST()
3494 m.Return(m.Int32Constant(constant)); in TEST()
3496 CHECK_EQ(constant, m.Call()); in TEST()
3498 CHECK_EQ(constant, m.Call(0)); in TEST()
3505 RawMachineAssemblerTester<int32_t> m; in TEST() local
3508 m.machine()->Word32And(), m.machine()->Word32Or(), in TEST()
3509 m.machine()->Word32Xor(), m.machine()->Word32Shl(), in TEST()
3510 m.machine()->Word32Shr(), m.machine()->Word32Sar(), in TEST()
3511 m.machine()->Word32Ror(), m.machine()->Word32Equal(), in TEST()
3512 m.machine()->Int32Add(), m.machine()->Int32Sub(), in TEST()
3513 m.machine()->Int32Mul(), m.machine()->Int32MulHigh(), in TEST()
3514 m.machine()->Int32Div(), m.machine()->Uint32Div(), in TEST()
3515 m.machine()->Int32Mod(), m.machine()->Uint32Mod(), in TEST()
3516 m.machine()->Uint32MulHigh(), m.machine()->Int32LessThan(), in TEST()
3517 m.machine()->Int32LessThanOrEqual(), m.machine()->Uint32LessThan(), in TEST()
3518 m.machine()->Uint32LessThanOrEqual()}; in TEST()
3521 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
3524 m.AddNode(kOps[i], m.Parameter(0), m.Parameter(1)); in TEST()
3525 m.Return(m.Int32Constant(constant)); in TEST()
3527 CHECK_EQ(constant, m.Call(1, 1)); in TEST()
3546 RawMachineAssemblerTester<Type> m; in RunLoadImmIndex() local
3547 Node* base = m.PointerConstant(buffer - offset); in RunLoadImmIndex()
3548 Node* index = m.Int32Constant((offset + i) * sizeof(buffer[0])); in RunLoadImmIndex()
3549 m.Return(m.Load(rep, base, index)); in RunLoadImmIndex()
3552 Type actual = m.Call(); in RunLoadImmIndex()
3587 RawMachineAssemblerTester<int32_t> m; in RunLoadStore() local
3589 Node* base = m.PointerConstant(buffer); in RunLoadStore()
3590 Node* index0 = m.IntPtrConstant(x * sizeof(buffer[0])); in RunLoadStore()
3591 Node* load = m.Load(rep, base, index0); in RunLoadStore()
3592 Node* index1 = m.IntPtrConstant(y * sizeof(buffer[0])); in RunLoadStore()
3593 m.Store(rep.representation(), base, index1, load, kNoWriteBarrier); in RunLoadStore()
3594 m.Return(m.Int32Constant(OK)); in RunLoadStore()
3597 CHECK_EQ(OK, m.Call()); in RunLoadStore()
3617 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32(), in TEST() local
3619 m.Return(m.Float32Add(m.Parameter(0), m.Parameter(1))); in TEST()
3624 CheckFloatEq(expected, m.Call(*i, *j)); in TEST()
3631 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32(), in TEST() local
3633 m.Return(m.Float32Sub(m.Parameter(0), m.Parameter(1))); in TEST()
3638 CheckFloatEq(expected, m.Call(*i, *j)); in TEST()
3645 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32(), in TEST() local
3647 m.Return(m.Float32Mul(m.Parameter(0), m.Parameter(1))); in TEST()
3652 CheckFloatEq(expected, m.Call(*i, *j)); in TEST()
3659 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32(), in TEST() local
3661 m.Return(m.Float32Div(m.Parameter(0), m.Parameter(1))); in TEST()
3666 CheckFloatEq(expected, m.Call(*i, *j)); in TEST()
3673 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
3675 m.Return(m.Float64Add(m.Parameter(0), m.Parameter(1))); in TEST()
3680 CheckDoubleEq(expected, m.Call(*i, *j)); in TEST()
3687 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
3689 m.Return(m.Float64Sub(m.Parameter(0), m.Parameter(1))); in TEST()
3694 CheckDoubleEq(expected, m.Call(*i, *j)); in TEST()
3701 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
3703 m.Return(m.Float64Mul(m.Parameter(0), m.Parameter(1))); in TEST()
3708 CheckDoubleEq(expected, m.Call(*i, *j)); in TEST()
3715 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
3717 m.Return(m.Float64Div(m.Parameter(0), m.Parameter(1))); in TEST()
3722 CheckDoubleEq(expected, m.Call(*i, *j)); in TEST()
3729 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
3731 m.Return(m.Float64Mod(m.Parameter(0), m.Parameter(1))); in TEST()
3734 FOR_FLOAT64_INPUTS(j) { CheckDoubleEq(modulo(*i, *j), m.Call(*i, *j)); } in TEST()
3740 RawMachineAssemblerTester<int32_t> m; in TEST() local
3742 const Operator* ops[] = {m.machine()->Float32Add(), m.machine()->Float32Sub(), in TEST()
3743 m.machine()->Float32Mul(), m.machine()->Float32Div(), in TEST()
3747 RawMachineAssemblerTester<int32_t> m; in TEST() local
3749 m.AddNode(ops[i], m.Float32Constant(0.1f), m.Float32Constant(1.11f)); in TEST()
3750 m.Return(m.Int32Constant(constant)); in TEST()
3751 CHECK_EQ(constant, m.Call()); in TEST()
3757 RawMachineAssemblerTester<int32_t> m; in TEST() local
3759 const Operator* ops[] = {m.machine()->Float64Add(), m.machine()->Float64Sub(), in TEST()
3760 m.machine()->Float64Mul(), m.machine()->Float64Div(), in TEST()
3761 m.machine()->Float64Mod(), NULL}; in TEST()
3764 RawMachineAssemblerTester<int32_t> m; in TEST() local
3766 m.AddNode(ops[i], m.Float64Constant(0.1), m.Float64Constant(1.11)); in TEST()
3767 m.Return(m.Int32Constant(constant)); in TEST()
3768 CHECK_EQ(constant, m.Call()); in TEST()
3774 RawMachineAssemblerTester<int32_t> m; in TEST() local
3775 Float32BinopTester bt(&m); in TEST()
3777 bt.AddReturn(m.Float32Add(bt.param0, bt.param1)); in TEST()
3789 RawMachineAssemblerTester<int32_t> m; in TEST() local
3790 Float64BinopTester bt(&m); in TEST()
3792 bt.AddReturn(m.Float64Add(bt.param0, bt.param1)); in TEST()
3804 RawMachineAssemblerTester<int32_t> m; in TEST() local
3805 Float32BinopTester bt(&m); in TEST()
3806 if (!m.machine()->Float32Max().IsSupported()) return; in TEST()
3808 bt.AddReturn(m.Float32Max(bt.param0, bt.param1)); in TEST()
3820 RawMachineAssemblerTester<int32_t> m; in TEST() local
3821 Float64BinopTester bt(&m); in TEST()
3822 if (!m.machine()->Float64Max().IsSupported()) return; in TEST()
3824 bt.AddReturn(m.Float64Max(bt.param0, bt.param1)); in TEST()
3836 RawMachineAssemblerTester<int32_t> m; in TEST() local
3837 Float32BinopTester bt(&m); in TEST()
3838 if (!m.machine()->Float32Min().IsSupported()) return; in TEST()
3840 bt.AddReturn(m.Float32Min(bt.param0, bt.param1)); in TEST()
3852 RawMachineAssemblerTester<int32_t> m; in TEST() local
3853 Float64BinopTester bt(&m); in TEST()
3854 if (!m.machine()->Float64Min().IsSupported()) return; in TEST()
3856 bt.AddReturn(m.Float64Min(bt.param0, bt.param1)); in TEST()
3868 RawMachineAssemblerTester<int32_t> m; in TEST() local
3869 Float32BinopTester bt(&m); in TEST()
3871 bt.AddReturn(m.Float32Sub(bt.param0, bt.param1)); in TEST()
3884 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
3885 m.Return(m.Float32Sub(m.Float32Constant(*i), m.Parameter(0))); in TEST()
3889 CheckFloatEq(expected, m.Call(*j)); in TEST()
3897 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
3898 m.Return(m.Float32Sub(m.Parameter(0), m.Float32Constant(*i))); in TEST()
3902 CheckFloatEq(expected, m.Call(*j)); in TEST()
3910 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
3911 m.Return(m.Float64Sub(m.Float64Constant(*i), m.Parameter(0))); in TEST()
3913 FOR_FLOAT64_INPUTS(j) { CheckFloatEq(*i - *j, m.Call(*j)); } in TEST()
3920 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
3921 m.Return(m.Float64Sub(m.Parameter(0), m.Float64Constant(*i))); in TEST()
3923 FOR_FLOAT64_INPUTS(j) { CheckFloatEq(*j - *i, m.Call(*j)); } in TEST()
3929 RawMachineAssemblerTester<int32_t> m; in TEST() local
3930 Float64BinopTester bt(&m); in TEST()
3932 bt.AddReturn(m.Float64Sub(bt.param0, bt.param1)); in TEST()
3944 RawMachineAssemblerTester<int32_t> m; in TEST() local
3945 Float32BinopTester bt(&m); in TEST()
3947 bt.AddReturn(m.Float32Mul(bt.param0, bt.param1)); in TEST()
3959 RawMachineAssemblerTester<int32_t> m; in TEST() local
3960 Float64BinopTester bt(&m); in TEST()
3962 bt.AddReturn(m.Float64Mul(bt.param0, bt.param1)); in TEST()
3974 BufferedRawMachineAssemblerTester<double> m( in TEST() local
3976 m.Return(m.Float64Add(m.Float64Mul(m.Parameter(0), m.Parameter(1)), in TEST()
3977 m.Parameter(2))); in TEST()
3982 CheckDoubleEq((*i * *j) + *k, m.Call(*i, *j, *k)); in TEST()
3990 BufferedRawMachineAssemblerTester<double> m( in TEST() local
3992 m.Return(m.Float64Add(m.Parameter(0), in TEST()
3993 m.Float64Mul(m.Parameter(1), m.Parameter(2)))); in TEST()
3998 CheckDoubleEq(*i + (*j * *k), m.Call(*i, *j, *k)); in TEST()
4006 BufferedRawMachineAssemblerTester<double> m( in TEST() local
4008 m.Return(m.Float64Sub(m.Float64Mul(m.Parameter(0), m.Parameter(1)), in TEST()
4009 m.Parameter(2))); in TEST()
4014 CheckDoubleEq((*i * *j) - *k, m.Call(*i, *j, *k)); in TEST()
4022 BufferedRawMachineAssemblerTester<double> m( in TEST() local
4024 m.Return(m.Float64Sub(m.Parameter(0), in TEST()
4025 m.Float64Mul(m.Parameter(1), m.Parameter(2)))); in TEST()
4030 CheckDoubleEq(*i - (*j * *k), m.Call(*i, *j, *k)); in TEST()
4039 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
4040 m.Return(m.Float64Mul(m.Float64Constant(*i), m.Parameter(0))); in TEST()
4042 FOR_FLOAT64_INPUTS(j) { CheckFloatEq(*i * *j, m.Call(*j)); } in TEST()
4049 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
4050 m.Return(m.Float64Mul(m.Parameter(0), m.Float64Constant(*i))); in TEST()
4052 FOR_FLOAT64_INPUTS(j) { CheckFloatEq(*j * *i, m.Call(*j)); } in TEST()
4058 RawMachineAssemblerTester<int32_t> m; in TEST() local
4059 Float32BinopTester bt(&m); in TEST()
4061 bt.AddReturn(m.Float32Div(bt.param0, bt.param1)); in TEST()
4073 RawMachineAssemblerTester<int32_t> m; in TEST() local
4074 Float64BinopTester bt(&m); in TEST()
4076 bt.AddReturn(m.Float64Div(bt.param0, bt.param1)); in TEST()
4088 RawMachineAssemblerTester<int32_t> m; in TEST() local
4089 Float64BinopTester bt(&m); in TEST()
4091 bt.AddReturn(m.Float64Mod(bt.param0, bt.param1)); in TEST()
4105 BufferedRawMachineAssemblerTester<double> m; in TEST() local
4106 m.Return(m.ChangeInt32ToFloat64(m.Int32Constant(magic))); in TEST()
4107 CheckDoubleEq(static_cast<double>(magic), m.Call()); in TEST()
4112 BufferedRawMachineAssemblerTester<double> m(MachineType::Int32()); in TEST() local
4113 m.Return(m.ChangeInt32ToFloat64(m.Parameter(0))); in TEST()
4115 FOR_INT32_INPUTS(i) { CheckDoubleEq(static_cast<double>(*i), m.Call(*i)); } in TEST()
4120 BufferedRawMachineAssemblerTester<double> m(MachineType::Uint32()); in TEST() local
4121 m.Return(m.ChangeUint32ToFloat64(m.Parameter(0))); in TEST()
4123 FOR_UINT32_INPUTS(i) { CheckDoubleEq(static_cast<double>(*i), m.Call(*i)); } in TEST()
4128 BufferedRawMachineAssemblerTester<int32_t> m; in TEST() local
4130 m.Return(m.ChangeFloat64ToInt32(m.Float64Constant(magic))); in TEST()
4131 CHECK_EQ(static_cast<int32_t>(magic), m.Call()); in TEST()
4136 BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Float64()); in TEST() local
4137 m.Return(m.ChangeFloat64ToInt32(m.Parameter(0))); in TEST()
4141 FOR_INT32_INPUTS(i) { CHECK_EQ(*i, m.Call(static_cast<double>(*i))); } in TEST()
4144 CHECK_EQ(1 << n, m.Call(static_cast<double>(1 << n))); in TEST()
4148 CHECK_EQ(3 << n, m.Call(static_cast<double>(3 << n))); in TEST()
4154 BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float64()); in TEST() local
4155 m.Return(m.ChangeFloat64ToUint32(m.Parameter(0))); in TEST()
4158 FOR_UINT32_INPUTS(i) { CHECK_EQ(*i, m.Call(static_cast<double>(*i))); } in TEST()
4163 { CHECK_EQ(1u << n, m.Call(static_cast<double>(1u << n))); } in TEST()
4165 { CHECK_EQ(3u << n, m.Call(static_cast<double>(3u << n))); } in TEST()
4173 BufferedRawMachineAssemblerTester<float> m(MachineType::Float64()); in TEST() local
4175 m.Return(m.TruncateFloat64ToFloat32(m.Parameter(0))); in TEST()
4177 FOR_FLOAT64_INPUTS(i) { CheckFloatEq(DoubleToFloat32(*i), m.Call(*i)); } in TEST()
4182 RawMachineAssemblerTester<int32_t> m; in TEST() local
4184 m.ChangeFloat64ToInt32(m.Float64Constant(999.78)); in TEST()
4185 m.Return(m.Int32Constant(magic)); in TEST()
4186 CHECK_EQ(magic, m.Call()); in TEST()
4191 RawMachineAssemblerTester<int32_t> m; in TEST() local
4193 m.ChangeInt32ToFloat64(m.Int32Constant(magic - 6888)); in TEST()
4194 m.Return(m.Int32Constant(magic)); in TEST()
4195 CHECK_EQ(magic, m.Call()); in TEST()
4200 RawMachineAssemblerTester<int32_t> m; in TEST() local
4206 Node* false_node = m.Int32Constant(false_val); in TEST()
4207 m.Goto(&header); in TEST()
4208 m.Bind(&header); in TEST()
4209 Node* phi = m.Phi(MachineRepresentation::kWord32, false_node, false_node); in TEST()
4210 m.Branch(m.Int32Constant(0), &body, &end); in TEST()
4211 m.Bind(&body); in TEST()
4212 Node* add = m.Int32Add(phi, m.Int32Constant(1)); in TEST()
4214 m.Goto(&header); in TEST()
4215 m.Bind(&end); in TEST()
4216 m.Return(phi); in TEST()
4218 CHECK_EQ(false_val, m.Call()); in TEST()
4223 RawMachineAssemblerTester<int32_t> m; in TEST() local
4230 Node* k1 = m.Float32Constant(constant); in TEST()
4231 Node* k2 = m.Float32Constant(0 - constant); in TEST()
4232 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
4233 m.Bind(&blocka); in TEST()
4234 m.Goto(&end); in TEST()
4235 m.Bind(&blockb); in TEST()
4236 m.Goto(&end); in TEST()
4237 m.Bind(&end); in TEST()
4238 Node* phi = m.Phi(MachineRepresentation::kFloat32, k2, k1); in TEST()
4239 m.Store(MachineRepresentation::kFloat32, m.PointerConstant(&buffer), in TEST()
4240 m.IntPtrConstant(0), phi, kNoWriteBarrier); in TEST()
4241 m.Return(m.Int32Constant(magic)); in TEST()
4243 CHECK_EQ(magic, m.Call()); in TEST()
4249 RawMachineAssemblerTester<int32_t> m; in TEST() local
4256 Node* k1 = m.Float64Constant(constant); in TEST()
4257 Node* k2 = m.Float64Constant(0 - constant); in TEST()
4258 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
4259 m.Bind(&blocka); in TEST()
4260 m.Goto(&end); in TEST()
4261 m.Bind(&blockb); in TEST()
4262 m.Goto(&end); in TEST()
4263 m.Bind(&end); in TEST()
4264 Node* phi = m.Phi(MachineRepresentation::kFloat64, k2, k1); in TEST()
4265 m.Store(MachineRepresentation::kFloat64, m.PointerConstant(&buffer), in TEST()
4266 m.Int32Constant(0), phi, kNoWriteBarrier); in TEST()
4267 m.Return(m.Int32Constant(magic)); in TEST()
4269 CHECK_EQ(magic, m.Call()); in TEST()
4275 RawMachineAssemblerTester<int32_t> m; in TEST() local
4283 Node* k1 = m.StringConstant("A"); in TEST()
4284 Node* k2 = m.StringConstant("B"); in TEST()
4285 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
4286 m.Bind(&blocka); in TEST()
4287 m.Goto(&end); in TEST()
4288 m.Bind(&blockb); in TEST()
4289 m.Goto(&end); in TEST()
4290 m.Bind(&end); in TEST()
4291 Node* phi = m.Phi(MachineRepresentation::kTagged, k2, k1); in TEST()
4292 m.Store(MachineRepresentation::kTagged, m.PointerConstant(&buffer), in TEST()
4293 m.Int32Constant(0), phi, kNoWriteBarrier); in TEST()
4294 m.Return(m.Int32Constant(magic)); in TEST()
4296 CHECK_EQ(magic, m.Call()); in TEST()
4302 RawMachineAssemblerTester<int32_t> m; in TEST() local
4312 Node* d1 = m.Float64Constant(dconstant); in TEST()
4313 Node* d2 = m.Float64Constant(0 - dconstant); in TEST()
4314 Node* r1 = m.StringConstant("AX"); in TEST()
4315 Node* r2 = m.StringConstant("BX"); in TEST()
4316 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
4317 m.Bind(&blocka); in TEST()
4318 m.Goto(&end); in TEST()
4319 m.Bind(&blockb); in TEST()
4320 m.Goto(&end); in TEST()
4321 m.Bind(&end); in TEST()
4322 Node* dphi = m.Phi(MachineRepresentation::kFloat64, d2, d1); in TEST()
4323 Node* rphi = m.Phi(MachineRepresentation::kTagged, r2, r1); in TEST()
4324 m.Store(MachineRepresentation::kFloat64, m.PointerConstant(&dbuffer), in TEST()
4325 m.Int32Constant(0), dphi, kNoWriteBarrier); in TEST()
4326 m.Store(MachineRepresentation::kTagged, m.PointerConstant(&rbuffer), in TEST()
4327 m.Int32Constant(0), rphi, kNoWriteBarrier); in TEST()
4328 m.Return(m.Int32Constant(magic)); in TEST()
4330 CHECK_EQ(magic, m.Call()); in TEST()
4337 RawMachineAssemblerTester<int32_t> m; in TEST() local
4347 Node* d1 = m.Float64Constant(dconstant); in TEST()
4348 Node* d2 = m.Float64Constant(0 - dconstant); in TEST()
4349 Node* r1 = m.StringConstant("AD"); in TEST()
4350 Node* r2 = m.StringConstant("BD"); in TEST()
4351 m.Branch(m.Int32Constant(0), &blocka, &blockb); in TEST()
4352 m.Bind(&blocka); in TEST()
4353 m.Goto(&mid); in TEST()
4354 m.Bind(&blockb); in TEST()
4355 m.Goto(&mid); in TEST()
4356 m.Bind(&mid); in TEST()
4357 Node* dphi1 = m.Phi(MachineRepresentation::kFloat64, d2, d1); in TEST()
4358 Node* rphi1 = m.Phi(MachineRepresentation::kTagged, r2, r1); in TEST()
4359 m.Branch(m.Int32Constant(0), &blockd, &blocke); in TEST()
4361 m.Bind(&blockd); in TEST()
4362 m.Goto(&end); in TEST()
4363 m.Bind(&blocke); in TEST()
4364 m.Goto(&end); in TEST()
4365 m.Bind(&end); in TEST()
4366 Node* dphi2 = m.Phi(MachineRepresentation::kFloat64, d1, dphi1); in TEST()
4367 Node* rphi2 = m.Phi(MachineRepresentation::kTagged, r1, rphi1); in TEST()
4369 m.Store(MachineRepresentation::kFloat64, m.PointerConstant(&dbuffer), in TEST()
4370 m.Int32Constant(0), dphi2, kNoWriteBarrier); in TEST()
4371 m.Store(MachineRepresentation::kTagged, m.PointerConstant(&rbuffer), in TEST()
4372 m.Int32Constant(0), rphi2, kNoWriteBarrier); in TEST()
4373 m.Return(m.Int32Constant(magic)); in TEST()
4375 CHECK_EQ(magic, m.Call()); in TEST()
4382 RawMachineAssemblerTester<int32_t> m; in TEST() local
4389 Node* zero = m.Int32Constant(0); in TEST()
4390 Node* dk = m.Float64Constant(dconstant); in TEST()
4392 m.Goto(&header); in TEST()
4393 m.Bind(&header); in TEST()
4394 Node* phi = m.Phi(MachineRepresentation::kFloat64, dk, dk); in TEST()
4396 m.Branch(zero, &body, &end); in TEST()
4397 m.Bind(&body); in TEST()
4398 m.Goto(&header); in TEST()
4399 m.Bind(&end); in TEST()
4400 m.Store(MachineRepresentation::kFloat64, m.PointerConstant(&buffer), in TEST()
4401 m.Int32Constant(0), phi, kNoWriteBarrier); in TEST()
4402 m.Return(m.Int32Constant(magic)); in TEST()
4404 CHECK_EQ(magic, m.Call()); in TEST()
4409 RawMachineAssemblerTester<int32_t> m; in TEST() local
4411 Node* zero = m.Int32Constant(0); in TEST()
4412 Node* ten = m.Int32Constant(10); in TEST()
4413 Node* one = m.Int32Constant(1); in TEST()
4417 m.Goto(&header); in TEST()
4419 m.Bind(&header); in TEST()
4420 Node* i = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
4421 Node* j = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
4422 m.Goto(&body); in TEST()
4424 m.Bind(&body); in TEST()
4425 Node* next_i = m.Int32Add(i, one); in TEST()
4426 Node* next_j = m.Int32Add(j, one); in TEST()
4427 m.Branch(m.Word32Equal(next_i, ten), &end, &body_cont); in TEST()
4429 m.Bind(&body_cont); in TEST()
4432 m.Goto(&header); in TEST()
4434 m.Bind(&end); in TEST()
4435 m.Return(ten); in TEST()
4437 CHECK_EQ(10, m.Call()); in TEST()
4442 RawMachineAssemblerTester<int32_t> m; in TEST() local
4444 Node* zero = m.Int32Constant(0); in TEST()
4445 Node* ten = m.Int32Constant(10); in TEST()
4446 Node* one = m.Int32Constant(1); in TEST()
4450 m.Goto(&header); in TEST()
4452 m.Bind(&header); in TEST()
4453 Node* i = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
4454 Node* j = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
4455 Node* k = m.Phi(MachineRepresentation::kWord32, zero, zero); in TEST()
4456 m.Goto(&body); in TEST()
4458 m.Bind(&body); in TEST()
4459 Node* next_i = m.Int32Add(i, one); in TEST()
4460 Node* next_j = m.Int32Add(j, one); in TEST()
4461 Node* next_k = m.Int32Add(j, one); in TEST()
4462 m.Branch(m.Word32Equal(next_i, ten), &end, &body_cont); in TEST()
4464 m.Bind(&body_cont); in TEST()
4468 m.Goto(&header); in TEST()
4470 m.Bind(&end); in TEST()
4471 m.Return(ten); in TEST()
4473 CHECK_EQ(10, m.Call()); in TEST()
4478 RawMachineAssemblerTester<int32_t> m; in TEST() local
4481 Node* base = m.PointerConstant(inputs); in TEST()
4483 m.Load(MachineType::Int32(), base, m.Int32Constant(0 * sizeof(int32_t))); in TEST()
4485 m.Load(MachineType::Int32(), base, m.Int32Constant(1 * sizeof(int32_t))); in TEST()
4487 m.Load(MachineType::Int32(), base, m.Int32Constant(2 * sizeof(int32_t))); in TEST()
4489 m.Load(MachineType::Int32(), base, m.Int32Constant(3 * sizeof(int32_t))); in TEST()
4491 m.Load(MachineType::Int32(), base, m.Int32Constant(4 * sizeof(int32_t))); in TEST()
4493 m.Load(MachineType::Int32(), base, m.Int32Constant(5 * sizeof(int32_t))); in TEST()
4495 m.Load(MachineType::Int32(), base, m.Int32Constant(6 * sizeof(int32_t))); in TEST()
4497 m.Load(MachineType::Int32(), base, m.Int32Constant(7 * sizeof(int32_t))); in TEST()
4499 Node* i1 = m.Int32Add(n0, n1); in TEST()
4500 Node* i2 = m.Int32Add(n2, n3); in TEST()
4501 Node* i3 = m.Int32Add(n4, n5); in TEST()
4502 Node* i4 = m.Int32Add(n6, n7); in TEST()
4504 Node* i5 = m.Int32Add(i1, i2); in TEST()
4505 Node* i6 = m.Int32Add(i3, i4); in TEST()
4507 Node* i7 = m.Int32Add(i5, i6); in TEST()
4509 m.Return(i7); in TEST()
4511 CHECK_EQ(116, m.Call()); in TEST()
4518 static int Float64CompareHelper(RawMachineAssemblerTester<int32_t>* m, in Float64CompareHelper() argument
4530 load_a ? m->Load(MachineType::Float64(), m->PointerConstant(&buffer[0])) in Float64CompareHelper()
4531 : m->Float64Constant(x); in Float64CompareHelper()
4533 load_b ? m->Load(MachineType::Float64(), m->PointerConstant(&buffer[1])) in Float64CompareHelper()
4534 : m->Float64Constant(y); in Float64CompareHelper()
4540 cmp = m->Float64Equal(a, b); in Float64CompareHelper()
4544 cmp = m->Float64Equal(a, a); in Float64CompareHelper()
4549 cmp = m->Float64LessThan(a, b); in Float64CompareHelper()
4553 cmp = m->Float64LessThan(b, a); in Float64CompareHelper()
4557 cmp = m->Float64LessThan(a, a); in Float64CompareHelper()
4562 cmp = m->Float64LessThanOrEqual(a, b); in Float64CompareHelper()
4566 cmp = m->Float64LessThanOrEqual(b, a); in Float64CompareHelper()
4570 cmp = m->Float64LessThanOrEqual(a, a); in Float64CompareHelper()
4575 cmp = m->Float64NotEqual(a, b); in Float64CompareHelper()
4579 cmp = m->Float64NotEqual(b, a); in Float64CompareHelper()
4583 cmp = m->Float64NotEqual(a, a); in Float64CompareHelper()
4588 cmp = m->Float64GreaterThan(a, a); in Float64CompareHelper()
4592 cmp = m->Float64GreaterThan(a, b); in Float64CompareHelper()
4597 cmp = m->Float64GreaterThanOrEqual(a, a); in Float64CompareHelper()
4601 cmp = m->Float64GreaterThanOrEqual(b, a); in Float64CompareHelper()
4607 m->Return(cmp); in Float64CompareHelper()
4622 RawMachineAssemblerTester<int32_t> m; in TEST() local
4623 int expected = Float64CompareHelper(&m, test, node_type, inputs[input], in TEST()
4625 CHECK_EQ(expected, m.Call()); in TEST()
4633 RawMachineAssemblerTester<int32_t> m; in TEST() local
4635 const Operator* operators[] = {m.machine()->Float64Equal(), in TEST()
4636 m.machine()->Float64LessThan(), in TEST()
4637 m.machine()->Float64LessThanOrEqual()}; in TEST()
4644 RawMachineAssemblerTester<int32_t> m; in TEST() local
4645 Node* a = m.Float64Constant(*i); in TEST()
4646 Node* b = m.Float64Constant(nan); in TEST()
4648 m.Return(m.AddNode(operators[o], a, b)); in TEST()
4649 CHECK_EQ(0, m.Call()); in TEST()
4660 RawMachineAssemblerTester<int32_t> m; in TEST() local
4661 Node* a = m.LoadFromPointer(&input_a, MachineType::Float64()); in TEST()
4662 Node* b = m.LoadFromPointer(&input_b, MachineType::Float64()); in TEST()
4663 m.Return(m.Float64Equal(a, b)); in TEST()
4671 CHECK_EQ(expected, m.Call()); in TEST()
4681 RawMachineAssemblerTester<int32_t> m; in TEST() local
4682 Node* a = m.LoadFromPointer(&input_a, MachineType::Float64()); in TEST()
4683 Node* b = m.LoadFromPointer(&input_b, MachineType::Float64()); in TEST()
4684 m.Return(m.Float64LessThan(a, b)); in TEST()
4692 CHECK_EQ(expected, m.Call()); in TEST()
4702 RawMachineAssemblerTester<int32_t> m; in LoadStoreTruncation() local
4703 Node* a = m.LoadFromPointer(&input, kRepresentation); in LoadStoreTruncation()
4704 Node* ap1 = m.Int32Add(a, m.Int32Constant(1)); in LoadStoreTruncation()
4705 m.StoreToPointer(&input, kRepresentation.representation(), ap1); in LoadStoreTruncation()
4706 m.Return(ap1); in LoadStoreTruncation()
4713 CHECK_EQ(max + 1, m.Call()); in LoadStoreTruncation()
4718 CHECK_EQ(static_cast<IntType>(max + 2), m.Call()); in LoadStoreTruncation()
4725 CHECK_EQ(static_cast<IntType>(expected), m.Call()); in LoadStoreTruncation()
4739 RawMachineAssemblerTester<bool> m(MachineType::Pointer(), in IntPtrCompare() local
4741 Node* p0 = m.Parameter(0); in IntPtrCompare()
4742 Node* p1 = m.Parameter(1); in IntPtrCompare()
4747 res = m.IntPtrLessThan(p0, p1); in IntPtrCompare()
4751 res = m.IntPtrLessThanOrEqual(p0, p1); in IntPtrCompare()
4755 res = m.IntPtrEqual(p0, p1); in IntPtrCompare()
4759 res = m.IntPtrGreaterThanOrEqual(p0, p1); in IntPtrCompare()
4763 res = m.IntPtrGreaterThan(p0, p1); in IntPtrCompare()
4767 res = m.IntPtrEqual(p0, p0); in IntPtrCompare()
4771 res = m.IntPtrNotEqual(p0, p1); in IntPtrCompare()
4778 m.Return(res); in IntPtrCompare()
4779 CHECK_EQ(expected, m.Call(reinterpret_cast<int32_t*>(left), in IntPtrCompare()
4804 RawMachineAssemblerTester<int32_t*> m; in TEST() local
4805 Node* input = m.PointerConstant(&inputs[0]); in TEST()
4806 Node* output = m.PointerConstant(&outputs[kInputSize - 1]); in TEST()
4807 Node* elem_size = m.IntPtrConstant(sizeof(inputs[0])); in TEST()
4809 m.Store(MachineRepresentation::kWord32, output, in TEST()
4810 m.Load(MachineType::Int32(), input), kNoWriteBarrier); in TEST()
4811 input = m.IntPtrAdd(input, elem_size); in TEST()
4812 output = m.IntPtrSub(output, elem_size); in TEST()
4814 m.Return(input); in TEST()
4815 CHECK_EQ(&inputs[kInputSize], m.Call()); in TEST()
4825 RawMachineAssemblerTester<int32_t> m; in TEST() local
4828 Node* one = m.Int32Constant(1); in TEST()
4831 acc = m.Int32Add(acc, one); in TEST()
4835 m.StoreToPointer(&outputs[i], MachineRepresentation::kWord32, accs[i]); in TEST()
4837 m.Return(one); in TEST()
4838 m.Call(); in TEST()
4848 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
4853 Node* acc = m.Int32Constant(0); in TEST()
4855 csts[i] = m.Int32Constant(static_cast<int32_t>(kBase + i)); in TEST()
4858 acc = m.Int32Add(acc, csts[i]); in TEST()
4862 m.StoreToPointer(&outputs[i], MachineRepresentation::kWord32, accs[i]); in TEST()
4864 m.Return(m.Int32Add(acc, m.Int32Add(m.Parameter(0), m.Parameter(1)))); in TEST()
4871 CHECK_EQ(expected, m.Call(*i, *j)); in TEST()
4883 RawMachineAssemblerTester<Object*> m(MachineType::Int32()); in TEST() local
4888 Node* true_node = m.HeapConstant(true_val); in TEST()
4889 Node* false_node = m.HeapConstant(false_val); in TEST()
4892 m.Branch(m.Parameter(0), &blocka, &blockb); in TEST()
4893 m.Bind(&blocka); in TEST()
4894 m.Goto(&end); in TEST()
4895 m.Bind(&blockb); in TEST()
4896 m.Goto(&end); in TEST()
4898 m.Bind(&end); in TEST()
4899 Node* phi = m.Phi(MachineRepresentation::kTagged, true_node, false_node); in TEST()
4900 m.Return(phi); in TEST()
4902 CHECK_EQ(*false_val, m.Call(0)); in TEST()
4903 CHECK_EQ(*true_val, m.Call(1)); in TEST()
4909 RawMachineAssemblerTester<int32_t> m; in TEST() local
4910 Int32BinopTester bt(&m); in TEST()
4911 Node* add = m.Int32AddWithOverflow(bt.param0, bt.param1); in TEST()
4912 Node* val = m.Projection(0, add); in TEST()
4913 Node* ovf = m.Projection(1, add); in TEST()
4914 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
4931 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
4932 Node* add = m.Int32AddWithOverflow(m.Int32Constant(*i), m.Parameter(0)); in TEST()
4933 Node* val = m.Projection(0, add); in TEST()
4934 Node* ovf = m.Projection(1, add); in TEST()
4935 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
4936 m.Return(ovf); in TEST()
4939 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
4944 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
4945 Node* add = m.Int32AddWithOverflow(m.Parameter(0), m.Int32Constant(*i)); in TEST()
4946 Node* val = m.Projection(0, add); in TEST()
4947 Node* ovf = m.Projection(1, add); in TEST()
4948 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
4949 m.Return(ovf); in TEST()
4952 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
4957 RawMachineAssemblerTester<int32_t> m; in TEST() local
4959 m.Int32AddWithOverflow(m.Int32Constant(*i), m.Int32Constant(*j)); in TEST()
4960 Node* val = m.Projection(0, add); in TEST()
4961 Node* ovf = m.Projection(1, add); in TEST()
4962 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
4963 m.Return(ovf); in TEST()
4965 CHECK_EQ(expected_ovf, m.Call()); in TEST()
4975 RawMachineAssemblerTester<int32_t> m; in TEST() local
4976 Int32BinopTester bt(&m); in TEST()
4977 Node* add = m.Int32AddWithOverflow(bt.param0, bt.param1); in TEST()
4978 Node* ovf = m.Projection(1, add); in TEST()
4979 m.Branch(ovf, &blocka, &blockb); in TEST()
4980 m.Bind(&blocka); in TEST()
4981 bt.AddReturn(m.Int32Constant(constant)); in TEST()
4982 m.Bind(&blockb); in TEST()
4983 Node* val = m.Projection(0, add); in TEST()
4997 RawMachineAssemblerTester<int32_t> m; in TEST() local
4998 Int32BinopTester bt(&m); in TEST()
4999 Node* add = m.Int32SubWithOverflow(bt.param0, bt.param1); in TEST()
5000 Node* val = m.Projection(0, add); in TEST()
5001 Node* ovf = m.Projection(1, add); in TEST()
5002 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
5019 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5020 Node* add = m.Int32SubWithOverflow(m.Int32Constant(*i), m.Parameter(0)); in TEST()
5021 Node* val = m.Projection(0, add); in TEST()
5022 Node* ovf = m.Projection(1, add); in TEST()
5023 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
5024 m.Return(ovf); in TEST()
5027 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
5032 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5033 Node* add = m.Int32SubWithOverflow(m.Parameter(0), m.Int32Constant(*i)); in TEST()
5034 Node* val = m.Projection(0, add); in TEST()
5035 Node* ovf = m.Projection(1, add); in TEST()
5036 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
5037 m.Return(ovf); in TEST()
5040 CHECK_EQ(expected_ovf, m.Call(*j)); in TEST()
5045 RawMachineAssemblerTester<int32_t> m; in TEST() local
5047 m.Int32SubWithOverflow(m.Int32Constant(*i), m.Int32Constant(*j)); in TEST()
5048 Node* val = m.Projection(0, add); in TEST()
5049 Node* ovf = m.Projection(1, add); in TEST()
5050 m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val); in TEST()
5051 m.Return(ovf); in TEST()
5053 CHECK_EQ(expected_ovf, m.Call()); in TEST()
5063 RawMachineAssemblerTester<int32_t> m; in TEST() local
5064 Int32BinopTester bt(&m); in TEST()
5065 Node* sub = m.Int32SubWithOverflow(bt.param0, bt.param1); in TEST()
5066 Node* ovf = m.Projection(1, sub); in TEST()
5067 m.Branch(ovf, &blocka, &blockb); in TEST()
5068 m.Bind(&blocka); in TEST()
5069 bt.AddReturn(m.Int32Constant(constant)); in TEST()
5070 m.Bind(&blockb); in TEST()
5071 Node* val = m.Projection(0, sub); in TEST()
5086 RawMachineAssemblerTester<int64_t> m; in TEST() local
5087 if (!m.machine()->Is64()) return; in TEST()
5088 Node* value = m.LoadFromPointer(&input, MachineType::Int64()); in TEST()
5089 m.Branch(m.Word64Equal(value, m.Int64Constant(0)), &blocka, &blockb); in TEST()
5090 m.Bind(&blocka); in TEST()
5091 m.Return(m.Int32Constant(1)); in TEST()
5092 m.Bind(&blockb); in TEST()
5093 m.Return(m.Int32Constant(2)); in TEST()
5095 CHECK_EQ(1, m.Call()); in TEST()
5097 CHECK_EQ(2, m.Call()); in TEST()
5099 CHECK_EQ(2, m.Call()); in TEST()
5106 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5107 m.StoreToPointer(&actual, MachineRepresentation::kWord64, in TEST()
5108 m.ChangeInt32ToInt64(m.Parameter(0))); in TEST()
5109 m.Return(m.Int32Constant(0)); in TEST()
5112 CHECK_EQ(0, m.Call(*i)); in TEST()
5121 RawMachineAssemblerTester<int32_t> m(MachineType::Uint32()); in TEST() local
5122 m.StoreToPointer(&actual, MachineRepresentation::kWord64, in TEST()
5123 m.ChangeUint32ToUint64(m.Parameter(0))); in TEST()
5124 m.Return(m.Int32Constant(0)); in TEST()
5127 CHECK_EQ(0, m.Call(*i)); in TEST()
5136 RawMachineAssemblerTester<int32_t> m; in TEST() local
5137 m.Return(m.TruncateInt64ToInt32( in TEST()
5138 m.LoadFromPointer(&expected, MachineType::Int64()))); in TEST()
5142 CHECK_EQ(static_cast<int32_t>(expected), m.Call()); in TEST()
5208 RawMachineAssemblerTester<int32_t> m; in TEST() local
5209 m.Return(m.TruncateFloat64ToInt32( in TEST()
5211 m.LoadFromPointer(&input, MachineType::Float64()))); in TEST()
5215 CHECK_EQ(static_cast<int>(expected), m.Call()); in TEST()
5221 BufferedRawMachineAssemblerTester<double> m(MachineType::Float32()); in TEST() local
5223 m.Return(m.ChangeFloat32ToFloat64(m.Parameter(0))); in TEST()
5225 FOR_FLOAT32_INPUTS(i) { CheckDoubleEq(static_cast<double>(*i), m.Call(*i)); } in TEST()
5231 BufferedRawMachineAssemblerTester<float> m; in TEST() local
5232 m.Return(m.Float32Constant(*i)); in TEST()
5233 CheckFloatEq(*i, m.Call()); in TEST()
5239 BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float64()); in TEST() local
5240 m.Return(m.Float64ExtractLowWord32(m.Parameter(0))); in TEST()
5243 CHECK_EQ(expected, m.Call(*i)); in TEST()
5249 BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float64()); in TEST() local
5250 m.Return(m.Float64ExtractHighWord32(m.Parameter(0))); in TEST()
5253 CHECK_EQ(expected, m.Call(*i)); in TEST()
5259 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
5261 m.Return(m.Float64InsertLowWord32(m.Parameter(0), m.Parameter(1))); in TEST()
5267 CheckDoubleEq(expected, m.Call(*i, *j)); in TEST()
5274 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64(), in TEST() local
5276 m.Return(m.Float64InsertHighWord32(m.Parameter(0), m.Parameter(1))); in TEST()
5282 CheckDoubleEq(bit_cast<double>(expected), m.Call(*i, *j)); in TEST()
5289 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
5290 m.Return(m.Float32Abs(m.Parameter(0))); in TEST()
5291 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(std::abs(*i), m.Call(*i)); } in TEST()
5296 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5297 m.Return(m.Float64Abs(m.Parameter(0))); in TEST()
5298 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(std::abs(*i), m.Call(*i)); } in TEST()
5401 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
5402 if (!m.machine()->Float32RoundDown().IsSupported()) return; in TEST()
5404 m.Return(m.Float32RoundDown(m.Parameter(0))); in TEST()
5406 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floorf(*i), m.Call(*i)); } in TEST()
5411 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5412 if (!m.machine()->Float64RoundDown().IsSupported()) return; in TEST()
5414 m.Return(m.Float64RoundDown(m.Parameter(0))); in TEST()
5416 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(floor(*i), m.Call(*i)); } in TEST()
5421 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5422 if (!m.machine()->Float64RoundDown().IsSupported()) return; in TEST()
5423 m.Return(m.Float64Sub(m.Float64Constant(-0.0), in TEST()
5424 m.Float64RoundDown(m.Float64Sub(m.Float64Constant(-0.0), in TEST()
5425 m.Parameter(0))))); in TEST()
5428 CHECK_EQ(ceil(kValues[i]), m.Call(kValues[i])); in TEST()
5434 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
5435 if (!m.machine()->Float32RoundUp().IsSupported()) return; in TEST()
5436 m.Return(m.Float32RoundUp(m.Parameter(0))); in TEST()
5438 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(ceilf(*i), m.Call(*i)); } in TEST()
5443 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5444 if (!m.machine()->Float64RoundUp().IsSupported()) return; in TEST()
5445 m.Return(m.Float64RoundUp(m.Parameter(0))); in TEST()
5447 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), m.Call(*i)); } in TEST()
5452 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
5453 if (!m.machine()->Float32RoundTiesEven().IsSupported()) return; in TEST()
5454 m.Return(m.Float32RoundTiesEven(m.Parameter(0))); in TEST()
5456 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(nearbyint(*i), m.Call(*i)); } in TEST()
5461 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5462 if (!m.machine()->Float64RoundTiesEven().IsSupported()) return; in TEST()
5463 m.Return(m.Float64RoundTiesEven(m.Parameter(0))); in TEST()
5465 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), m.Call(*i)); } in TEST()
5470 BufferedRawMachineAssemblerTester<float> m(MachineType::Float32()); in TEST() local
5471 if (!m.machine()->Float32RoundTruncate().IsSupported()) return; in TEST()
5473 m.Return(m.Float32RoundTruncate(m.Parameter(0))); in TEST()
5475 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(truncf(*i), m.Call(*i)); } in TEST()
5480 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5481 if (!m.machine()->Float64RoundTruncate().IsSupported()) return; in TEST()
5482 m.Return(m.Float64RoundTruncate(m.Parameter(0))); in TEST()
5484 CHECK_EQ(trunc(kValues[i]), m.Call(kValues[i])); in TEST()
5490 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); in TEST() local
5491 if (!m.machine()->Float64RoundTiesAway().IsSupported()) return; in TEST()
5492 m.Return(m.Float64RoundTiesAway(m.Parameter(0))); in TEST()
5494 CHECK_EQ(round(kValues[i]), m.Call(kValues[i])); in TEST()
5525 RawMachineAssemblerTester<int32_t> m; in TEST() local
5526 Node* function = m.LoadFromPointer(&foo0_ptr, MachineType::Pointer()); in TEST()
5527 m.Return(m.CallCFunction0(MachineType::Int32(), function)); in TEST()
5528 CHECK_EQ(kMagicFoo0, m.Call()); in TEST()
5534 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5535 Node* function = m.LoadFromPointer(&foo1_ptr, MachineType::Pointer()); in TEST()
5536 m.Return(m.CallCFunction1(MachineType::Int32(), MachineType::Int32(), in TEST()
5537 function, m.Parameter(0))); in TEST()
5540 CHECK_EQ(expected, m.Call(expected)); in TEST()
5547 RawMachineAssemblerTester<int32_t> m(MachineType::Int32(), in TEST() local
5549 Node* function = m.LoadFromPointer(&foo2_ptr, MachineType::Pointer()); in TEST()
5550 m.Return(m.CallCFunction2(MachineType::Int32(), MachineType::Int32(), in TEST()
5551 MachineType::Int32(), function, m.Parameter(0), in TEST()
5552 m.Parameter(1))); in TEST()
5557 CHECK_EQ(x - y, m.Call(x, y)); in TEST()
5565 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5566 Node* function = m.LoadFromPointer(&foo8_ptr, MachineType::Pointer()); in TEST()
5567 Node* param = m.Parameter(0); in TEST()
5568 m.Return(m.CallCFunction8( in TEST()
5575 CHECK_EQ(x * 8, m.Call(x)); in TEST()
5584 RawMachineAssemblerTester<int64_t> m(MachineType::Int32()); in TEST() local
5585 Node* base = m.PointerConstant(buffer); in TEST()
5586 Node* index = m.Parameter(0); in TEST()
5587 Node* length = m.Int32Constant(16); in TEST()
5588 Node* load = m.AddNode(m.machine()->CheckedLoad(MachineType::Int64()), base, in TEST()
5590 m.Return(load); in TEST()
5592 CHECK_EQ(buffer[0], m.Call(0)); in TEST()
5593 CHECK_EQ(buffer[1], m.Call(8)); in TEST()
5594 CHECK_EQ(0, m.Call(16)); in TEST()
5602 RawMachineAssemblerTester<int32_t> m(MachineType::Int32()); in TEST() local
5603 Node* base = m.PointerConstant(buffer); in TEST()
5604 Node* index = m.Parameter(0); in TEST()
5605 Node* length = m.Int32Constant(16); in TEST()
5606 Node* value = m.Int64Constant(write); in TEST()
5608 m.AddNode(m.machine()->CheckedStore(MachineRepresentation::kWord64), base, in TEST()
5611 m.Return(m.Int32Constant(11)); in TEST()
5613 CHECK_EQ(11, m.Call(16)); in TEST()
5617 CHECK_EQ(11, m.Call(0)); in TEST()
5621 CHECK_EQ(11, m.Call(8)); in TEST()
5630 RawMachineAssemblerTester<int32_t> m; in TEST() local
5631 m.StoreToPointer( in TEST()
5633 m.BitcastInt64ToFloat64(m.LoadFromPointer(&input, MachineType::Int64()))); in TEST()
5634 m.Return(m.Int32Constant(11)); in TEST()
5637 CHECK_EQ(11, m.Call()); in TEST()
5645 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64()); in TEST() local
5647 m.Return(m.BitcastFloat64ToInt64(m.Parameter(0))); in TEST()
5648 FOR_FLOAT64_INPUTS(i) { CHECK_EQ(bit_cast<int64_t>(*i), m.Call(*i)); } in TEST()
5653 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float32()); in TEST() local
5654 m.Return(m.TryTruncateFloat32ToInt64(m.Parameter(0))); in TEST()
5660 CHECK_EQ(static_cast<int64_t>(input), m.Call(input)); in TEST()
5668 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float32()); in TEST() local
5669 Node* trunc = m.TryTruncateFloat32ToInt64(m.Parameter(0)); in TEST()
5670 Node* val = m.Projection(0, trunc); in TEST()
5671 Node* check = m.Projection(1, trunc); in TEST()
5672 m.StoreToPointer(&success, MachineRepresentation::kWord64, check); in TEST()
5673 m.Return(val); in TEST()
5678 CHECK_EQ(static_cast<int64_t>(*i), m.Call(*i)); in TEST()
5681 m.Call(*i); in TEST()
5689 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64()); in TEST() local
5690 m.Return(m.TryTruncateFloat64ToInt64(m.Parameter(0))); in TEST()
5694 CHECK_EQ(static_cast<int64_t>(input), m.Call(input)); in TEST()
5701 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64()); in TEST() local
5702 Node* trunc = m.TryTruncateFloat64ToInt64(m.Parameter(0)); in TEST()
5703 Node* val = m.Projection(0, trunc); in TEST()
5704 Node* check = m.Projection(1, trunc); in TEST()
5705 m.StoreToPointer(&success, MachineRepresentation::kWord64, check); in TEST()
5706 m.Return(val); in TEST()
5712 CHECK_EQ(static_cast<int64_t>(*i), m.Call(*i)); in TEST()
5715 m.Call(*i); in TEST()
5723 BufferedRawMachineAssemblerTester<uint64_t> m(MachineType::Float32()); in TEST() local
5724 m.Return(m.TryTruncateFloat32ToUint64(m.Parameter(0))); in TEST()
5731 CHECK_EQ(static_cast<uint64_t>(input), m.Call(input)); in TEST()
5739 BufferedRawMachineAssemblerTester<uint64_t> m(MachineType::Float32()); in TEST() local
5740 Node* trunc = m.TryTruncateFloat32ToUint64(m.Parameter(0)); in TEST()
5741 Node* val = m.Projection(0, trunc); in TEST()
5742 Node* check = m.Projection(1, trunc); in TEST()
5743 m.StoreToPointer(&success, MachineRepresentation::kWord64, check); in TEST()
5744 m.Return(val); in TEST()
5749 CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i)); in TEST()
5752 m.Call(*i); in TEST()
5760 BufferedRawMachineAssemblerTester<uint64_t> m(MachineType::Float64()); in TEST() local
5761 m.Return(m.TruncateFloat64ToUint64(m.Parameter(0))); in TEST()
5767 CHECK_EQ(static_cast<uint64_t>(input), m.Call(input)); in TEST()
5775 BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64()); in TEST() local
5776 Node* trunc = m.TryTruncateFloat64ToUint64(m.Parameter(0)); in TEST()
5777 Node* val = m.Projection(0, trunc); in TEST()
5778 Node* check = m.Projection(1, trunc); in TEST()
5779 m.StoreToPointer(&success, MachineRepresentation::kWord64, check); in TEST()
5780 m.Return(val); in TEST()
5785 CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i)); in TEST()
5788 m.Call(*i); in TEST()
5796 BufferedRawMachineAssemblerTester<float> m(MachineType::Int64()); in TEST() local
5797 m.Return(m.RoundInt64ToFloat32(m.Parameter(0))); in TEST()
5798 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<float>(*i), m.Call(*i)); } in TEST()
5803 BufferedRawMachineAssemblerTester<double> m(MachineType::Int64()); in TEST() local
5804 m.Return(m.RoundInt64ToFloat64(m.Parameter(0))); in TEST()
5805 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<double>(*i), m.Call(*i)); } in TEST()
5889 BufferedRawMachineAssemblerTester<double> m(MachineType::Uint64()); in TEST() local
5890 m.Return(m.RoundUint64ToFloat64(m.Parameter(0))); in TEST()
5893 CHECK_EQ(bit_cast<double>(values[i].expected), m.Call(values[i].input)); in TEST()
5979 BufferedRawMachineAssemblerTester<float> m(MachineType::Uint64()); in TEST() local
5980 m.Return(m.RoundUint64ToFloat32(m.Parameter(0))); in TEST()
5983 CHECK_EQ(bit_cast<float>(values[i].expected), m.Call(values[i].input)); in TEST()
5993 RawMachineAssemblerTester<int32_t> m; in TEST() local
5994 m.Return(m.BitcastFloat32ToInt32( in TEST()
5995 m.LoadFromPointer(&input, MachineType::Float32()))); in TEST()
5999 CHECK_EQ(expected, m.Call()); in TEST()
6007 RawMachineAssemblerTester<int32_t> m; in TEST() local
6008 m.StoreToPointer( in TEST()
6010 m.BitcastInt32ToFloat32(m.LoadFromPointer(&input, MachineType::Int32()))); in TEST()
6011 m.Return(m.Int32Constant(11)); in TEST()
6014 CHECK_EQ(11, m.Call()); in TEST()