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/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
6 #include "src/compiler/operator-properties-inl.h" | 6 #include "src/compiler/operator-properties-inl.h" |
7 #include "testing/gtest-support.h" | 7 #include "testing/gtest-support.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 PURE(Word32Xor, 2, 1), PURE(Word32Shl, 2, 1), | 177 PURE(Word32Xor, 2, 1), PURE(Word32Shl, 2, 1), |
178 PURE(Word32Shr, 2, 1), PURE(Word32Sar, 2, 1), | 178 PURE(Word32Shr, 2, 1), PURE(Word32Sar, 2, 1), |
179 PURE(Word32Ror, 2, 1), PURE(Word32Equal, 2, 1), | 179 PURE(Word32Ror, 2, 1), PURE(Word32Equal, 2, 1), |
180 PURE(Word64And, 2, 1), PURE(Word64Or, 2, 1), | 180 PURE(Word64And, 2, 1), PURE(Word64Or, 2, 1), |
181 PURE(Word64Xor, 2, 1), PURE(Word64Shl, 2, 1), | 181 PURE(Word64Xor, 2, 1), PURE(Word64Shl, 2, 1), |
182 PURE(Word64Shr, 2, 1), PURE(Word64Sar, 2, 1), | 182 PURE(Word64Shr, 2, 1), PURE(Word64Sar, 2, 1), |
183 PURE(Word64Ror, 2, 1), PURE(Word64Equal, 2, 1), | 183 PURE(Word64Ror, 2, 1), PURE(Word64Equal, 2, 1), |
184 PURE(Int32Add, 2, 1), PURE(Int32AddWithOverflow, 2, 2), | 184 PURE(Int32Add, 2, 1), PURE(Int32AddWithOverflow, 2, 2), |
185 PURE(Int32Sub, 2, 1), PURE(Int32SubWithOverflow, 2, 2), | 185 PURE(Int32Sub, 2, 1), PURE(Int32SubWithOverflow, 2, 2), |
186 PURE(Int32Mul, 2, 1), PURE(Int32Div, 2, 1), | 186 PURE(Int32Mul, 2, 1), PURE(Int32Div, 2, 1), |
187 PURE(Int32UDiv, 2, 1), PURE(Int32Mod, 2, 1), | 187 PURE(Uint32Div, 2, 1), PURE(Int32Mod, 2, 1), |
188 PURE(Int32UMod, 2, 1), PURE(Int32LessThan, 2, 1), | 188 PURE(Uint32Mod, 2, 1), PURE(Int32LessThan, 2, 1), |
189 PURE(Int32LessThanOrEqual, 2, 1), PURE(Uint32LessThan, 2, 1), | 189 PURE(Int32LessThanOrEqual, 2, 1), PURE(Uint32LessThan, 2, 1), |
190 PURE(Uint32LessThanOrEqual, 2, 1), PURE(Int64Add, 2, 1), | 190 PURE(Uint32LessThanOrEqual, 2, 1), PURE(Int64Add, 2, 1), |
191 PURE(Int64Sub, 2, 1), PURE(Int64Mul, 2, 1), | 191 PURE(Int64Sub, 2, 1), PURE(Int64Mul, 2, 1), |
192 PURE(Int64Div, 2, 1), PURE(Int64UDiv, 2, 1), | 192 PURE(Int64Div, 2, 1), PURE(Uint64Div, 2, 1), |
193 PURE(Int64Mod, 2, 1), PURE(Int64UMod, 2, 1), | 193 PURE(Int64Mod, 2, 1), PURE(Uint64Mod, 2, 1), |
194 PURE(Int64LessThan, 2, 1), PURE(Int64LessThanOrEqual, 2, 1), | 194 PURE(Int64LessThan, 2, 1), PURE(Int64LessThanOrEqual, 2, 1), |
195 PURE(Uint64LessThan, 2, 1), PURE(ChangeFloat32ToFloat64, 1, 1), | 195 PURE(Uint64LessThan, 2, 1), PURE(ChangeFloat32ToFloat64, 1, 1), |
196 PURE(ChangeFloat64ToInt32, 1, 1), PURE(ChangeFloat64ToUint32, 1, 1), | 196 PURE(ChangeFloat64ToInt32, 1, 1), PURE(ChangeFloat64ToUint32, 1, 1), |
197 PURE(ChangeInt32ToInt64, 1, 1), PURE(ChangeUint32ToFloat64, 1, 1), | 197 PURE(ChangeInt32ToInt64, 1, 1), PURE(ChangeUint32ToFloat64, 1, 1), |
198 PURE(ChangeUint32ToUint64, 1, 1), PURE(TruncateFloat64ToFloat32, 1, 1), | 198 PURE(ChangeUint32ToUint64, 1, 1), PURE(TruncateFloat64ToFloat32, 1, 1), |
199 PURE(TruncateFloat64ToInt32, 1, 1), PURE(TruncateInt64ToInt32, 1, 1), | 199 PURE(TruncateFloat64ToInt32, 1, 1), PURE(TruncateInt64ToInt32, 1, 1), |
200 PURE(Float64Add, 2, 1), PURE(Float64Sub, 2, 1), | 200 PURE(Float64Add, 2, 1), PURE(Float64Sub, 2, 1), |
201 PURE(Float64Mul, 2, 1), PURE(Float64Div, 2, 1), | 201 PURE(Float64Mul, 2, 1), PURE(Float64Div, 2, 1), |
202 PURE(Float64Mod, 2, 1), PURE(Float64Sqrt, 1, 1), | 202 PURE(Float64Mod, 2, 1), PURE(Float64Sqrt, 1, 1), |
203 PURE(Float64Equal, 2, 1), PURE(Float64LessThan, 2, 1), | 203 PURE(Float64Equal, 2, 1), PURE(Float64LessThan, 2, 1), |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 EXPECT_EQ(machine.Word32Xor(), machine.WordXor()); | 271 EXPECT_EQ(machine.Word32Xor(), machine.WordXor()); |
272 EXPECT_EQ(machine.Word32Shl(), machine.WordShl()); | 272 EXPECT_EQ(machine.Word32Shl(), machine.WordShl()); |
273 EXPECT_EQ(machine.Word32Shr(), machine.WordShr()); | 273 EXPECT_EQ(machine.Word32Shr(), machine.WordShr()); |
274 EXPECT_EQ(machine.Word32Sar(), machine.WordSar()); | 274 EXPECT_EQ(machine.Word32Sar(), machine.WordSar()); |
275 EXPECT_EQ(machine.Word32Ror(), machine.WordRor()); | 275 EXPECT_EQ(machine.Word32Ror(), machine.WordRor()); |
276 EXPECT_EQ(machine.Word32Equal(), machine.WordEqual()); | 276 EXPECT_EQ(machine.Word32Equal(), machine.WordEqual()); |
277 EXPECT_EQ(machine.Int32Add(), machine.IntAdd()); | 277 EXPECT_EQ(machine.Int32Add(), machine.IntAdd()); |
278 EXPECT_EQ(machine.Int32Sub(), machine.IntSub()); | 278 EXPECT_EQ(machine.Int32Sub(), machine.IntSub()); |
279 EXPECT_EQ(machine.Int32Mul(), machine.IntMul()); | 279 EXPECT_EQ(machine.Int32Mul(), machine.IntMul()); |
280 EXPECT_EQ(machine.Int32Div(), machine.IntDiv()); | 280 EXPECT_EQ(machine.Int32Div(), machine.IntDiv()); |
281 EXPECT_EQ(machine.Int32UDiv(), machine.IntUDiv()); | 281 EXPECT_EQ(machine.Uint32Div(), machine.UintDiv()); |
282 EXPECT_EQ(machine.Int32Mod(), machine.IntMod()); | 282 EXPECT_EQ(machine.Int32Mod(), machine.IntMod()); |
283 EXPECT_EQ(machine.Int32UMod(), machine.IntUMod()); | 283 EXPECT_EQ(machine.Uint32Mod(), machine.UintMod()); |
284 EXPECT_EQ(machine.Int32LessThan(), machine.IntLessThan()); | 284 EXPECT_EQ(machine.Int32LessThan(), machine.IntLessThan()); |
285 EXPECT_EQ(machine.Int32LessThanOrEqual(), machine.IntLessThanOrEqual()); | 285 EXPECT_EQ(machine.Int32LessThanOrEqual(), machine.IntLessThanOrEqual()); |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 TEST(MachineOperatorTest, PseudoOperatorsWhenWordSizeIs64Bit) { | 289 TEST(MachineOperatorTest, PseudoOperatorsWhenWordSizeIs64Bit) { |
290 MachineOperatorBuilder machine(kRepWord64); | 290 MachineOperatorBuilder machine(kRepWord64); |
291 EXPECT_EQ(machine.Word64And(), machine.WordAnd()); | 291 EXPECT_EQ(machine.Word64And(), machine.WordAnd()); |
292 EXPECT_EQ(machine.Word64Or(), machine.WordOr()); | 292 EXPECT_EQ(machine.Word64Or(), machine.WordOr()); |
293 EXPECT_EQ(machine.Word64Xor(), machine.WordXor()); | 293 EXPECT_EQ(machine.Word64Xor(), machine.WordXor()); |
294 EXPECT_EQ(machine.Word64Shl(), machine.WordShl()); | 294 EXPECT_EQ(machine.Word64Shl(), machine.WordShl()); |
295 EXPECT_EQ(machine.Word64Shr(), machine.WordShr()); | 295 EXPECT_EQ(machine.Word64Shr(), machine.WordShr()); |
296 EXPECT_EQ(machine.Word64Sar(), machine.WordSar()); | 296 EXPECT_EQ(machine.Word64Sar(), machine.WordSar()); |
297 EXPECT_EQ(machine.Word64Ror(), machine.WordRor()); | 297 EXPECT_EQ(machine.Word64Ror(), machine.WordRor()); |
298 EXPECT_EQ(machine.Word64Equal(), machine.WordEqual()); | 298 EXPECT_EQ(machine.Word64Equal(), machine.WordEqual()); |
299 EXPECT_EQ(machine.Int64Add(), machine.IntAdd()); | 299 EXPECT_EQ(machine.Int64Add(), machine.IntAdd()); |
300 EXPECT_EQ(machine.Int64Sub(), machine.IntSub()); | 300 EXPECT_EQ(machine.Int64Sub(), machine.IntSub()); |
301 EXPECT_EQ(machine.Int64Mul(), machine.IntMul()); | 301 EXPECT_EQ(machine.Int64Mul(), machine.IntMul()); |
302 EXPECT_EQ(machine.Int64Div(), machine.IntDiv()); | 302 EXPECT_EQ(machine.Int64Div(), machine.IntDiv()); |
303 EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv()); | 303 EXPECT_EQ(machine.Uint64Div(), machine.UintDiv()); |
304 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); | 304 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); |
305 EXPECT_EQ(machine.Int64UMod(), machine.IntUMod()); | 305 EXPECT_EQ(machine.Uint64Mod(), machine.UintMod()); |
306 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); | 306 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); |
307 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); | 307 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); |
308 } | 308 } |
309 | 309 |
310 } // namespace compiler | 310 } // namespace compiler |
311 } // namespace internal | 311 } // namespace internal |
312 } // namespace v8 | 312 } // namespace v8 |
OLD | NEW |