Lines Matching refs:right
169 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x in Reduce()
172 base::bits::RotateRight32(m.left().Value(), m.right().Value())); in Reduce()
179 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
181 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
184 node->ReplaceInput(1, msub.right().node()); in Reduce()
194 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
196 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
199 node->ReplaceInput(1, msub.right().node()); in Reduce()
216 if (m.right().Is(0)) return Replace(m.right().node()); // x * 0 => 0 in Reduce()
217 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x in Reduce()
219 return ReplaceInt32(m.left().Value() * m.right().Value()); in Reduce()
221 if (m.right().Is(-1)) { // x * -1 => 0 - x in Reduce()
227 if (m.right().IsPowerOf2()) { // x * 2^n => x << n in Reduce()
228 node->ReplaceInput(1, Int32Constant(WhichPowerOf2(m.right().Value()))); in Reduce()
237 if (m.right().Is(2)) { in Reduce()
242 if (m.right().Is(-1)) { in Reduce()
261 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
264 if (m.left().IsWord32Or() && m.right().Is(0)) { in Reduce()
268 mleftmatcher.right().IsNegative()) { in Reduce()
277 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
285 if (m.right().Is(0)) return ReplaceBool(false); // x < 0 => false in Reduce()
287 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
290 if (m.left().IsWord32Sar() && m.right().HasValue()) { in Reduce()
292 if (mleft.right().HasValue()) { in Reduce()
295 const uint32_t c = m.right().Value(); in Reduce()
296 const uint32_t k = mleft.right().Value() & 0x1f; in Reduce()
310 if (m.right().Is(kMaxUInt32)) return ReplaceBool(true); // x <= M => true in Reduce()
312 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
319 if (m.right().Is(0) && (copysign(1.0, m.right().Value()) > 0)) { in Reduce()
322 if (m.right().IsNaN()) { // x - NaN => NaN in Reduce()
323 return Replace(m.right().node()); in Reduce()
329 return ReplaceFloat32(m.left().Value() - m.right().Value()); in Reduce()
334 m.right().IsFloat32RoundDown()) { in Reduce()
335 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat32Sub) { in Reduce()
336 Float32BinopMatcher mright0(m.right().InputAt(0)); in Reduce()
339 mright0.right().node())); in Reduce()
352 if (m.right().IsNaN()) { // x + NaN => NaN in Reduce()
353 return Replace(m.right().node()); in Reduce()
356 return ReplaceFloat64(m.left().Value() + m.right().Value()); in Reduce()
362 if (m.right().Is(0) && (Double(m.right().Value()).Sign() > 0)) { in Reduce()
365 if (m.right().IsNaN()) { // x - NaN => NaN in Reduce()
366 return Replace(m.right().node()); in Reduce()
372 return ReplaceFloat64(m.left().Value() - m.right().Value()); in Reduce()
377 m.right().IsFloat64RoundDown()) { in Reduce()
378 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub) { in Reduce()
379 Float64BinopMatcher mright0(m.right().InputAt(0)); in Reduce()
382 mright0.right().node())); in Reduce()
395 if (m.right().Is(-1)) { // x * -1.0 => -0.0 - x in Reduce()
401 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1.0 => x in Reduce()
402 if (m.right().IsNaN()) { // x * NaN => NaN in Reduce()
403 return Replace(m.right().node()); in Reduce()
406 return ReplaceFloat64(m.left().Value() * m.right().Value()); in Reduce()
408 if (m.right().Is(2)) { // x * 2.0 => x + x in Reduce()
417 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1.0 => x in Reduce()
418 if (m.right().IsNaN()) { // x / NaN => NaN in Reduce()
419 return Replace(m.right().node()); in Reduce()
425 return ReplaceFloat64(m.left().Value() / m.right().Value()); in Reduce()
427 if (m.right().Is(-1)) { // x / -1.0 => -x in Reduce()
432 if (m.right().IsNormal() && m.right().IsPositiveOrNegativePowerOf2()) { in Reduce()
436 node->ReplaceInput(1, Float64Constant(1.0 / m.right().Value())); in Reduce()
444 if (m.right().Is(0)) { // x % 0 => NaN in Reduce()
447 if (m.right().IsNaN()) { // x % NaN => NaN in Reduce()
448 return Replace(m.right().node()); in Reduce()
454 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value())); in Reduce()
490 if (m.right().IsNaN()) { in Reduce()
491 return Replace(m.right().node()); in Reduce()
498 base::ieee754::atan2(m.left().Value(), m.right().Value())); in Reduce()
550 return ReplaceFloat64(Pow(m.left().Value(), m.right().Value())); in Reduce()
551 } else if (m.right().Is(0.0)) { // x ** +-0.0 => 1.0 in Reduce()
553 } else if (m.right().Is(-2.0)) { // x ** -2.0 => 1 / (x * x) in Reduce()
558 } else if (m.right().Is(2.0)) { // x ** 2.0 => x * x in Reduce()
562 } else if (m.right().Is(-0.5)) { in Reduce()
568 } else if (m.right().Is(0.5)) { in Reduce()
676 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x in ReduceInt32Add()
679 bit_cast<uint32_t>(m.right().Value())); in ReduceInt32Add()
684 node->ReplaceInput(0, m.right().node()); in ReduceInt32Add()
685 node->ReplaceInput(1, mleft.right().node()); in ReduceInt32Add()
691 if (m.right().IsInt32Sub()) { in ReduceInt32Add()
692 Int32BinopMatcher mright(m.right().node()); in ReduceInt32Add()
694 node->ReplaceInput(1, mright.right().node()); in ReduceInt32Add()
706 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => 0 in ReduceInt64Add()
709 bit_cast<uint64_t>(m.right().Value()))); in ReduceInt64Add()
717 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt32Sub()
720 static_cast<uint32_t>(m.right().Value())); in ReduceInt32Sub()
723 if (m.right().HasValue()) { // x - K => x + -K in ReduceInt32Sub()
724 node->ReplaceInput(1, Int32Constant(-m.right().Value())); in ReduceInt32Sub()
735 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt64Sub()
738 bit_cast<uint64_t>(m.right().Value()))); in ReduceInt64Sub()
741 if (m.right().HasValue()) { // x - K => x + -K in ReduceInt64Sub()
742 node->ReplaceInput(1, Int64Constant(-m.right().Value())); in ReduceInt64Sub()
753 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceInt32Div()
754 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceInt32Div()
757 base::bits::SignedDiv32(m.left().Value(), m.right().Value())); in ReduceInt32Div()
763 if (m.right().Is(-1)) { // x / -1 => 0 - x in ReduceInt32Div()
770 if (m.right().HasValue()) { in ReduceInt32Div()
771 int32_t const divisor = m.right().Value(); in ReduceInt32Div()
801 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceUint32Div()
802 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceUint32Div()
805 base::bits::UnsignedDiv32(m.left().Value(), m.right().Value())); in ReduceUint32Div()
811 if (m.right().HasValue()) { in ReduceUint32Div()
813 uint32_t const divisor = m.right().Value(); in ReduceUint32Div()
815 node->ReplaceInput(1, Uint32Constant(WhichPowerOf2(m.right().Value()))); in ReduceUint32Div()
830 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceInt32Mod()
831 if (m.right().Is(1)) return ReplaceInt32(0); // x % 1 => 0 in ReduceInt32Mod()
832 if (m.right().Is(-1)) return ReplaceInt32(0); // x % -1 => 0 in ReduceInt32Mod()
836 base::bits::SignedMod32(m.left().Value(), m.right().Value())); in ReduceInt32Mod()
838 if (m.right().HasValue()) { in ReduceInt32Mod()
840 int32_t const divisor = Abs(m.right().Value()); in ReduceInt32Mod()
868 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceUint32Mod()
869 if (m.right().Is(1)) return ReplaceUint32(0); // x % 1 => 0 in ReduceUint32Mod()
873 base::bits::UnsignedMod32(m.left().Value(), m.right().Value())); in ReduceUint32Mod()
875 if (m.right().HasValue()) { in ReduceUint32Mod()
877 uint32_t const divisor = m.right().Value(); in ReduceUint32Mod()
879 node->ReplaceInput(1, Uint32Constant(m.right().Value() - 1)); in ReduceUint32Mod()
916 if (m.right().HasValue() && ((rep == MachineRepresentation::kWord8 && in ReduceStore()
917 (m.right().Value() & 0xff) == 0xff) || in ReduceStore()
919 (m.right().Value() & 0xffff) == 0xffff))) { in ReduceStore()
928 m.right().IsInRange(1, 24)) || in ReduceStore()
930 m.right().IsInRange(1, 16)))) { in ReduceStore()
932 if (mleft.right().Is(m.right().Value())) { in ReduceStore()
954 m.right().Value(), &val); in ReduceProjection()
957 if (m.right().Is(0)) { in ReduceProjection()
958 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
968 m.right().Value(), &val); in ReduceProjection()
971 if (m.right().Is(0)) { in ReduceProjection()
972 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
982 m.right().Value(), &val); in ReduceProjection()
985 if (m.right().Is(0)) { in ReduceProjection()
986 return Replace(m.right().node()); in ReduceProjection()
988 if (m.right().Is(1)) { in ReduceProjection()
1008 if (m.right().IsWord32And()) { in ReduceWord32Shifts()
1009 Int32BinopMatcher mright(m.right().node()); in ReduceWord32Shifts()
1010 if (mright.right().Is(0x1f)) { in ReduceWord32Shifts()
1023 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord32Shl()
1025 return ReplaceInt32(m.left().Value() << m.right().Value()); in ReduceWord32Shl()
1027 if (m.right().IsInRange(1, 31)) { in ReduceWord32Shl()
1032 if (mleft.right().Is(m.right().Value())) { in ReduceWord32Shl()
1035 Uint32Constant(~((1U << m.right().Value()) - 1U))); in ReduceWord32Shl()
1048 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord64Shl()
1050 return ReplaceInt64(m.left().Value() << m.right().Value()); in ReduceWord64Shl()
1057 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord32Shr()
1059 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Shr()
1061 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32Shr()
1063 if (mleft.right().HasValue()) { in ReduceWord32Shr()
1064 uint32_t shift = m.right().Value() & 0x1f; in ReduceWord32Shr()
1065 uint32_t mask = mleft.right().Value(); in ReduceWord32Shr()
1078 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord64Shr()
1080 return ReplaceInt64(m.left().Value() >> m.right().Value()); in ReduceWord64Shr()
1087 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord32Sar()
1089 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Sar()
1094 if (m.right().Is(31) && mleft.right().Is(31)) { in ReduceWord32Sar()
1105 if (m.right().Is(24) && mleft.right().Is(24) && in ReduceWord32Sar()
1110 if (m.right().Is(16) && mleft.right().Is(16) && in ReduceWord32Sar()
1122 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord64Sar()
1124 return ReplaceInt64(m.left().Value() >> m.right().Value()); in ReduceWord64Sar()
1132 if (m.right().Is(0)) return Replace(m.right().node()); // x & 0 => 0 in ReduceWord32And()
1133 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x in ReduceWord32And()
1134 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP in ReduceWord32And()
1138 return ReplaceInt32(m.left().Value() & m.right().Value()); in ReduceWord32And()
1141 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32And()
1143 if (mleft.right().HasValue()) { // (x & K) & K => x & K in ReduceWord32And()
1146 1, Int32Constant(m.right().Value() & mleft.right().Value())); in ReduceWord32And()
1151 if (m.right().IsNegativePowerOf2()) { in ReduceWord32And()
1152 int32_t const mask = m.right().Value(); in ReduceWord32And()
1155 if (mleft.right().HasValue() && in ReduceWord32And()
1156 mleft.right().Value() >= base::bits::CountTrailingZeros32(mask)) { in ReduceWord32And()
1162 if (mleft.right().HasValue() && in ReduceWord32And()
1163 (mleft.right().Value() & mask) == mleft.right().Value()) { in ReduceWord32And()
1165 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1166 node->ReplaceInput(1, mleft.right().node()); in ReduceWord32And()
1173 if (mleftleft.right().IsMultipleOf(-mask)) { in ReduceWord32And()
1176 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
1183 if (mleft.right().IsInt32Mul()) { in ReduceWord32And()
1184 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
1185 if (mleftright.right().IsMultipleOf(-mask)) { in ReduceWord32And()
1188 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1197 if (mleftleft.right().Is(base::bits::CountTrailingZeros32(mask))) { in ReduceWord32And()
1200 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
1207 if (mleft.right().IsWord32Shl()) { in ReduceWord32And()
1208 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
1209 if (mleftright.right().Is(base::bits::CountTrailingZeros32(mask))) { in ReduceWord32And()
1212 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1221 if (mleft.right().IsMultipleOf(-mask)) { in ReduceWord32And()
1242 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) { in TryMatchWord32Ror()
1244 shr = m.right().node(); in TryMatchWord32Ror()
1245 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) { in TryMatchWord32Ror()
1246 shl = m.right().node(); in TryMatchWord32Ror()
1256 if (mshl.right().HasValue() && mshr.right().HasValue()) { in TryMatchWord32Ror()
1258 if (mshl.right().Value() + mshr.right().Value() != 32) return NoChange(); in TryMatchWord32Ror()
1262 if (mshl.right().IsInt32Sub()) { in TryMatchWord32Ror()
1263 sub = mshl.right().node(); in TryMatchWord32Ror()
1264 y = mshr.right().node(); in TryMatchWord32Ror()
1265 } else if (mshr.right().IsInt32Sub()) { in TryMatchWord32Ror()
1266 sub = mshr.right().node(); in TryMatchWord32Ror()
1267 y = mshl.right().node(); in TryMatchWord32Ror()
1273 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange(); in TryMatchWord32Ror()
1277 node->ReplaceInput(1, mshr.right().node()); in TryMatchWord32Ror()
1285 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x in ReduceWord32Or()
1286 if (m.right().Is(-1)) return Replace(m.right().node()); // x | -1 => -1 in ReduceWord32Or()
1288 return ReplaceInt32(m.left().Value() | m.right().Value()); in ReduceWord32Or()
1298 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x in ReduceWord32Xor()
1300 return ReplaceInt32(m.left().Value() ^ m.right().Value()); in ReduceWord32Xor()
1303 if (m.left().IsWord32Xor() && m.right().Is(-1)) { in ReduceWord32Xor()
1305 if (mleft.right().Is(-1)) { // (x ^ -1) ^ -1 => x in ReduceWord32Xor()
1364 m.right().IsChangeFloat32ToFloat64()) || in ReduceFloat64Compare()
1366 IsFloat64RepresentableAsFloat32(m.right())) || in ReduceFloat64Compare()
1368 m.right().IsChangeFloat32ToFloat64())) { in ReduceFloat64Compare()
1387 1, m.right().HasValue() in ReduceFloat64Compare()
1388 ? Float32Constant(static_cast<float>(m.right().Value())) in ReduceFloat64Compare()
1389 : m.right().InputAt(0)); in ReduceFloat64Compare()