Lines Matching refs:R
209 ReducerTester R; in TEST() local
210 R.binop = R.machine.Word32And(); in TEST()
215 R.CheckFoldBinop<int32_t>(x & y, x, y); in TEST()
219 R.CheckPutConstantOnRight(33); in TEST()
220 R.CheckPutConstantOnRight(44000); in TEST()
222 Node* x = R.Parameter(); in TEST()
223 Node* zero = R.Constant<int32_t>(0); in TEST()
224 Node* minus_1 = R.Constant<int32_t>(-1); in TEST()
226 R.CheckBinop(zero, x, zero); // x & 0 => 0 in TEST()
227 R.CheckBinop(zero, zero, x); // 0 & x => 0 in TEST()
228 R.CheckBinop(x, x, minus_1); // x & -1 => 0 in TEST()
229 R.CheckBinop(x, minus_1, x); // -1 & x => 0 in TEST()
230 R.CheckBinop(x, x, x); // x & x => x in TEST()
235 ReducerTester R; in TEST() local
236 R.binop = R.machine.Word32Or(); in TEST()
241 R.CheckFoldBinop<int32_t>(x | y, x, y); in TEST()
245 R.CheckPutConstantOnRight(36); in TEST()
246 R.CheckPutConstantOnRight(44001); in TEST()
248 Node* x = R.Parameter(); in TEST()
249 Node* zero = R.Constant<int32_t>(0); in TEST()
250 Node* minus_1 = R.Constant<int32_t>(-1); in TEST()
252 R.CheckBinop(x, x, zero); // x & 0 => x in TEST()
253 R.CheckBinop(x, zero, x); // 0 & x => x in TEST()
254 R.CheckBinop(minus_1, x, minus_1); // x & -1 => -1 in TEST()
255 R.CheckBinop(minus_1, minus_1, x); // -1 & x => -1 in TEST()
256 R.CheckBinop(x, x, x); // x & x => x in TEST()
261 ReducerTester R; in TEST() local
262 R.binop = R.machine.Word32Xor(); in TEST()
267 R.CheckFoldBinop<int32_t>(x ^ y, x, y); in TEST()
271 R.CheckPutConstantOnRight(39); in TEST()
272 R.CheckPutConstantOnRight(4403); in TEST()
274 Node* x = R.Parameter(); in TEST()
275 Node* zero = R.Constant<int32_t>(0); in TEST()
277 R.CheckBinop(x, x, zero); // x ^ 0 => x in TEST()
278 R.CheckBinop(x, zero, x); // 0 ^ x => x in TEST()
279 R.CheckFoldBinop<int32_t>(0, x, x); // x ^ x => 0 in TEST()
284 ReducerTester R; in TEST() local
285 R.binop = R.machine.Word32Shl(); in TEST()
291 R.CheckFoldBinop<int32_t>(x << y, x, y); in TEST()
295 R.CheckDontPutConstantOnRight(44); in TEST()
297 Node* x = R.Parameter(); in TEST()
298 Node* zero = R.Constant<int32_t>(0); in TEST()
300 R.CheckBinop(x, x, zero); // x << 0 => x in TEST()
305 ReducerTester R; in TEST() local
306 R.binop = R.machine.Word32Shr(); in TEST()
312 R.CheckFoldBinop<int32_t>(x >> y, x, y); in TEST()
316 R.CheckDontPutConstantOnRight(44); in TEST()
318 Node* x = R.Parameter(); in TEST()
319 Node* zero = R.Constant<int32_t>(0); in TEST()
321 R.CheckBinop(x, x, zero); // x >>> 0 => x in TEST()
326 ReducerTester R; in TEST() local
327 R.binop = R.machine.Word32Sar(); in TEST()
333 R.CheckFoldBinop<int32_t>(x >> y, x, y); in TEST()
337 R.CheckDontPutConstantOnRight(44); in TEST()
339 Node* x = R.Parameter(); in TEST()
340 Node* zero = R.Constant<int32_t>(0); in TEST()
342 R.CheckBinop(x, x, zero); // x >> 0 => x in TEST()
347 ReducerTester R; in TEST() local
348 R.binop = R.machine.Word32Equal(); in TEST()
353 R.CheckFoldBinop<int32_t>(x == y ? 1 : 0, x, y); in TEST()
357 R.CheckPutConstantOnRight(48); in TEST()
358 R.CheckPutConstantOnRight(-48); in TEST()
360 Node* x = R.Parameter(0); in TEST()
361 Node* y = R.Parameter(1); in TEST()
362 Node* zero = R.Constant<int32_t>(0); in TEST()
363 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
365 R.CheckFoldBinop<int32_t>(1, x, x); // x == x => 1 in TEST()
366 R.CheckFoldBinop(x, y, sub, zero); // x - y == 0 => x == y in TEST()
367 R.CheckFoldBinop(x, y, zero, sub); // 0 == x - y => x == y in TEST()
372 ReducerTester R; in TEST() local
373 R.binop = R.machine.Int32Add(); in TEST()
378 R.CheckFoldBinop<int32_t>(x + y, x, y); // TODO(titzer): signed overflow in TEST()
382 R.CheckPutConstantOnRight(41); in TEST()
383 R.CheckPutConstantOnRight(4407); in TEST()
385 Node* x = R.Parameter(); in TEST()
386 Node* zero = R.Constant<int32_t>(0); in TEST()
388 R.CheckBinop(x, x, zero); // x + 0 => x in TEST()
389 R.CheckBinop(x, zero, x); // 0 + x => x in TEST()
394 ReducerTester R; in TEST() local
395 R.binop = R.machine.Int32Sub(); in TEST()
400 R.CheckFoldBinop<int32_t>(x - y, x, y); in TEST()
404 R.CheckDontPutConstantOnRight(412); in TEST()
406 Node* x = R.Parameter(); in TEST()
407 Node* zero = R.Constant<int32_t>(0); in TEST()
409 R.CheckBinop(x, x, zero); // x - 0 => x in TEST()
414 ReducerTester R; in TEST() local
415 R.binop = R.machine.Int32Mul(); in TEST()
420 R.CheckFoldBinop<int32_t>(x * y, x, y); // TODO(titzer): signed overflow in TEST()
424 R.CheckPutConstantOnRight(4111); in TEST()
425 R.CheckPutConstantOnRight(-4407); in TEST()
427 Node* x = R.Parameter(); in TEST()
428 Node* zero = R.Constant<int32_t>(0); in TEST()
429 Node* one = R.Constant<int32_t>(1); in TEST()
430 Node* minus_one = R.Constant<int32_t>(-1); in TEST()
432 R.CheckBinop(zero, x, zero); // x * 0 => 0 in TEST()
433 R.CheckBinop(zero, zero, x); // 0 * x => 0 in TEST()
434 R.CheckBinop(x, x, one); // x * 1 => x in TEST()
435 R.CheckBinop(x, one, x); // 1 * x => x in TEST()
436 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, minus_one, in TEST()
438 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, x, in TEST()
442 Node* multiplier = R.Constant<int32_t>(1 << n); in TEST()
443 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shl(), n, x, in TEST()
445 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shl(), n, multiplier, in TEST()
452 ReducerTester R; in TEST() local
453 R.binop = R.machine.Int32Div(); in TEST()
460 R.CheckFoldBinop<int32_t>(r, x, y); in TEST()
464 R.CheckDontPutConstantOnRight(41111); in TEST()
465 R.CheckDontPutConstantOnRight(-44071); in TEST()
467 Node* x = R.Parameter(); in TEST()
468 Node* one = R.Constant<int32_t>(1); in TEST()
469 Node* minus_one = R.Constant<int32_t>(-1); in TEST()
471 R.CheckBinop(x, x, one); // x / 1 => x in TEST()
474 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, x, in TEST()
480 ReducerTester R; in TEST() local
481 R.binop = R.machine.Int32UDiv(); in TEST()
487 R.CheckFoldBinop<int32_t>(x / y, x, y); in TEST()
491 R.CheckDontPutConstantOnRight(41311); in TEST()
492 R.CheckDontPutConstantOnRight(-44371); in TEST()
494 Node* x = R.Parameter(); in TEST()
495 Node* one = R.Constant<int32_t>(1); in TEST()
497 R.CheckBinop(x, x, one); // x / 1 => x in TEST()
501 Node* divisor = R.Constant<int32_t>(1u << n); in TEST()
502 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shr(), n, x, in TEST()
509 ReducerTester R; in TEST() local
510 R.binop = R.machine.Int32Mod(); in TEST()
517 R.CheckFoldBinop<int32_t>(r, x, y); in TEST()
521 R.CheckDontPutConstantOnRight(413); in TEST()
522 R.CheckDontPutConstantOnRight(-4401); in TEST()
524 Node* x = R.Parameter(); in TEST()
525 Node* one = R.Constant<int32_t>(1); in TEST()
527 R.CheckFoldBinop<int32_t>(0, x, one); // x % 1 => 0 in TEST()
533 ReducerTester R; in TEST() local
534 R.binop = R.machine.Int32UMod(); in TEST()
540 R.CheckFoldBinop<int32_t>(x % y, x, y); in TEST()
544 R.CheckDontPutConstantOnRight(417); in TEST()
545 R.CheckDontPutConstantOnRight(-4371); in TEST()
547 Node* x = R.Parameter(); in TEST()
548 Node* one = R.Constant<int32_t>(1); in TEST()
550 R.CheckFoldBinop<int32_t>(0, x, one); // x % 1 => 0 in TEST()
553 Node* divisor = R.Constant<int32_t>(1u << n); in TEST()
554 R.CheckFoldBinop<int32_t>(x, R.machine.Word32And(), (1u << n) - 1, x, in TEST()
561 ReducerTester R; in TEST() local
562 R.binop = R.machine.Int32LessThan(); in TEST()
567 R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); in TEST()
571 R.CheckDontPutConstantOnRight(41399); in TEST()
572 R.CheckDontPutConstantOnRight(-440197); in TEST()
574 Node* x = R.Parameter(0); in TEST()
575 Node* y = R.Parameter(1); in TEST()
576 Node* zero = R.Constant<int32_t>(0); in TEST()
577 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
579 R.CheckFoldBinop<int32_t>(0, x, x); // x < x => 0 in TEST()
580 R.CheckFoldBinop(x, y, sub, zero); // x - y < 0 => x < y in TEST()
581 R.CheckFoldBinop(y, x, zero, sub); // 0 < x - y => y < x in TEST()
586 ReducerTester R; in TEST() local
587 R.binop = R.machine.Int32LessThanOrEqual(); in TEST()
592 R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); in TEST()
596 FOR_INT32_INPUTS(i) { R.CheckDontPutConstantOnRight<int32_t>(*i); } in TEST()
598 Node* x = R.Parameter(0); in TEST()
599 Node* y = R.Parameter(1); in TEST()
600 Node* zero = R.Constant<int32_t>(0); in TEST()
601 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
603 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1 in TEST()
604 R.CheckFoldBinop(x, y, sub, zero); // x - y <= 0 => x <= y in TEST()
605 R.CheckFoldBinop(y, x, zero, sub); // 0 <= x - y => y <= x in TEST()
610 ReducerTester R; in TEST() local
611 R.binop = R.machine.Uint32LessThan(); in TEST()
616 R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); in TEST()
620 R.CheckDontPutConstantOnRight(41399); in TEST()
621 R.CheckDontPutConstantOnRight(-440197); in TEST()
623 Node* x = R.Parameter(); in TEST()
624 Node* max = R.maxuint32; in TEST()
625 Node* zero = R.Constant<int32_t>(0); in TEST()
627 R.CheckFoldBinop<int32_t>(0, max, x); // M < x => 0 in TEST()
628 R.CheckFoldBinop<int32_t>(0, x, zero); // x < 0 => 0 in TEST()
629 R.CheckFoldBinop<int32_t>(0, x, x); // x < x => 0 in TEST()
634 ReducerTester R; in TEST() local
635 R.binop = R.machine.Uint32LessThanOrEqual(); in TEST()
640 R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); in TEST()
644 R.CheckDontPutConstantOnRight(41399); in TEST()
645 R.CheckDontPutConstantOnRight(-440197); in TEST()
647 Node* x = R.Parameter(); in TEST()
648 Node* max = R.maxuint32; in TEST()
649 Node* zero = R.Constant<int32_t>(0); in TEST()
651 R.CheckFoldBinop<int32_t>(1, x, max); // x <= M => 1 in TEST()
652 R.CheckFoldBinop<int32_t>(1, zero, x); // 0 <= x => 1 in TEST()
653 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1 in TEST()
658 ReducerTester R; in TEST() local
660 Node* base = R.Constant<int32_t>(11); in TEST()
661 Node* index = R.Constant<int32_t>(4); in TEST()
662 Node* load = R.graph.NewNode(R.machine.Load(kMachInt32), base, index); in TEST()
665 MachineOperatorReducer reducer(&R.jsgraph); in TEST()
671 Node* store = R.graph.NewNode( in TEST()
672 R.machine.Store(StoreRepresentation(kMachInt32, kNoWriteBarrier)), base, in TEST()
674 MachineOperatorReducer reducer(&R.jsgraph); in TEST()
681 static void CheckNans(ReducerTester* R) { in CheckNans() argument
682 Node* x = R->Parameter(); in CheckNans()
688 Node* nan1 = R->Constant<double>(*pl); in CheckNans()
689 Node* nan2 = R->Constant<double>(*pr); in CheckNans()
690 R->CheckBinop(nan1, x, nan1); // x % NaN => NaN in CheckNans()
691 R->CheckBinop(nan1, nan1, x); // NaN % x => NaN in CheckNans()
692 R->CheckBinop(nan1, nan2, nan1); // NaN % NaN => NaN in CheckNans()
699 ReducerTester R; in TEST() local
700 R.binop = R.machine.Float64Add(); in TEST()
705 R.CheckFoldBinop<double>(x + y, x, y); in TEST()
709 FOR_FLOAT64_INPUTS(i) { R.CheckPutConstantOnRight(*i); } in TEST()
715 ReducerTester R; in TEST() local
716 R.binop = R.machine.Float64Sub(); in TEST()
721 R.CheckFoldBinop<double>(x - y, x, y); in TEST()
729 ReducerTester R; in TEST() local
730 R.binop = R.machine.Float64Mul(); in TEST()
735 R.CheckFoldBinop<double>(x * y, x, y); in TEST()
740 R.CheckPutConstantOnRight(-inf); in TEST()
741 R.CheckPutConstantOnRight(-0.1); in TEST()
742 R.CheckPutConstantOnRight(0.1); in TEST()
743 R.CheckPutConstantOnRight(inf); in TEST()
745 Node* x = R.Parameter(); in TEST()
746 Node* one = R.Constant<double>(1.0); in TEST()
748 R.CheckBinop(x, x, one); // x * 1.0 => x in TEST()
749 R.CheckBinop(x, one, x); // 1.0 * x => x in TEST()
751 CheckNans(&R); in TEST()
756 ReducerTester R; in TEST() local
757 R.binop = R.machine.Float64Div(); in TEST()
762 R.CheckFoldBinop<double>(x / y, x, y); in TEST()
766 Node* x = R.Parameter(); in TEST()
767 Node* one = R.Constant<double>(1.0); in TEST()
769 R.CheckBinop(x, x, one); // x / 1.0 => x in TEST()
771 CheckNans(&R); in TEST()
776 ReducerTester R; in TEST() local
777 R.binop = R.machine.Float64Mod(); in TEST()
782 R.CheckFoldBinop<double>(modulo(x, y), x, y); in TEST()
786 CheckNans(&R); in TEST()