Lines Matching refs:R
224 ReducerTester R; in TEST() local
225 R.binop = R.machine.Word32And(); in TEST()
230 R.CheckFoldBinop<int32_t>(x & y, x, y); in TEST()
234 R.CheckPutConstantOnRight(33); in TEST()
235 R.CheckPutConstantOnRight(44000); in TEST()
237 Node* x = R.Parameter(); in TEST()
238 Node* zero = R.Constant<int32_t>(0); in TEST()
239 Node* minus_1 = R.Constant<int32_t>(-1); in TEST()
241 R.CheckBinop(zero, x, zero); // x & 0 => 0 in TEST()
242 R.CheckBinop(zero, zero, x); // 0 & x => 0 in TEST()
243 R.CheckBinop(x, x, minus_1); // x & -1 => 0 in TEST()
244 R.CheckBinop(x, minus_1, x); // -1 & x => 0 in TEST()
245 R.CheckBinop(x, x, x); // x & x => x in TEST()
250 ReducerTester R; in TEST() local
251 R.binop = R.machine.Word32Or(); in TEST()
256 R.CheckFoldBinop<int32_t>(x | y, x, y); in TEST()
260 R.CheckPutConstantOnRight(36); in TEST()
261 R.CheckPutConstantOnRight(44001); in TEST()
263 Node* x = R.Parameter(); in TEST()
264 Node* zero = R.Constant<int32_t>(0); in TEST()
265 Node* minus_1 = R.Constant<int32_t>(-1); in TEST()
267 R.CheckBinop(x, x, zero); // x & 0 => x in TEST()
268 R.CheckBinop(x, zero, x); // 0 & x => x in TEST()
269 R.CheckBinop(minus_1, x, minus_1); // x & -1 => -1 in TEST()
270 R.CheckBinop(minus_1, minus_1, x); // -1 & x => -1 in TEST()
271 R.CheckBinop(x, x, x); // x & x => x in TEST()
276 ReducerTester R; in TEST() local
277 R.binop = R.machine.Word32Xor(); in TEST()
282 R.CheckFoldBinop<int32_t>(x ^ y, x, y); in TEST()
286 R.CheckPutConstantOnRight(39); in TEST()
287 R.CheckPutConstantOnRight(4403); in TEST()
289 Node* x = R.Parameter(); in TEST()
290 Node* zero = R.Constant<int32_t>(0); in TEST()
292 R.CheckBinop(x, x, zero); // x ^ 0 => x in TEST()
293 R.CheckBinop(x, zero, x); // 0 ^ x => x in TEST()
294 R.CheckFoldBinop<int32_t>(0, x, x); // x ^ x => 0 in TEST()
299 ReducerTester R; in TEST() local
300 R.binop = R.machine.Word32Shl(); in TEST()
306 R.CheckFoldBinop<int32_t>(x << y, x, y); in TEST()
310 R.CheckDontPutConstantOnRight(44); in TEST()
312 Node* x = R.Parameter(); in TEST()
313 Node* zero = R.Constant<int32_t>(0); in TEST()
315 R.CheckBinop(x, x, zero); // x << 0 => x in TEST()
320 ReducerTester R; in TEST() local
321 R.binop = R.machine.Word32Shr(); in TEST()
327 R.CheckFoldBinop<int32_t>(x >> y, x, y); in TEST()
331 R.CheckDontPutConstantOnRight(44); in TEST()
333 Node* x = R.Parameter(); in TEST()
334 Node* zero = R.Constant<int32_t>(0); in TEST()
336 R.CheckBinop(x, x, zero); // x >>> 0 => x in TEST()
341 ReducerTester R; in TEST() local
342 R.binop = R.machine.Word32Sar(); in TEST()
348 R.CheckFoldBinop<int32_t>(x >> y, x, y); in TEST()
352 R.CheckDontPutConstantOnRight(44); in TEST()
354 Node* x = R.Parameter(); in TEST()
355 Node* zero = R.Constant<int32_t>(0); in TEST()
357 R.CheckBinop(x, x, zero); // x >> 0 => x in TEST()
361 static void CheckJsShift(ReducerTester* R) { in CheckJsShift() argument
362 CHECK(R->machine.Word32ShiftIsSafe()); in CheckJsShift()
364 Node* x = R->Parameter(0); in CheckJsShift()
365 Node* y = R->Parameter(1); in CheckJsShift()
366 Node* thirty_one = R->Constant<int32_t>(0x1f); in CheckJsShift()
368 R->graph.NewNode(R->machine.Word32And(), y, thirty_one); in CheckJsShift()
372 R->CheckFoldBinop(x, y, x, y_and_thirty_one); in CheckJsShift()
377 ReducerTester R(0, MachineOperatorBuilder::kWord32ShiftIsSafe); in TEST() local
379 R.binop = R.machine.Word32Shl(); in TEST()
380 CheckJsShift(&R); in TEST()
382 R.binop = R.machine.Word32Shr(); in TEST()
383 CheckJsShift(&R); in TEST()
385 R.binop = R.machine.Word32Sar(); in TEST()
386 CheckJsShift(&R); in TEST()
391 ReducerTester R; in TEST() local
392 R.binop = R.machine.Word32Equal(); in TEST()
397 R.CheckFoldBinop<int32_t>(x == y ? 1 : 0, x, y); in TEST()
401 R.CheckPutConstantOnRight(48); in TEST()
402 R.CheckPutConstantOnRight(-48); in TEST()
404 Node* x = R.Parameter(0); in TEST()
405 Node* y = R.Parameter(1); in TEST()
406 Node* zero = R.Constant<int32_t>(0); in TEST()
407 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
409 R.CheckFoldBinop<int32_t>(1, x, x); // x == x => 1 in TEST()
410 R.CheckFoldBinop(x, y, sub, zero); // x - y == 0 => x == y in TEST()
411 R.CheckFoldBinop(x, y, zero, sub); // 0 == x - y => x == y in TEST()
416 ReducerTester R; in TEST() local
417 R.binop = R.machine.Int32Add(); in TEST()
422 R.CheckFoldBinop<int32_t>(x + y, x, y); // TODO(titzer): signed overflow in TEST()
426 R.CheckPutConstantOnRight(41); in TEST()
427 R.CheckPutConstantOnRight(4407); in TEST()
429 Node* x = R.Parameter(); in TEST()
430 Node* zero = R.Constant<int32_t>(0); in TEST()
432 R.CheckBinop(x, x, zero); // x + 0 => x in TEST()
433 R.CheckBinop(x, zero, x); // 0 + x => x in TEST()
438 ReducerTester R; in TEST() local
439 R.binop = R.machine.Int32Sub(); in TEST()
444 R.CheckFoldBinop<int32_t>(x - y, x, y); in TEST()
448 R.CheckDontPutConstantOnRight(412); in TEST()
450 Node* x = R.Parameter(); in TEST()
451 Node* zero = R.Constant<int32_t>(0); in TEST()
453 R.CheckBinop(x, x, zero); // x - 0 => x in TEST()
458 ReducerTester R; in TEST() local
459 R.binop = R.machine.Int32Mul(); in TEST()
464 R.CheckFoldBinop<int32_t>(x * y, x, y); // TODO(titzer): signed overflow in TEST()
468 R.CheckPutConstantOnRight(4111); in TEST()
469 R.CheckPutConstantOnRight(-4407); in TEST()
471 Node* x = R.Parameter(); in TEST()
472 Node* zero = R.Constant<int32_t>(0); in TEST()
473 Node* one = R.Constant<int32_t>(1); in TEST()
474 Node* minus_one = R.Constant<int32_t>(-1); in TEST()
476 R.CheckBinop(zero, x, zero); // x * 0 => 0 in TEST()
477 R.CheckBinop(zero, zero, x); // 0 * x => 0 in TEST()
478 R.CheckBinop(x, x, one); // x * 1 => x in TEST()
479 R.CheckBinop(x, one, x); // 1 * x => x in TEST()
480 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, minus_one, in TEST()
482 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, x, in TEST()
486 Node* multiplier = R.Constant<int32_t>(1 << n); in TEST()
487 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shl(), n, x, in TEST()
489 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shl(), n, multiplier, in TEST()
496 ReducerTester R; in TEST() local
497 R.binop = R.machine.Int32Div(); in TEST()
504 R.CheckFoldBinop<int32_t>(r, x, y); in TEST()
508 R.CheckDontPutConstantOnRight(41111); in TEST()
509 R.CheckDontPutConstantOnRight(-44071); in TEST()
511 Node* x = R.Parameter(); in TEST()
512 Node* one = R.Constant<int32_t>(1); in TEST()
513 Node* minus_one = R.Constant<int32_t>(-1); in TEST()
515 R.CheckBinop(x, x, one); // x / 1 => x in TEST()
518 R.CheckFoldBinop<int32_t>(0, R.machine.Int32Sub(), x, x, in TEST()
524 ReducerTester R; in TEST() local
525 R.binop = R.machine.Uint32Div(); in TEST()
531 R.CheckFoldBinop<int32_t>(x / y, x, y); in TEST()
535 R.CheckDontPutConstantOnRight(41311); in TEST()
536 R.CheckDontPutConstantOnRight(-44371); in TEST()
538 Node* x = R.Parameter(); in TEST()
539 Node* one = R.Constant<int32_t>(1); in TEST()
541 R.CheckBinop(x, x, one); // x / 1 => x in TEST()
545 Node* divisor = R.Constant<int32_t>(1u << n); in TEST()
546 R.CheckFoldBinop<int32_t>(x, R.machine.Word32Shr(), n, x, in TEST()
553 ReducerTester R; in TEST() local
554 R.binop = R.machine.Int32Mod(); in TEST()
561 R.CheckFoldBinop<int32_t>(r, x, y); in TEST()
565 R.CheckDontPutConstantOnRight(413); in TEST()
566 R.CheckDontPutConstantOnRight(-4401); in TEST()
568 Node* x = R.Parameter(); in TEST()
569 Node* one = R.Constant<int32_t>(1); in TEST()
571 R.CheckFoldBinop<int32_t>(0, x, one); // x % 1 => 0 in TEST()
577 ReducerTester R; in TEST() local
578 R.binop = R.machine.Uint32Mod(); in TEST()
584 R.CheckFoldBinop<int32_t>(x % y, x, y); in TEST()
588 R.CheckDontPutConstantOnRight(417); in TEST()
589 R.CheckDontPutConstantOnRight(-4371); in TEST()
591 Node* x = R.Parameter(); in TEST()
592 Node* one = R.Constant<int32_t>(1); in TEST()
594 R.CheckFoldBinop<int32_t>(0, x, one); // x % 1 => 0 in TEST()
597 Node* divisor = R.Constant<int32_t>(1u << n); in TEST()
598 R.CheckFoldBinop<int32_t>(x, R.machine.Word32And(), (1u << n) - 1, x, in TEST()
605 ReducerTester R; in TEST() local
606 R.binop = R.machine.Int32LessThan(); in TEST()
611 R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); in TEST()
615 R.CheckDontPutConstantOnRight(41399); in TEST()
616 R.CheckDontPutConstantOnRight(-440197); in TEST()
618 Node* x = R.Parameter(0); in TEST()
619 Node* y = R.Parameter(1); in TEST()
620 Node* zero = R.Constant<int32_t>(0); in TEST()
621 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
623 R.CheckFoldBinop<int32_t>(0, x, x); // x < x => 0 in TEST()
624 R.CheckFoldBinop(x, y, sub, zero); // x - y < 0 => x < y in TEST()
625 R.CheckFoldBinop(y, x, zero, sub); // 0 < x - y => y < x in TEST()
630 ReducerTester R; in TEST() local
631 R.binop = R.machine.Int32LessThanOrEqual(); in TEST()
636 R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); in TEST()
640 FOR_INT32_INPUTS(i) { R.CheckDontPutConstantOnRight<int32_t>(*i); } in TEST()
642 Node* x = R.Parameter(0); in TEST()
643 Node* y = R.Parameter(1); in TEST()
644 Node* zero = R.Constant<int32_t>(0); in TEST()
645 Node* sub = R.graph.NewNode(R.machine.Int32Sub(), x, y); in TEST()
647 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1 in TEST()
648 R.CheckFoldBinop(x, y, sub, zero); // x - y <= 0 => x <= y in TEST()
649 R.CheckFoldBinop(y, x, zero, sub); // 0 <= x - y => y <= x in TEST()
654 ReducerTester R; in TEST() local
655 R.binop = R.machine.Uint32LessThan(); in TEST()
660 R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); in TEST()
664 R.CheckDontPutConstantOnRight(41399); in TEST()
665 R.CheckDontPutConstantOnRight(-440197); in TEST()
667 Node* x = R.Parameter(); in TEST()
668 Node* max = R.maxuint32; in TEST()
669 Node* zero = R.Constant<int32_t>(0); in TEST()
671 R.CheckFoldBinop<int32_t>(0, max, x); // M < x => 0 in TEST()
672 R.CheckFoldBinop<int32_t>(0, x, zero); // x < 0 => 0 in TEST()
673 R.CheckFoldBinop<int32_t>(0, x, x); // x < x => 0 in TEST()
678 ReducerTester R; in TEST() local
679 R.binop = R.machine.Uint32LessThanOrEqual(); in TEST()
684 R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); in TEST()
688 R.CheckDontPutConstantOnRight(41399); in TEST()
689 R.CheckDontPutConstantOnRight(-440197); in TEST()
691 Node* x = R.Parameter(); in TEST()
692 Node* max = R.maxuint32; in TEST()
693 Node* zero = R.Constant<int32_t>(0); in TEST()
695 R.CheckFoldBinop<int32_t>(1, x, max); // x <= M => 1 in TEST()
696 R.CheckFoldBinop<int32_t>(1, zero, x); // 0 <= x => 1 in TEST()
697 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1 in TEST()
702 ReducerTester R; in TEST() local
704 Node* base = R.Constant<int32_t>(11); in TEST()
705 Node* index = R.Constant<int32_t>(4); in TEST()
706 Node* load = R.graph.NewNode(R.machine.Load(MachineType::Int32()), base, in TEST()
707 index, R.graph.start(), R.graph.start()); in TEST()
710 MachineOperatorReducer reducer(&R.jsgraph); in TEST()
717 R.graph.NewNode(R.machine.Store(StoreRepresentation( in TEST()
719 base, index, load, load, R.graph.start()); in TEST()
720 MachineOperatorReducer reducer(&R.jsgraph); in TEST()