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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 return gt; | 304 return gt; |
305 case kOverflow: | 305 case kOverflow: |
306 // Overflow checked for AddP/SubP only. | 306 // Overflow checked for AddP/SubP only. |
307 switch (op) { | 307 switch (op) { |
308 case kS390_Add32: | 308 case kS390_Add32: |
309 case kS390_Add64: | 309 case kS390_Add64: |
310 case kS390_Sub32: | 310 case kS390_Sub32: |
311 case kS390_Sub64: | 311 case kS390_Sub64: |
312 case kS390_Abs64: | 312 case kS390_Abs64: |
313 case kS390_Abs32: | 313 case kS390_Abs32: |
| 314 case kS390_Mul32: |
314 return overflow; | 315 return overflow; |
315 default: | 316 default: |
316 break; | 317 break; |
317 } | 318 } |
318 break; | 319 break; |
319 case kNotOverflow: | 320 case kNotOverflow: |
320 switch (op) { | 321 switch (op) { |
321 case kS390_Add32: | 322 case kS390_Add32: |
322 case kS390_Add64: | 323 case kS390_Add64: |
323 case kS390_Sub32: | 324 case kS390_Sub32: |
324 case kS390_Sub64: | 325 case kS390_Sub64: |
| 326 case kS390_Abs64: |
| 327 case kS390_Abs32: |
| 328 case kS390_Mul32: |
325 return nooverflow; | 329 return nooverflow; |
326 default: | 330 default: |
327 break; | 331 break; |
328 } | 332 } |
329 break; | 333 break; |
330 default: | 334 default: |
331 break; | 335 break; |
332 } | 336 } |
333 UNREACHABLE(); | 337 UNREACHABLE(); |
334 return kNoCondition; | 338 return kNoCondition; |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 } | 1621 } |
1618 break; | 1622 break; |
1619 case kS390_SubFloat: | 1623 case kS390_SubFloat: |
1620 ASSEMBLE_BIN_OP(DDInstr(sebr), DMTInstr(SubFloat32), nullInstr); | 1624 ASSEMBLE_BIN_OP(DDInstr(sebr), DMTInstr(SubFloat32), nullInstr); |
1621 break; | 1625 break; |
1622 case kS390_SubDouble: | 1626 case kS390_SubDouble: |
1623 ASSEMBLE_BIN_OP(DDInstr(sdbr), DMTInstr(SubFloat64), nullInstr); | 1627 ASSEMBLE_BIN_OP(DDInstr(sdbr), DMTInstr(SubFloat64), nullInstr); |
1624 break; | 1628 break; |
1625 case kS390_Mul32: | 1629 case kS390_Mul32: |
1626 // zero-ext | 1630 // zero-ext |
1627 ASSEMBLE_BIN32_OP(RRInstr(Mul32), RM32Instr(Mul32), RIInstr(Mul32)); | 1631 if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) { |
| 1632 ASSEMBLE_BIN32_OP(RRRInstr(msrkc), RM32Instr(msc), RIInstr(Mul32)); |
| 1633 } else { |
| 1634 ASSEMBLE_BIN32_OP(RRInstr(Mul32), RM32Instr(Mul32), RIInstr(Mul32)); |
| 1635 } |
1628 break; | 1636 break; |
1629 case kS390_Mul32WithOverflow: | 1637 case kS390_Mul32WithOverflow: |
1630 // zero-ext | 1638 // zero-ext |
1631 ASSEMBLE_BIN32_OP(RRRInstr(Mul32WithOverflowIfCCUnequal), | 1639 ASSEMBLE_BIN32_OP(RRRInstr(Mul32WithOverflowIfCCUnequal), |
1632 RRM32Instr(Mul32WithOverflowIfCCUnequal), | 1640 RRM32Instr(Mul32WithOverflowIfCCUnequal), |
1633 RRIInstr(Mul32WithOverflowIfCCUnequal)); | 1641 RRIInstr(Mul32WithOverflowIfCCUnequal)); |
1634 break; | 1642 break; |
1635 case kS390_Mul64: | 1643 case kS390_Mul64: |
1636 ASSEMBLE_BIN_OP(RRInstr(Mul64), RM64Instr(Mul64), RIInstr(Mul64)); | 1644 ASSEMBLE_BIN_OP(RRInstr(Mul64), RM64Instr(Mul64), RIInstr(Mul64)); |
1637 break; | 1645 break; |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2542 | 2550 |
2543 // Assembles boolean materializations after an instruction. | 2551 // Assembles boolean materializations after an instruction. |
2544 void CodeGenerator::AssembleArchBoolean(Instruction* instr, | 2552 void CodeGenerator::AssembleArchBoolean(Instruction* instr, |
2545 FlagsCondition condition) { | 2553 FlagsCondition condition) { |
2546 S390OperandConverter i(this, instr); | 2554 S390OperandConverter i(this, instr); |
2547 ArchOpcode op = instr->arch_opcode(); | 2555 ArchOpcode op = instr->arch_opcode(); |
2548 bool check_unordered = (op == kS390_CmpDouble || op == kS390_CmpFloat); | 2556 bool check_unordered = (op == kS390_CmpDouble || op == kS390_CmpFloat); |
2549 | 2557 |
2550 // Overflow checked for add/sub only. | 2558 // Overflow checked for add/sub only. |
2551 DCHECK((condition != kOverflow && condition != kNotOverflow) || | 2559 DCHECK((condition != kOverflow && condition != kNotOverflow) || |
2552 (op == kS390_Add32 || kS390_Add64 || op == kS390_Sub32 || | 2560 (op == kS390_Add32 || op == kS390_Add64 || op == kS390_Sub32 || |
2553 op == kS390_Sub64)); | 2561 op == kS390_Sub64 || op == kS390_Mul32)); |
2554 | 2562 |
2555 // Materialize a full 32-bit 1 or 0 value. The result register is always the | 2563 // Materialize a full 32-bit 1 or 0 value. The result register is always the |
2556 // last output of the instruction. | 2564 // last output of the instruction. |
2557 DCHECK_NE(0u, instr->OutputCount()); | 2565 DCHECK_NE(0u, instr->OutputCount()); |
2558 Register reg = i.OutputRegister(instr->OutputCount() - 1); | 2566 Register reg = i.OutputRegister(instr->OutputCount() - 1); |
2559 Condition cond = FlagsConditionToCondition(condition, op); | 2567 Condition cond = FlagsConditionToCondition(condition, op); |
2560 Label done; | 2568 Label done; |
2561 if (check_unordered) { | 2569 if (check_unordered) { |
2562 __ LoadImmP(reg, (cond == eq || cond == le || cond == lt) ? Operand::Zero() | 2570 __ LoadImmP(reg, (cond == eq || cond == le || cond == lt) ? Operand::Zero() |
2563 : Operand(1)); | 2571 : Operand(1)); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 padding_size -= 2; | 2979 padding_size -= 2; |
2972 } | 2980 } |
2973 } | 2981 } |
2974 } | 2982 } |
2975 | 2983 |
2976 #undef __ | 2984 #undef __ |
2977 | 2985 |
2978 } // namespace compiler | 2986 } // namespace compiler |
2979 } // namespace internal | 2987 } // namespace internal |
2980 } // namespace v8 | 2988 } // namespace v8 |
OLD | NEW |