Commit 3b329c5b authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[x64] Use AVX instructions consistently if available

For float to int conversions and vice versa the MacroAssembler on x64
was using a mix of AVX and non-AVX instructions.
This CL fixes that to consistently use AVX if available.

R=jkummerow@chromium.org

Change-Id: I3aecda9b99881254b24949ced5bed870fdc2a754
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1678361Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62387}
parent a8fccd95
...@@ -917,7 +917,7 @@ void TurboAssembler::Cvtqui2ss(XMMRegister dst, Register src) { ...@@ -917,7 +917,7 @@ void TurboAssembler::Cvtqui2ss(XMMRegister dst, Register src) {
orq(kScratchRegister, Immediate(1)); orq(kScratchRegister, Immediate(1));
bind(&msb_not_set); bind(&msb_not_set);
Cvtqsi2ss(dst, kScratchRegister); Cvtqsi2ss(dst, kScratchRegister);
addss(dst, dst); Addss(dst, dst);
bind(&done); bind(&done);
} }
...@@ -941,7 +941,7 @@ void TurboAssembler::Cvtqui2sd(XMMRegister dst, Register src) { ...@@ -941,7 +941,7 @@ void TurboAssembler::Cvtqui2sd(XMMRegister dst, Register src) {
orq(kScratchRegister, Immediate(1)); orq(kScratchRegister, Immediate(1));
bind(&msb_not_set); bind(&msb_not_set);
Cvtqsi2sd(dst, kScratchRegister); Cvtqsi2sd(dst, kScratchRegister);
addsd(dst, dst); Addsd(dst, dst);
bind(&done); bind(&done);
} }
...@@ -1042,11 +1042,11 @@ void ConvertFloatToUint64(TurboAssembler* tasm, Register dst, ...@@ -1042,11 +1042,11 @@ void ConvertFloatToUint64(TurboAssembler* tasm, Register dst,
// and convert it again to see if it is within the uint64 range. // and convert it again to see if it is within the uint64 range.
if (is_double) { if (is_double) {
tasm->Move(kScratchDoubleReg, -9223372036854775808.0); tasm->Move(kScratchDoubleReg, -9223372036854775808.0);
tasm->addsd(kScratchDoubleReg, src); tasm->Addsd(kScratchDoubleReg, src);
tasm->Cvttsd2siq(dst, kScratchDoubleReg); tasm->Cvttsd2siq(dst, kScratchDoubleReg);
} else { } else {
tasm->Move(kScratchDoubleReg, -9223372036854775808.0f); tasm->Move(kScratchDoubleReg, -9223372036854775808.0f);
tasm->addss(kScratchDoubleReg, src); tasm->Addss(kScratchDoubleReg, src);
tasm->Cvttss2siq(dst, kScratchDoubleReg); tasm->Cvttss2siq(dst, kScratchDoubleReg);
} }
tasm->testq(dst, dst); tasm->testq(dst, dst);
......
...@@ -132,6 +132,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -132,6 +132,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
AVX_OP(Psllq, psllq) AVX_OP(Psllq, psllq)
AVX_OP(Psrld, psrld) AVX_OP(Psrld, psrld)
AVX_OP(Psrlq, psrlq) AVX_OP(Psrlq, psrlq)
AVX_OP(Addss, addss)
AVX_OP(Addsd, addsd) AVX_OP(Addsd, addsd)
AVX_OP(Mulsd, mulsd) AVX_OP(Mulsd, mulsd)
AVX_OP(Andps, andps) AVX_OP(Andps, andps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment