[ia32][wasm] Add I16x8 CompareOp, I16x8Neg and I8x16Neg.
I16x8 GtS/GeS/GtU/GeU I16x8Neg, I8x16Neg Add Psignb, Psignw, Psubb, Psubw macros Bug: Change-Id: Id38f15140727051e185054295722282b77ea889c Reviewed-on: https://chromium-review.googlesource.com/773831 Commit-Queue: Jing Bao <jing.bao@intel.com> Reviewed-by: Bill Budge <bbudge@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#49610}
This commit is contained in:
parent
f5a5a7785d
commit
2e8ac7bb86
@ -2016,6 +2016,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4ReplaceLane: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
|
||||
break;
|
||||
@ -2029,8 +2030,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kIA32I32x4Neg: {
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(0);
|
||||
Register ireg = Register::from_code(dst.code());
|
||||
if (src.is_reg(ireg)) {
|
||||
if (src.is_reg(dst)) {
|
||||
__ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ Psignd(dst, kScratchDoubleReg);
|
||||
} else {
|
||||
@ -2040,6 +2040,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Shl: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pslld(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2050,6 +2051,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4ShrS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psrad(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2060,6 +2062,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Add: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ paddd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2070,6 +2073,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Sub: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psubd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2080,6 +2084,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Mul: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pmulld(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2091,6 +2096,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4MinS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pminsd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2102,6 +2108,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4MaxS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pmaxsd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2113,6 +2120,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Eq: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpeqd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2123,6 +2131,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4Ne: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpeqd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
|
||||
@ -2138,6 +2147,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4GtS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpgtd(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2148,6 +2158,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4GeS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
@ -2164,6 +2175,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4ShrU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psrld(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2174,6 +2186,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4MinU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pminud(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2185,6 +2198,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4MaxU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pmaxud(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2196,6 +2210,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4GtU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
@ -2217,6 +2232,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI32x4GeU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
@ -2246,6 +2262,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8ReplaceLane: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2255,7 +2272,20 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
i.InputOperand(2), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
case kIA32I16x8Neg: {
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(0);
|
||||
if (src.is_reg(dst)) {
|
||||
__ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ Psignw(dst, kScratchDoubleReg);
|
||||
} else {
|
||||
__ Pxor(dst, dst);
|
||||
__ Psubw(dst, src);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Shl: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psllw(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2266,6 +2296,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8ShrS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psraw(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2276,6 +2307,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Add: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ paddw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2286,6 +2318,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8AddSaturateS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ paddsw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2296,6 +2329,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Sub: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psubw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2306,6 +2340,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8SubSaturateS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psubsw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2316,6 +2351,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Mul: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pmullw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2326,6 +2362,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8MinS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pminsw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2336,6 +2373,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8MaxS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pmaxsw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2346,6 +2384,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Eq: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpeqw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2356,6 +2395,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8Ne: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpeqw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
|
||||
@ -2370,7 +2410,35 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
kScratchDoubleReg);
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8GtS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ pcmpgtw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
case kAVXI16x8GtS: {
|
||||
CpuFeatureScope avx_scope(tasm(), AVX);
|
||||
__ vpcmpgtw(i.OutputSimd128Register(), i.InputSimd128Register(0),
|
||||
i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8GeS: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
__ pminsw(dst, src);
|
||||
__ pcmpeqw(dst, src);
|
||||
break;
|
||||
}
|
||||
case kAVXI16x8GeS: {
|
||||
CpuFeatureScope avx_scope(tasm(), AVX);
|
||||
XMMRegister src1 = i.InputSimd128Register(0);
|
||||
Operand src2 = i.InputOperand(1);
|
||||
__ vpminsw(kScratchDoubleReg, src1, src2);
|
||||
__ vpcmpeqw(i.OutputSimd128Register(), kScratchDoubleReg, src2);
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8ShrU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psrlw(i.OutputSimd128Register(), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
@ -2381,6 +2449,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8AddSaturateU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ paddusw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2391,6 +2460,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8SubSaturateU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
__ psubusw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
@ -2401,6 +2471,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8MinU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pminuw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2412,6 +2483,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8MaxU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pmaxuw(i.OutputSimd128Register(), i.InputOperand(1));
|
||||
break;
|
||||
@ -2422,6 +2494,45 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
i.InputOperand(1));
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8GtU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
__ pmaxuw(dst, src);
|
||||
__ pcmpeqw(dst, src);
|
||||
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ pxor(dst, kScratchDoubleReg);
|
||||
break;
|
||||
}
|
||||
case kAVXI16x8GtU: {
|
||||
CpuFeatureScope avx_scope(tasm(), AVX);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
XMMRegister src1 = i.InputSimd128Register(0);
|
||||
Operand src2 = i.InputOperand(1);
|
||||
__ vpmaxuw(kScratchDoubleReg, src1, src2);
|
||||
__ vpcmpeqw(dst, kScratchDoubleReg, src2);
|
||||
__ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ vpxor(dst, dst, kScratchDoubleReg);
|
||||
break;
|
||||
}
|
||||
case kSSEI16x8GeU: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(1);
|
||||
__ pminuw(dst, src);
|
||||
__ pcmpeqw(dst, src);
|
||||
break;
|
||||
}
|
||||
case kAVXI16x8GeU: {
|
||||
CpuFeatureScope avx_scope(tasm(), AVX);
|
||||
XMMRegister src1 = i.InputSimd128Register(0);
|
||||
Operand src2 = i.InputOperand(1);
|
||||
__ vpminuw(kScratchDoubleReg, src1, src2);
|
||||
__ vpcmpeqw(i.OutputSimd128Register(), kScratchDoubleReg, src2);
|
||||
break;
|
||||
}
|
||||
case kIA32I8x16Splat: {
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
__ Movd(dst, i.InputOperand(0));
|
||||
@ -2436,6 +2547,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
break;
|
||||
}
|
||||
case kSSEI8x16ReplaceLane: {
|
||||
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
|
||||
CpuFeatureScope sse_scope(tasm(), SSE4_1);
|
||||
__ pinsrb(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
|
||||
break;
|
||||
@ -2446,6 +2558,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
i.InputOperand(2), i.InputInt8(1));
|
||||
break;
|
||||
}
|
||||
case kIA32I8x16Neg: {
|
||||
XMMRegister dst = i.OutputSimd128Register();
|
||||
Operand src = i.InputOperand(0);
|
||||
if (src.is_reg(dst)) {
|
||||
__ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
|
||||
__ Psignb(dst, kScratchDoubleReg);
|
||||
} else {
|
||||
__ Pxor(dst, dst);
|
||||
__ Psubb(dst, src);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kCheckedLoadInt8:
|
||||
ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b);
|
||||
break;
|
||||
|
@ -152,6 +152,7 @@ namespace compiler {
|
||||
V(IA32I16x8ExtractLane) \
|
||||
V(SSEI16x8ReplaceLane) \
|
||||
V(AVXI16x8ReplaceLane) \
|
||||
V(IA32I16x8Neg) \
|
||||
V(SSEI16x8Shl) \
|
||||
V(AVXI16x8Shl) \
|
||||
V(SSEI16x8ShrS) \
|
||||
@ -174,6 +175,10 @@ namespace compiler {
|
||||
V(AVXI16x8Eq) \
|
||||
V(SSEI16x8Ne) \
|
||||
V(AVXI16x8Ne) \
|
||||
V(SSEI16x8GtS) \
|
||||
V(AVXI16x8GtS) \
|
||||
V(SSEI16x8GeS) \
|
||||
V(AVXI16x8GeS) \
|
||||
V(SSEI16x8ShrU) \
|
||||
V(AVXI16x8ShrU) \
|
||||
V(SSEI16x8AddSaturateU) \
|
||||
@ -184,10 +189,15 @@ namespace compiler {
|
||||
V(AVXI16x8MinU) \
|
||||
V(SSEI16x8MaxU) \
|
||||
V(AVXI16x8MaxU) \
|
||||
V(SSEI16x8GtU) \
|
||||
V(AVXI16x8GtU) \
|
||||
V(SSEI16x8GeU) \
|
||||
V(AVXI16x8GeU) \
|
||||
V(IA32I8x16Splat) \
|
||||
V(IA32I8x16ExtractLane) \
|
||||
V(SSEI8x16ReplaceLane) \
|
||||
V(AVXI8x16ReplaceLane)
|
||||
V(AVXI8x16ReplaceLane) \
|
||||
V(IA32I8x16Neg)
|
||||
|
||||
// Addressing modes represent the "shape" of inputs to an instruction.
|
||||
// Many instructions support multiple addressing modes. Addressing modes
|
||||
|
@ -138,6 +138,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
|
||||
case kIA32I16x8ExtractLane:
|
||||
case kSSEI16x8ReplaceLane:
|
||||
case kAVXI16x8ReplaceLane:
|
||||
case kIA32I16x8Neg:
|
||||
case kSSEI16x8Shl:
|
||||
case kAVXI16x8Shl:
|
||||
case kSSEI16x8ShrS:
|
||||
@ -160,6 +161,10 @@ int InstructionScheduler::GetTargetInstructionFlags(
|
||||
case kAVXI16x8Eq:
|
||||
case kSSEI16x8Ne:
|
||||
case kAVXI16x8Ne:
|
||||
case kSSEI16x8GtS:
|
||||
case kAVXI16x8GtS:
|
||||
case kSSEI16x8GeS:
|
||||
case kAVXI16x8GeS:
|
||||
case kSSEI16x8ShrU:
|
||||
case kAVXI16x8ShrU:
|
||||
case kSSEI16x8AddSaturateU:
|
||||
@ -170,10 +175,15 @@ int InstructionScheduler::GetTargetInstructionFlags(
|
||||
case kAVXI16x8MinU:
|
||||
case kSSEI16x8MaxU:
|
||||
case kAVXI16x8MaxU:
|
||||
case kSSEI16x8GtU:
|
||||
case kAVXI16x8GtU:
|
||||
case kSSEI16x8GeU:
|
||||
case kAVXI16x8GeU:
|
||||
case kIA32I8x16Splat:
|
||||
case kIA32I8x16ExtractLane:
|
||||
case kSSEI8x16ReplaceLane:
|
||||
case kAVXI8x16ReplaceLane:
|
||||
case kIA32I8x16Neg:
|
||||
return (instr->addressing_mode() == kMode_None)
|
||||
? kNoOpcodeFlags
|
||||
: kIsLoadOperation | kHasSideEffect;
|
||||
|
@ -1925,12 +1925,19 @@ VISIT_ATOMIC_BINOP(Xor)
|
||||
V(I16x8MaxS) \
|
||||
V(I16x8Eq) \
|
||||
V(I16x8Ne) \
|
||||
V(I16x8GtS) \
|
||||
V(I16x8GeS) \
|
||||
V(I16x8AddSaturateU) \
|
||||
V(I16x8SubSaturateU) \
|
||||
V(I16x8MinU) \
|
||||
V(I16x8MaxU)
|
||||
V(I16x8MaxU) \
|
||||
V(I16x8GtU) \
|
||||
V(I16x8GeU)
|
||||
|
||||
#define SIMD_UNOP_LIST(V) V(I32x4Neg)
|
||||
#define SIMD_UNOP_LIST(V) \
|
||||
V(I32x4Neg) \
|
||||
V(I16x8Neg) \
|
||||
V(I8x16Neg)
|
||||
|
||||
#define SIMD_SHIFT_OPCODES(V) \
|
||||
V(I32x4Shl) \
|
||||
|
@ -2283,16 +2283,12 @@ void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
|
||||
void InstructionSelector::VisitI16x8MinU(Node* node) { UNIMPLEMENTED(); }
|
||||
|
||||
void InstructionSelector::VisitI16x8MaxU(Node* node) { UNIMPLEMENTED(); }
|
||||
|
||||
void InstructionSelector::VisitI16x8Neg(Node* node) { UNIMPLEMENTED(); }
|
||||
#endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
|
||||
// && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_MIPS &&
|
||||
// !V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
|
||||
!V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
|
||||
void InstructionSelector::VisitI16x8Neg(Node* node) { UNIMPLEMENTED(); }
|
||||
#endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
|
||||
// && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
|
||||
!V8_TARGET_ARCH_MIPS64
|
||||
void InstructionSelector::VisitI16x8UConvertI32x4(Node* node) {
|
||||
@ -2310,7 +2306,7 @@ void InstructionSelector::VisitI16x8UConvertI8x16High(Node* node) {
|
||||
// && !V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
|
||||
!V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
|
||||
!V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
|
||||
void InstructionSelector::VisitI16x8GtS(Node* node) { UNIMPLEMENTED(); }
|
||||
|
||||
void InstructionSelector::VisitI16x8GeS(Node* node) { UNIMPLEMENTED(); }
|
||||
@ -2321,7 +2317,8 @@ void InstructionSelector::VisitI16x8GeU(Node* node) { UNIMPLEMENTED(); }
|
||||
|
||||
void InstructionSelector::VisitI8x16Neg(Node* node) { UNIMPLEMENTED(); }
|
||||
#endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
|
||||
// && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
|
||||
// && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_MIPS &&
|
||||
// !V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
|
||||
!V8_TARGET_ARCH_MIPS64
|
||||
|
@ -295,12 +295,6 @@ Operand::Operand(Register index,
|
||||
}
|
||||
|
||||
|
||||
bool Operand::is_reg(Register reg) const {
|
||||
return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
|
||||
&& ((buf_[0] & 0x07) == reg.code()); // register codes match.
|
||||
}
|
||||
|
||||
|
||||
bool Operand::is_reg_only() const {
|
||||
return (buf_[0] & 0xF8) == 0xC0; // Addressing mode is register only.
|
||||
}
|
||||
|
@ -392,7 +392,8 @@ class Operand BASE_EMBEDDED {
|
||||
}
|
||||
|
||||
// Returns true if this Operand is a wrapper for the specified register.
|
||||
bool is_reg(Register reg) const;
|
||||
bool is_reg(Register reg) const { return is_reg(reg.code()); }
|
||||
bool is_reg(XMMRegister reg) const { return is_reg(reg.code()); }
|
||||
|
||||
// Returns true if this Operand is a wrapper for one register.
|
||||
bool is_reg_only() const;
|
||||
@ -420,6 +421,11 @@ class Operand BASE_EMBEDDED {
|
||||
rmode_ = rmode;
|
||||
}
|
||||
|
||||
inline bool is_reg(int reg_code) const {
|
||||
return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
|
||||
&& ((buf_[0] & 0x07) == reg_code); // register codes match.
|
||||
}
|
||||
|
||||
byte buf_[6];
|
||||
// The number of bytes in buf_.
|
||||
unsigned int len_;
|
||||
|
@ -1253,6 +1253,34 @@ void TurboAssembler::Pshufd(XMMRegister dst, const Operand& src,
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::Psignb(XMMRegister dst, const Operand& src) {
|
||||
if (CpuFeatures::IsSupported(AVX)) {
|
||||
CpuFeatureScope scope(this, AVX);
|
||||
vpsignb(dst, dst, src);
|
||||
return;
|
||||
}
|
||||
if (CpuFeatures::IsSupported(SSSE3)) {
|
||||
CpuFeatureScope sse_scope(this, SSSE3);
|
||||
psignb(dst, src);
|
||||
return;
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void TurboAssembler::Psignw(XMMRegister dst, const Operand& src) {
|
||||
if (CpuFeatures::IsSupported(AVX)) {
|
||||
CpuFeatureScope scope(this, AVX);
|
||||
vpsignw(dst, dst, src);
|
||||
return;
|
||||
}
|
||||
if (CpuFeatures::IsSupported(SSSE3)) {
|
||||
CpuFeatureScope sse_scope(this, SSSE3);
|
||||
psignw(dst, src);
|
||||
return;
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void TurboAssembler::Psignd(XMMRegister dst, const Operand& src) {
|
||||
if (CpuFeatures::IsSupported(AVX)) {
|
||||
CpuFeatureScope scope(this, AVX);
|
||||
|
@ -237,6 +237,8 @@ class TurboAssembler : public Assembler {
|
||||
AVX_OP3_WITH_TYPE(macro_name, name, XMMRegister, const Operand&)
|
||||
|
||||
AVX_OP3_XO(Pcmpeqd, pcmpeqd)
|
||||
AVX_OP3_XO(Psubb, psubb)
|
||||
AVX_OP3_XO(Psubw, psubw)
|
||||
AVX_OP3_XO(Psubd, psubd)
|
||||
AVX_OP3_XO(Pxor, pxor)
|
||||
|
||||
@ -246,6 +248,11 @@ class TurboAssembler : public Assembler {
|
||||
// Non-SSE2 instructions.
|
||||
void Pshufb(XMMRegister dst, XMMRegister src) { Pshufb(dst, Operand(src)); }
|
||||
void Pshufb(XMMRegister dst, const Operand& src);
|
||||
|
||||
void Psignb(XMMRegister dst, XMMRegister src) { Psignb(dst, Operand(src)); }
|
||||
void Psignb(XMMRegister dst, const Operand& src);
|
||||
void Psignw(XMMRegister dst, XMMRegister src) { Psignw(dst, Operand(src)); }
|
||||
void Psignw(XMMRegister dst, const Operand& src);
|
||||
void Psignd(XMMRegister dst, XMMRegister src) { Psignd(dst, Operand(src)); }
|
||||
void Psignd(XMMRegister dst, const Operand& src);
|
||||
|
||||
|
@ -1113,8 +1113,6 @@ WASM_SIMD_COMPILED_TEST(I16x8ConvertI8x16) {
|
||||
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS ||
|
||||
// V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \
|
||||
V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_X64
|
||||
void RunI16x8UnOpTest(WasmExecutionMode execution_mode, WasmOpcode simd_op,
|
||||
Int16UnOp expected_op) {
|
||||
WasmRunner<int32_t, int32_t, int32_t> r(execution_mode);
|
||||
@ -1131,8 +1129,6 @@ void RunI16x8UnOpTest(WasmExecutionMode execution_mode, WasmOpcode simd_op,
|
||||
WASM_SIMD_TEST(I16x8Neg) {
|
||||
RunI16x8UnOpTest(execution_mode, kExprI16x8Neg, Negate);
|
||||
}
|
||||
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS ||
|
||||
// V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_X64
|
||||
|
||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \
|
||||
V8_TARGET_ARCH_MIPS64
|
||||
@ -1258,8 +1254,6 @@ WASM_SIMD_TEST(I16x8Ne) {
|
||||
RunI16x8CompareOpTest(execution_mode, kExprI16x8Ne, NotEqual);
|
||||
}
|
||||
|
||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || \
|
||||
V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
|
||||
WASM_SIMD_TEST(I16x8LtS) {
|
||||
RunI16x8CompareOpTest(execution_mode, kExprI16x8LtS, Less);
|
||||
}
|
||||
@ -1291,8 +1285,6 @@ WASM_SIMD_TEST(I16x8LtU) {
|
||||
WASM_SIMD_TEST(I16x8LeU) {
|
||||
RunI16x8CompareOpTest(execution_mode, kExprI16x8LeU, UnsignedLessEqual);
|
||||
}
|
||||
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 ||
|
||||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
|
||||
|
||||
void RunI16x8ShiftOpTest(WasmExecutionMode execution_mode, WasmOpcode simd_op,
|
||||
Int16ShiftOp expected_op, int shift) {
|
||||
@ -1320,8 +1312,6 @@ WASM_SIMD_TEST(I16x8ShrU) {
|
||||
RunI16x8ShiftOpTest(execution_mode, kExprI16x8ShrU, LogicalShiftRight, 1);
|
||||
}
|
||||
|
||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || \
|
||||
V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
|
||||
void RunI8x16UnOpTest(WasmExecutionMode execution_mode, WasmOpcode simd_op,
|
||||
Int8UnOp expected_op) {
|
||||
WasmRunner<int32_t, int32_t, int32_t> r(execution_mode);
|
||||
@ -1338,8 +1328,6 @@ void RunI8x16UnOpTest(WasmExecutionMode execution_mode, WasmOpcode simd_op,
|
||||
WASM_SIMD_TEST(I8x16Neg) {
|
||||
RunI8x16UnOpTest(execution_mode, kExprI8x16Neg, Negate);
|
||||
}
|
||||
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 ||
|
||||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
|
||||
|
||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \
|
||||
V8_TARGET_ARCH_MIPS64
|
||||
|
Loading…
Reference in New Issue
Block a user