diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index ff35b8a318..2fd828965e 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -1981,43 +1981,19 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { XMMRegister result = ToDoubleRegister(instr->result()); switch (instr->op()) { case Token::ADD: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vaddsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ addsd(left, right); - } + __ addsd(left, right); break; case Token::SUB: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vsubsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ subsd(left, right); - } + __ subsd(left, right); break; case Token::MUL: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vmulsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ mulsd(left, right); - } + __ mulsd(left, right); break; case Token::DIV: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vdivsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ divsd(left, right); - // Don't delete this mov. It may improve performance on some CPUs, - // when there is a mulsd depending on the result - __ movaps(left, left); - } + __ divsd(left, right); + // Don't delete this mov. It may improve performance on some CPUs, + // when there is a mulsd depending on the result + __ movaps(left, left); break; case Token::MOD: { // Pass two doubles as arguments on the stack. diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 51a9b62fb2..1bd771efbf 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -765,8 +765,7 @@ LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); - return CpuFeatures::IsSupported(AVX) ? DefineAsRegister(result) - : DefineSameAsFirst(result); + return DefineSameAsFirst(result); } } diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index c9ac471a00..7760b46f92 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2002,45 +2002,23 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { XMMRegister left = ToDoubleRegister(instr->left()); XMMRegister right = ToDoubleRegister(instr->right()); XMMRegister 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: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vaddsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ addsd(left, right); - } + __ addsd(left, right); break; case Token::SUB: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vsubsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ subsd(left, right); - } + __ subsd(left, right); break; case Token::MUL: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vmulsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ mulsd(left, right); - } + __ mulsd(left, right); break; case Token::DIV: - if (CpuFeatures::IsSupported(AVX)) { - CpuFeatureScope scope(masm(), AVX); - __ vdivsd(result, left, right); - } else { - DCHECK(result.is(left)); - __ divsd(left, right); - // Don't delete this mov. It may improve performance on some CPUs, - // when there is a mulsd depending on the result - __ movaps(left, left); - } + __ divsd(left, right); + // Don't delete this mov. It may improve performance on some CPUs, + // when there is a mulsd depending on the result + __ movaps(left, left); break; case Token::MOD: { XMMRegister xmm_scratch = double_scratch0(); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 045cc108bb..8d79ba6512 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -748,8 +748,7 @@ LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); - return CpuFeatures::IsSupported(AVX) ? DefineAsRegister(result) - : DefineSameAsFirst(result); + return DefineSameAsFirst(result); } }