Index: src/s390/macro-assembler-s390.cc |
diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc |
index ef82606012a04b5f5d841034509738d10d2375e0..744fc475fadde833c8a6bb1d77fdb175cdef65eb 100644 |
--- a/src/s390/macro-assembler-s390.cc |
+++ b/src/s390/macro-assembler-s390.cc |
@@ -3364,13 +3364,17 @@ void MacroAssembler::Mul64(Register dst, const Operand& src1) { |
} |
void MacroAssembler::Mul(Register dst, Register src1, Register src2) { |
- if (dst.is(src2)) { |
- MulP(dst, src1); |
- } else if (dst.is(src1)) { |
- MulP(dst, src2); |
+ if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) { |
+ MulPWithCondition(dst, src1, src2); |
} else { |
- Move(dst, src1); |
- MulP(dst, src2); |
+ if (dst.is(src2)) { |
+ MulP(dst, src1); |
+ } else if (dst.is(src1)) { |
+ MulP(dst, src2); |
+ } else { |
+ Move(dst, src1); |
+ MulP(dst, src2); |
+ } |
} |
} |
@@ -3502,6 +3506,16 @@ void MacroAssembler::MulP(Register dst, Register src) { |
#endif |
} |
+void MacroAssembler::MulPWithCondition(Register dst, Register src1, |
+ Register src2) { |
+ CHECK(CpuFeatures::IsSupported(MISC_INSTR_EXT2)); |
+#if V8_TARGET_ARCH_S390X |
+ msgrkc(dst, src1, src2); |
+#else |
+ msrkc(dst, src1, src2); |
+#endif |
+} |
+ |
void MacroAssembler::MulP(Register dst, const MemOperand& opnd) { |
#if V8_TARGET_ARCH_S390X |
if (is_uint16(opnd.offset())) { |