Index: src/crankshaft/s390/lithium-codegen-s390.cc |
diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc |
index 7bc99718bef100c055eb062d0e947d2a5448819d..6c3673591971401487435a6b051294438985c6a0 100644 |
--- a/src/crankshaft/s390/lithium-codegen-s390.cc |
+++ b/src/crankshaft/s390/lithium-codegen-s390.cc |
@@ -1969,20 +1969,38 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
DoubleRegister left = ToDoubleRegister(instr->left()); |
DoubleRegister right = ToDoubleRegister(instr->right()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
- // All operations except MOD are computed in-place. |
- DCHECK(instr->op() == Token::MOD || left.is(result)); |
switch (instr->op()) { |
case Token::ADD: |
- __ adbr(result, right); |
+ if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
+ __ vfa(result, left, right); |
+ } else { |
+ DCHECK(result.is(left)); |
+ __ adbr(result, right); |
+ } |
break; |
case Token::SUB: |
- __ sdbr(result, right); |
+ if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
+ __ vfs(result, left, right); |
+ } else { |
+ DCHECK(result.is(left)); |
+ __ sdbr(result, right); |
+ } |
break; |
case Token::MUL: |
- __ mdbr(result, right); |
+ if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
+ __ vfm(result, left, right); |
+ } else { |
+ DCHECK(result.is(left)); |
+ __ mdbr(result, right); |
+ } |
break; |
case Token::DIV: |
- __ ddbr(result, right); |
+ if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
+ __ vfd(result, left, right); |
+ } else { |
+ DCHECK(result.is(left)); |
+ __ ddbr(result, right); |
+ } |
break; |
case Token::MOD: { |
__ PrepareCallCFunction(0, 2, scratch0()); |