Lines Matching refs:right
140 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x in Reduce()
142 return ReplaceInt32(m.left().Value() ^ m.right().Value()); in Reduce()
145 if (m.left().IsWord32Xor() && m.right().Is(-1)) { in Reduce()
147 if (mleft.right().Is(-1)) { // (x ^ -1) ^ -1 => x in Reduce()
157 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in Reduce()
159 return ReplaceInt32(m.left().Value() >> m.right().Value()); in Reduce()
167 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x in Reduce()
170 base::bits::RotateRight32(m.left().Value(), m.right().Value())); in Reduce()
177 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
179 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
182 node->ReplaceInput(1, msub.right().node()); in Reduce()
192 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
194 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
197 node->ReplaceInput(1, msub.right().node()); in Reduce()
210 if (m.right().Is(0)) return Replace(m.right().node()); // x * 0 => 0 in Reduce()
211 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x in Reduce()
213 return ReplaceInt32(m.left().Value() * m.right().Value()); in Reduce()
215 if (m.right().Is(-1)) { // x * -1 => 0 - x in Reduce()
221 if (m.right().IsPowerOf2()) { // x * 2^n => x << n in Reduce()
222 node->ReplaceInput(1, Int32Constant(WhichPowerOf2(m.right().Value()))); in Reduce()
240 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
242 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y < 0 => x < y in Reduce()
245 node->ReplaceInput(1, msub.right().node()); in Reduce()
248 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 < x - y => y < x in Reduce()
249 Int32BinopMatcher msub(m.right().node()); in Reduce()
250 node->ReplaceInput(0, msub.right().node()); in Reduce()
260 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
262 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y <= 0 => x <= y in Reduce()
265 node->ReplaceInput(1, msub.right().node()); in Reduce()
268 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 <= x - y => y <= x in Reduce()
269 Int32BinopMatcher msub(m.right().node()); in Reduce()
270 node->ReplaceInput(0, msub.right().node()); in Reduce()
280 if (m.right().Is(0)) return ReplaceBool(false); // x < 0 => false in Reduce()
282 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
285 if (m.left().IsWord32Sar() && m.right().HasValue()) { in Reduce()
287 if (mleft.right().HasValue()) { in Reduce()
290 const uint32_t c = m.right().Value(); in Reduce()
291 const uint32_t k = mleft.right().Value() & 0x1f; in Reduce()
305 if (m.right().Is(kMaxUInt32)) return ReplaceBool(true); // x <= M => true in Reduce()
307 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
314 if (m.right().IsNaN()) { // x + NaN => NaN in Reduce()
315 return Replace(m.right().node()); in Reduce()
318 return ReplaceFloat64(m.left().Value() + m.right().Value()); in Reduce()
324 if (m.right().Is(0) && (Double(m.right().Value()).Sign() > 0)) { in Reduce()
327 if (m.right().IsNaN()) { // x - NaN => NaN in Reduce()
328 return Replace(m.right().node()); in Reduce()
334 return ReplaceFloat64(m.left().Value() - m.right().Value()); in Reduce()
340 if (m.right().Is(-1)) { // x * -1.0 => -0.0 - x in Reduce()
346 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1.0 => x in Reduce()
347 if (m.right().IsNaN()) { // x * NaN => NaN in Reduce()
348 return Replace(m.right().node()); in Reduce()
351 return ReplaceFloat64(m.left().Value() * m.right().Value()); in Reduce()
357 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1.0 => x in Reduce()
358 if (m.right().IsNaN()) { // x / NaN => NaN in Reduce()
359 return Replace(m.right().node()); in Reduce()
365 return ReplaceFloat64(m.left().Value() / m.right().Value()); in Reduce()
371 if (m.right().Is(0)) { // x % 0 => NaN in Reduce()
374 if (m.right().IsNaN()) { // x % NaN => NaN in Reduce()
375 return Replace(m.right().node()); in Reduce()
381 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value())); in Reduce()
456 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x in ReduceInt32Add()
459 bit_cast<uint32_t>(m.right().Value())); in ReduceInt32Add()
464 node->ReplaceInput(0, m.right().node()); in ReduceInt32Add()
465 node->ReplaceInput(1, mleft.right().node()); in ReduceInt32Add()
471 if (m.right().IsInt32Sub()) { in ReduceInt32Add()
472 Int32BinopMatcher mright(m.right().node()); in ReduceInt32Add()
474 node->ReplaceInput(1, mright.right().node()); in ReduceInt32Add()
487 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt32Sub()
490 static_cast<uint32_t>(m.right().Value())); in ReduceInt32Sub()
493 if (m.right().HasValue()) { // x - K => x + -K in ReduceInt32Sub()
494 node->ReplaceInput(1, Int32Constant(-m.right().Value())); in ReduceInt32Sub()
506 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceInt32Div()
507 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceInt32Div()
510 base::bits::SignedDiv32(m.left().Value(), m.right().Value())); in ReduceInt32Div()
516 if (m.right().Is(-1)) { // x / -1 => 0 - x in ReduceInt32Div()
523 if (m.right().HasValue()) { in ReduceInt32Div()
524 int32_t const divisor = m.right().Value(); in ReduceInt32Div()
554 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceUint32Div()
555 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceUint32Div()
558 base::bits::UnsignedDiv32(m.left().Value(), m.right().Value())); in ReduceUint32Div()
564 if (m.right().HasValue()) { in ReduceUint32Div()
566 uint32_t const divisor = m.right().Value(); in ReduceUint32Div()
568 node->ReplaceInput(1, Uint32Constant(WhichPowerOf2(m.right().Value()))); in ReduceUint32Div()
583 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceInt32Mod()
584 if (m.right().Is(1)) return ReplaceInt32(0); // x % 1 => 0 in ReduceInt32Mod()
585 if (m.right().Is(-1)) return ReplaceInt32(0); // x % -1 => 0 in ReduceInt32Mod()
589 base::bits::SignedMod32(m.left().Value(), m.right().Value())); in ReduceInt32Mod()
591 if (m.right().HasValue()) { in ReduceInt32Mod()
593 int32_t const divisor = Abs(m.right().Value()); in ReduceInt32Mod()
621 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceUint32Mod()
622 if (m.right().Is(1)) return ReplaceUint32(0); // x % 1 => 0 in ReduceUint32Mod()
626 base::bits::UnsignedMod32(m.left().Value(), m.right().Value())); in ReduceUint32Mod()
628 if (m.right().HasValue()) { in ReduceUint32Mod()
630 uint32_t const divisor = m.right().Value(); in ReduceUint32Mod()
632 node->ReplaceInput(1, Uint32Constant(m.right().Value() - 1)); in ReduceUint32Mod()
686 if (m.right().HasValue() && ((rep == MachineRepresentation::kWord8 && in ReduceStore()
687 (m.right().Value() & 0xff) == 0xff) || in ReduceStore()
689 (m.right().Value() & 0xffff) == 0xffff))) { in ReduceStore()
698 m.right().IsInRange(1, 24)) || in ReduceStore()
700 m.right().IsInRange(1, 16)))) { in ReduceStore()
702 if (mleft.right().Is(m.right().Value())) { in ReduceStore()
724 m.right().Value(), &val); in ReduceProjection()
727 if (m.right().Is(0)) { in ReduceProjection()
738 m.right().Value(), &val); in ReduceProjection()
741 if (m.right().Is(0)) { in ReduceProjection()
761 if (m.right().IsWord32And()) { in ReduceWord32Shifts()
762 Int32BinopMatcher mright(m.right().node()); in ReduceWord32Shifts()
763 if (mright.right().Is(0x1f)) { in ReduceWord32Shifts()
776 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord32Shl()
778 return ReplaceInt32(m.left().Value() << m.right().Value()); in ReduceWord32Shl()
780 if (m.right().IsInRange(1, 31)) { in ReduceWord32Shl()
785 if (mleft.right().Is(m.right().Value())) { in ReduceWord32Shl()
788 Uint32Constant(~((1U << m.right().Value()) - 1U))); in ReduceWord32Shl()
801 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord32Sar()
803 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Sar()
808 if (m.right().Is(31) && mleft.right().Is(31)) { in ReduceWord32Sar()
819 if (m.right().Is(24) && mleft.right().Is(24) && in ReduceWord32Sar()
824 if (m.right().Is(16) && mleft.right().Is(16) && in ReduceWord32Sar()
838 if (m.right().Is(0)) return Replace(m.right().node()); // x & 0 => 0 in ReduceWord32And()
839 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x in ReduceWord32And()
840 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP in ReduceWord32And()
844 return ReplaceInt32(m.left().Value() & m.right().Value()); in ReduceWord32And()
847 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32And()
849 if (mleft.right().HasValue()) { // (x & K) & K => x & K in ReduceWord32And()
852 1, Int32Constant(m.right().Value() & mleft.right().Value())); in ReduceWord32And()
857 if (m.right().IsNegativePowerOf2()) { in ReduceWord32And()
858 int32_t const mask = m.right().Value(); in ReduceWord32And()
861 if (mleft.right().HasValue() && in ReduceWord32And()
862 mleft.right().Value() >= base::bits::CountTrailingZeros32(mask)) { in ReduceWord32And()
868 if (mleft.right().HasValue() && in ReduceWord32And()
869 (mleft.right().Value() & mask) == mleft.right().Value()) { in ReduceWord32And()
871 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
872 node->ReplaceInput(1, mleft.right().node()); in ReduceWord32And()
879 if (mleftleft.right().IsMultipleOf(-mask)) { in ReduceWord32And()
882 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
889 if (mleft.right().IsInt32Mul()) { in ReduceWord32And()
890 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
891 if (mleftright.right().IsMultipleOf(-mask)) { in ReduceWord32And()
894 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
903 if (mleftleft.right().Is(base::bits::CountTrailingZeros32(mask))) { in ReduceWord32And()
906 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
913 if (mleft.right().IsWord32Shl()) { in ReduceWord32And()
914 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
915 if (mleftright.right().Is(base::bits::CountTrailingZeros32(mask))) { in ReduceWord32And()
918 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
927 if (mleft.right().IsMultipleOf(-mask)) { in ReduceWord32And()
940 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x in ReduceWord32Or()
941 if (m.right().Is(-1)) return Replace(m.right().node()); // x | -1 => -1 in ReduceWord32Or()
943 return ReplaceInt32(m.left().Value() | m.right().Value()); in ReduceWord32Or()
953 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) { in ReduceWord32Or()
955 shr = m.right().node(); in ReduceWord32Or()
956 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) { in ReduceWord32Or()
957 shl = m.right().node(); in ReduceWord32Or()
967 if (mshl.right().HasValue() && mshr.right().HasValue()) { in ReduceWord32Or()
969 if (mshl.right().Value() + mshr.right().Value() != 32) return NoChange(); in ReduceWord32Or()
973 if (mshl.right().IsInt32Sub()) { in ReduceWord32Or()
974 sub = mshl.right().node(); in ReduceWord32Or()
975 y = mshr.right().node(); in ReduceWord32Or()
976 } else if (mshr.right().IsInt32Sub()) { in ReduceWord32Or()
977 sub = mshr.right().node(); in ReduceWord32Or()
978 y = mshl.right().node(); in ReduceWord32Or()
984 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange(); in ReduceWord32Or()
988 node->ReplaceInput(1, mshr.right().node()); in ReduceWord32Or()
1045 m.right().IsChangeFloat32ToFloat64()) || in ReduceFloat64Compare()
1047 IsFloat64RepresentableAsFloat32(m.right())) || in ReduceFloat64Compare()
1049 m.right().IsChangeFloat32ToFloat64())) { in ReduceFloat64Compare()
1068 1, m.right().HasValue() in ReduceFloat64Compare()
1069 ? Float32Constant(static_cast<float>(m.right().Value())) in ReduceFloat64Compare()
1070 : m.right().InputAt(0)); in ReduceFloat64Compare()