Reason for revert:
Breaks chromium vista and XP browser tests:
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_vista_rel_ng/builds/23
Original issue's description:
> [x86] Use AVX in Crankshaft when available.
>
> R=verwaest@chromium.org
>
> Committed: https://crrev.com/
622be8f71e70b6ece4ea6a89bcfa1bc4be5e70c1
> Cr-Commit-Position: refs/heads/master@{#26159}
TBR=verwaest@chromium.org,bmeurer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/
863423002
Cr-Commit-Position: refs/heads/master@{#26230}
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.
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);
}
}
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();
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);
}
}