Revert "[wasm-simd][x64] Cleanup unnecessary CpuFeatureScope"
This reverts commit df20428886
.
Reason for revert: Broke noavx https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20debug/31698
Original change's description:
> [wasm-simd][x64] Cleanup unnecessary CpuFeatureScope
>
> There are a couple more left in some i64x2 ops, but those are not in the
> proposal, so I've left them as it is.
>
> Bug: v8:9561
> Change-Id: I3f6a4113c8054229eb6532d83ff16174a3208418
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2128849
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66990}
TBR=gdeepti@chromium.org,zhin@chromium.org
Change-Id: Ib42dbf70ab8ee97ed1d2f809ea305c22213ae960
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9561
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2134653
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66999}
This commit is contained in:
parent
9933cbe9dc
commit
c413526286
@ -588,6 +588,7 @@ void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen,
|
||||
|
||||
#define ASSEMBLE_SIMD_ALL_TRUE(opcode) \
|
||||
do { \
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1); \
|
||||
Register dst = i.OutputRegister(); \
|
||||
XMMRegister tmp = i.TempSimd128Register(0); \
|
||||
__ xorq(dst, dst); \
|
||||
@ -2277,6 +2278,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64F64x2Splat: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE3);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
if (instr->InputAt(0)->IsFPRegister()) {
|
||||
__ Movddup(dst, i.InputDoubleRegister(0));
|
||||
@ -2286,6 +2288,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64F64x2ReplaceLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
if (instr->InputAt(2)->IsFPRegister()) {
|
||||
__ Movq(kScratchRegister, i.InputDoubleRegister(2));
|
||||
__ Pinsrq(i.OutputSimd128Register(), kScratchRegister, i.InputInt8(1));
|
||||
@ -2295,6 +2298,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64F64x2ExtractLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pextrq(kScratchRegister, i.InputSimd128Register(0), i.InputInt8(1));
|
||||
__ Movq(i.OutputDoubleRegister(), kScratchRegister);
|
||||
break;
|
||||
@ -2439,6 +2443,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kX64F32x4UConvertI32x4: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
DCHECK_NE(i.OutputSimd128Register(), kScratchDoubleReg);
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
__ Pxor(kScratchDoubleReg, kScratchDoubleReg); // zeros
|
||||
__ Pblendw(kScratchDoubleReg, dst,
|
||||
@ -2499,6 +2504,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
}
|
||||
case kX64F32x4AddHoriz: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE3);
|
||||
__ Haddps(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
@ -2605,6 +2611,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I64x2Splat: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE3);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
if (HasRegisterInput(instr, 0)) {
|
||||
__ Movq(dst, i.InputRegister(0));
|
||||
@ -2615,10 +2622,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I64x2ExtractLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pextrq(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
case kX64I64x2ReplaceLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
if (HasRegisterInput(instr, 2)) {
|
||||
__ Pinsrq(i.OutputSimd128Register(), i.InputRegister(2),
|
||||
i.InputInt8(1));
|
||||
@ -2645,6 +2654,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
}
|
||||
case kX64I64x2ShrS: {
|
||||
// TODO(zhin): there is vpsraq but requires AVX512
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
// ShrS on each quadword one at a time
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src = i.InputSimd128Register(0);
|
||||
@ -2881,10 +2891,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4ExtractLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
case kX64I32x4ReplaceLane: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
if (HasRegisterInput(instr, 2)) {
|
||||
__ Pinsrd(i.OutputSimd128Register(), i.InputRegister(2),
|
||||
i.InputInt8(1));
|
||||
@ -2913,6 +2925,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4SConvertI16x8Low: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pmovsxwd(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
break;
|
||||
}
|
||||
@ -2923,6 +2936,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4Neg: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSSE3);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src = i.InputSimd128Register(0);
|
||||
if (dst == src) {
|
||||
@ -2949,6 +2963,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4AddHoriz: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSSE3);
|
||||
__ Phaddd(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
@ -2957,14 +2972,17 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4Mul: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pmulld(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
case kX64I32x4MinS: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pminsd(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
case kX64I32x4MaxS: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pmaxsd(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
@ -2984,6 +3002,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4GeS: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src = i.InputSimd128Register(1);
|
||||
__ Pminsd(dst, src);
|
||||
@ -2992,6 +3011,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
}
|
||||
case kX64I32x4UConvertF32x4: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister tmp = i.TempSimd128Register(0);
|
||||
XMMRegister tmp2 = i.TempSimd128Register(1);
|
||||
@ -3034,14 +3054,17 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4MinU: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pminud(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
case kX64I32x4MaxU: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ Pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1));
|
||||
break;
|
||||
}
|
||||
case kX64I32x4GtU: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src = i.InputSimd128Register(1);
|
||||
XMMRegister tmp = i.TempSimd128Register(0);
|
||||
@ -3052,6 +3075,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I32x4GeU: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src = i.InputSimd128Register(1);
|
||||
__ Pminud(dst, src);
|
||||
@ -3659,31 +3683,37 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kX64I16x8Load8x8S: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovsxbw(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
}
|
||||
case kX64I16x8Load8x8U: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovzxbw(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
}
|
||||
case kX64I32x4Load16x4S: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovsxwd(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
}
|
||||
case kX64I32x4Load16x4U: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovzxwd(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
}
|
||||
case kX64I64x2Load32x2S: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovsxdq(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
}
|
||||
case kX64I64x2Load32x2U: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, __ pc_offset());
|
||||
__ Pmovzxdq(i.OutputSimd128Register(), i.MemoryOperand());
|
||||
break;
|
||||
@ -3892,6 +3922,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kX64S1x4AnyTrue:
|
||||
case kX64S1x8AnyTrue:
|
||||
case kX64S1x16AnyTrue: {
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
Register dst = i.OutputRegister();
|
||||
XMMRegister src = i.InputSimd128Register(0);
|
||||
|
||||
@ -3905,7 +3936,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
// 0x0011, pcmpeqw returns 0x0000, ptest will set ZF to 0 and 1
|
||||
// respectively.
|
||||
case kX64S1x2AllTrue: {
|
||||
ASSEMBLE_SIMD_ALL_TRUE(Pcmpeqq);
|
||||
ASSEMBLE_SIMD_ALL_TRUE(pcmpeqq);
|
||||
break;
|
||||
}
|
||||
case kX64S1x4AllTrue: {
|
||||
|
Loading…
Reference in New Issue
Block a user