OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/s390/frames-s390.h" | 9 #include "src/s390/frames-s390.h" |
10 | 10 |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 | 1352 |
1353 static inline bool TryMatchInt32SubWithOverflow(InstructionSelector* selector, | 1353 static inline bool TryMatchInt32SubWithOverflow(InstructionSelector* selector, |
1354 Node* node) { | 1354 Node* node) { |
1355 return TryMatchInt32OpWithOverflow<kS390_Sub32>(selector, node, | 1355 return TryMatchInt32OpWithOverflow<kS390_Sub32>(selector, node, |
1356 SubOperandMode); | 1356 SubOperandMode); |
1357 } | 1357 } |
1358 | 1358 |
1359 static inline bool TryMatchInt32MulWithOverflow(InstructionSelector* selector, | 1359 static inline bool TryMatchInt32MulWithOverflow(InstructionSelector* selector, |
1360 Node* node) { | 1360 Node* node) { |
1361 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1361 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
1362 FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf); | 1362 if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) { |
1363 VisitWord32BinOp(selector, node, kS390_Mul32WithOverflow, | 1363 DCHECK(TryMatchInt32OpWithOverflow<kS390_Mul32>( |
1364 OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps, | 1364 selector, node, |
1365 &cont); | 1365 OperandMode::kAllowRRR | OperandMode::kAllowRM) == true); |
| 1366 } else { |
| 1367 FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf); |
| 1368 VisitWord32BinOp(selector, node, kS390_Mul32WithOverflow, |
| 1369 OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps, |
| 1370 &cont); |
| 1371 } |
1366 return true; | 1372 return true; |
1367 } | 1373 } |
1368 return TryMatchShiftFromMul<Int32BinopMatcher, kS390_ShiftLeft32>(selector, | 1374 return TryMatchShiftFromMul<Int32BinopMatcher, kS390_ShiftLeft32>(selector, |
1369 node); | 1375 node); |
1370 } | 1376 } |
1371 | 1377 |
1372 #if V8_TARGET_ARCH_S390X | 1378 #if V8_TARGET_ARCH_S390X |
1373 template <ArchOpcode opcode> | 1379 template <ArchOpcode opcode> |
1374 static inline bool TryMatchInt64OpWithOverflow(InstructionSelector* selector, | 1380 static inline bool TryMatchInt64OpWithOverflow(InstructionSelector* selector, |
1375 Node* node, OperandModes mode) { | 1381 Node* node, OperandModes mode) { |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2479 // static | 2485 // static |
2480 MachineOperatorBuilder::AlignmentRequirements | 2486 MachineOperatorBuilder::AlignmentRequirements |
2481 InstructionSelector::AlignmentRequirements() { | 2487 InstructionSelector::AlignmentRequirements() { |
2482 return MachineOperatorBuilder::AlignmentRequirements:: | 2488 return MachineOperatorBuilder::AlignmentRequirements:: |
2483 FullUnalignedAccessSupport(); | 2489 FullUnalignedAccessSupport(); |
2484 } | 2490 } |
2485 | 2491 |
2486 } // namespace compiler | 2492 } // namespace compiler |
2487 } // namespace internal | 2493 } // namespace internal |
2488 } // namespace v8 | 2494 } // namespace v8 |
OLD | NEW |