Home | History | Annotate | Download | only in compiler

Lines Matching full:right

51       if (m.right().Is(0)) return Replace(m.right().node());  // x & 0  => 0
52 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x
54 return ReplaceInt32(m.left().Value() & m.right().Value());
61 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x
62 if (m.right().Is(-1)) return Replace(m.right().node()); // x | -1 => -1
64 return ReplaceInt32(m.left().Value() | m.right().Value());
67 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) {
69 Int32BinopMatcher mright(m.right().node());
72 if (mright.right().IsInt32Sub()) {
73 Int32BinopMatcher mrightright(mright.right().node());
75 mrightright.right().node() == mleft.right().node()) {
78 node->ReplaceInput(1, mleft.right().node());
83 if (mleft.right().IsInRange(0, 31) &&
84 mright.right().Is(32 - mleft.right().Value())) {
87 node->ReplaceInput(1, mleft.right().node());
92 if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) {
95 Int32BinopMatcher mright(m.right().node());
97 if (mleft.right().IsInt32Sub()) {
98 Int32BinopMatcher mleftright(mleft.right().node());
100 mleftright.right().node() == mright.right().node()) {
103 node->ReplaceInput(1, mright.right().node());
108 if (mright.right().IsInRange(0, 31) &&
109 mleft.right().Is(32 - mright.right().Value())) {
112 node->ReplaceInput(1, mright.right().node());
121 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x
123 return ReplaceInt32(m.left().Value() ^ m.right().Value());
130 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x
132 return ReplaceInt32(m.left().Value() << m.right().Value());
138 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x
140 return ReplaceInt32(m.left().Value() >> m.right().Value());
146 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x
148 return ReplaceInt32(m.left().Value() >> m.right().Value());
154 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x
157 base::bits::RotateRight32(m.left().Value(), m.right().Value()));
164 return ReplaceBool(m.left().Value() == m.right().Value());
166 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y
169 node->ReplaceInput(1, msub.right().node());
178 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x
181 static_cast<uint32_t>(m.right().Value()));
187 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x
190 static_cast<uint32_t>(m.right().Value()));
197 if (m.right().Is(0)) return Replace(m.right().node()); // x * 0 => 0
198 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x
200 return ReplaceInt32(m.left().Value() * m.right().Value());
202 if (m.right().Is(-1)) { // x * -1 => 0 - x
208 if (m.right().IsPowerOf2()) { // x * 2^n => x << n
210 node->ReplaceInput(1, Int32Constant(WhichPowerOf2(m.right().Value())));
217 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
219 // TODO(turbofan): if (m.right().IsPowerOf2())
220 // TODO(turbofan): if (m.right().Is(0))
222 if (m.IsFoldable() && !m.right().Is(0)) { // K / K => K
223 if (m.right().Is(-1)) return ReplaceInt32(-m.left().Value());
224 return ReplaceInt32(m.left().Value() / m.right().Value());
226 if (m.right().Is(-1)) { // x / -1 => 0 - x
236 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
238 // TODO(turbofan): if (m.right().Is(0))
240 if (m.IsFoldable() && !m.right().Is(0)) { // K / K => K
241 return ReplaceInt32(m.left().Value() / m.right().Value());
243 if (m.right().IsPowerOf2()) { // x / 2^n => x >> n
245 node->ReplaceInput(1, Int32Constant(WhichPowerOf2(m.right().Value())));
252 if (m.right().Is(1)) return ReplaceInt32(0); // x % 1 => 0
253 if (m.right().Is(-1)) return ReplaceInt32(0); // x % -1 => 0
255 // TODO(turbofan): if (m.right().IsPowerOf2())
256 // TODO(turbofan): if (m.right().Is(0))
258 if (m.IsFoldable() && !m.right().Is(0)) { // K % K => K
259 return ReplaceInt32(m.left().Value() % m.right().Value());
265 if (m.right().Is(1)) return ReplaceInt32(0); // x % 1 => 0
267 // TODO(turbofan): if (m.right().Is(0))
269 if (m.IsFoldable() && !m.right().Is(0)) { // K % K => K
270 return ReplaceInt32(m.left().Value() % m.right().Value());
272 if (m.right().IsPowerOf2()) { // x % 2^n => x & 2^n-1
274 node->ReplaceInput(1, Int32Constant(m.right().Value() - 1));
282 return ReplaceBool(m.left().Value() < m.right().Value());
284 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y < 0 => x < y
287 node->ReplaceInput(1, msub.right().node());
290 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 < x - y => y < x
291 Int32BinopMatcher msub(m.right().node());
292 node->ReplaceInput(0, msub.right().node());
302 return ReplaceBool(m.left().Value() <= m.right().Value());
304 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y <= 0 => x <= y
307 node->ReplaceInput(1, msub.right().node());
310 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 <= x - y => y <= x
311 Int32BinopMatcher msub(m.right().node());
312 node->ReplaceInput(0, msub.right().node());
322 if (m.right().Is(0)) return ReplaceBool(false); // x < 0 => false
324 return ReplaceBool(m.left().Value() < m.right().Value());
332 if (m.right().Is(kMaxUInt32)) return ReplaceBool(true); // x <= M => true
334 return ReplaceBool(m.left().Value() <= m.right().Value());
342 return ReplaceFloat64(m.left().Value() + m.right().Value());
349 return ReplaceFloat64(m.left().Value() - m.right().Value());
355 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1.0 => x
356 if (m.right().IsNaN()) { // x * NaN => NaN
357 return Replace(m.right().node());
360 return ReplaceFloat64(m.left().Value() * m.right().Value());
366 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1.0 => x
367 if (m.right().IsNaN()) { // x / NaN => NaN
368 return Replace(m.right().node());
374 return ReplaceFloat64(m.left().Value() / m.right().Value());
380 if (m.right().IsNaN()) { // x % NaN => NaN
381 return Replace(m.right().node());
387 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value()));
461 m.right().Value(), &val);
464 if (m.right().Is(0)) {
475 m.right().Value(), &val);
478 if (m.right().Is(0)) {