OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler-intrinsics.h" | 7 #include "src/compiler-intrinsics.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 std::swap(shl, shr); | 134 std::swap(shl, shr); |
135 } else if (!m.left().IsWord32Shl() || !m.right().IsWord32Shr()) { | 135 } else if (!m.left().IsWord32Shl() || !m.right().IsWord32Shr()) { |
136 return false; | 136 return false; |
137 } | 137 } |
138 Int32BinopMatcher mshr(shr); | 138 Int32BinopMatcher mshr(shr); |
139 Int32BinopMatcher mshl(shl); | 139 Int32BinopMatcher mshl(shl); |
140 Node* value = mshr.left().node(); | 140 Node* value = mshr.left().node(); |
141 if (value != mshl.left().node()) return false; | 141 if (value != mshl.left().node()) return false; |
142 Node* shift = mshr.right().node(); | 142 Node* shift = mshr.right().node(); |
143 Int32Matcher mshift(shift); | 143 Int32Matcher mshift(shift); |
144 if (mshift.IsInRange(1, 31) && mshl.right().Is(32 - mshift.Value())) { | 144 if (mshift.IsInRange(1, 31)) { |
145 *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_I); | 145 if (mshl.right().Is(32 - mshift.Value())) { |
146 *value_return = g.UseRegister(value); | 146 *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_I); |
147 *shift_return = g.UseImmediate(shift); | 147 *value_return = g.UseRegister(value); |
148 return true; | 148 *shift_return = g.UseImmediate(shift); |
| 149 return true; |
| 150 } |
| 151 if (mshl.right().IsInt32Sub()) { |
| 152 Int32BinopMatcher mshlright(mshl.right().node()); |
| 153 if (mshlright.left().Is(32) && mshlright.right().Is(mshift.Value())) { |
| 154 *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_I); |
| 155 *value_return = g.UseRegister(value); |
| 156 *shift_return = g.UseImmediate(shift); |
| 157 return true; |
| 158 } |
| 159 } |
149 } | 160 } |
150 if (mshl.right().IsInt32Sub()) { | 161 if (mshl.right().IsInt32Sub()) { |
151 Int32BinopMatcher mshlright(mshl.right().node()); | 162 Int32BinopMatcher mshlright(mshl.right().node()); |
152 if (!mshlright.left().Is(32)) return false; | 163 if (!mshlright.left().Is(32)) return false; |
153 if (mshlright.right().node() != shift) return false; | 164 if (mshlright.right().node() != shift) return false; |
154 *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_R); | 165 *opcode_return |= AddressingModeField::encode(kMode_Operand2_R_ROR_R); |
155 *value_return = g.UseRegister(value); | 166 *value_return = g.UseRegister(value); |
156 *shift_return = g.UseRegister(shift); | 167 *shift_return = g.UseRegister(shift); |
157 return true; | 168 return true; |
158 } | 169 } |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 DCHECK(cont->IsSet()); | 945 DCHECK(cont->IsSet()); |
935 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 946 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), |
936 g.UseDoubleRegister(m.left().node()), | 947 g.UseDoubleRegister(m.left().node()), |
937 g.UseDoubleRegister(m.right().node())); | 948 g.UseDoubleRegister(m.right().node())); |
938 } | 949 } |
939 } | 950 } |
940 | 951 |
941 } // namespace compiler | 952 } // namespace compiler |
942 } // namespace internal | 953 } // namespace internal |
943 } // namespace v8 | 954 } // namespace v8 |
OLD | NEW |