Commit d46ea552 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

PPC [wasm-simd]: Prototype sign select

Code fo Instruction Selection is added to the comments
and should be added when opcode is moved out of being a prototype.

Bug: v8:10983
Change-Id: I55948208e0ba0e903b267e0ca3e5815cb673d264
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2642155Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72241}
parent 9a534a20
......@@ -3742,6 +3742,31 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1), kScratchSimd128Reg);
break;
}
#define SIGN_SELECT(compare_gt) \
Simd128Register src0 = i.InputSimd128Register(0); \
Simd128Register src1 = i.InputSimd128Register(1); \
Simd128Register src2 = i.InputSimd128Register(2); \
Simd128Register dst = i.OutputSimd128Register(); \
__ vxor(kScratchSimd128Reg, kScratchSimd128Reg, kScratchSimd128Reg); \
__ compare_gt(kScratchSimd128Reg, kScratchSimd128Reg, src2); \
__ vsel(dst, src1, src0, kScratchSimd128Reg);
case kPPC_I8x16SignSelect: {
SIGN_SELECT(vcmpgtsb)
break;
}
case kPPC_I16x8SignSelect: {
SIGN_SELECT(vcmpgtsh)
break;
}
case kPPC_I32x4SignSelect: {
SIGN_SELECT(vcmpgtsw)
break;
}
case kPPC_I64x2SignSelect: {
SIGN_SELECT(vcmpgtsd)
break;
}
#undef SIGN_SELECT
case kPPC_StoreCompressTagged: {
ASSEMBLE_STORE_INTEGER(StoreTaggedField, StoreTaggedFieldX);
break;
......
......@@ -268,6 +268,7 @@ namespace compiler {
V(PPC_I64x2SConvertI32x4High) \
V(PPC_I64x2UConvertI32x4Low) \
V(PPC_I64x2UConvertI32x4High) \
V(PPC_I64x2SignSelect) \
V(PPC_I32x4Splat) \
V(PPC_I32x4ExtractLane) \
V(PPC_I32x4ReplaceLane) \
......@@ -300,6 +301,7 @@ namespace compiler {
V(PPC_I32x4DotI16x8S) \
V(PPC_I32x4ExtAddPairwiseI16x8S) \
V(PPC_I32x4ExtAddPairwiseI16x8U) \
V(PPC_I32x4SignSelect) \
V(PPC_F32x4Qfma) \
V(PPC_F32x4Qfms) \
V(PPC_I16x8Splat) \
......@@ -340,6 +342,7 @@ namespace compiler {
V(PPC_I16x8ExtAddPairwiseI8x16S) \
V(PPC_I16x8ExtAddPairwiseI8x16U) \
V(PPC_I16x8Q15MulRSatS) \
V(PPC_I16x8SignSelect) \
V(PPC_I8x16Splat) \
V(PPC_I8x16ExtractLaneU) \
V(PPC_I8x16ExtractLaneS) \
......@@ -372,6 +375,7 @@ namespace compiler {
V(PPC_I8x16Shuffle) \
V(PPC_I8x16Swizzle) \
V(PPC_I8x16BitMask) \
V(PPC_I8x16SignSelect) \
V(PPC_V64x2AnyTrue) \
V(PPC_V32x4AnyTrue) \
V(PPC_V16x8AnyTrue) \
......
......@@ -193,6 +193,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kPPC_I64x2SConvertI32x4High:
case kPPC_I64x2UConvertI32x4Low:
case kPPC_I64x2UConvertI32x4High:
case kPPC_I64x2SignSelect:
case kPPC_I32x4Splat:
case kPPC_I32x4ExtractLane:
case kPPC_I32x4ReplaceLane:
......@@ -225,6 +226,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kPPC_I32x4DotI16x8S:
case kPPC_I32x4ExtAddPairwiseI16x8S:
case kPPC_I32x4ExtAddPairwiseI16x8U:
case kPPC_I32x4SignSelect:
case kPPC_I16x8Splat:
case kPPC_I16x8ExtractLaneU:
case kPPC_I16x8ExtractLaneS:
......@@ -263,6 +265,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kPPC_I16x8ExtAddPairwiseI8x16S:
case kPPC_I16x8ExtAddPairwiseI8x16U:
case kPPC_I16x8Q15MulRSatS:
case kPPC_I16x8SignSelect:
case kPPC_I8x16Splat:
case kPPC_I8x16ExtractLaneU:
case kPPC_I8x16ExtractLaneS:
......@@ -295,6 +298,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kPPC_I8x16Shuffle:
case kPPC_I8x16Swizzle:
case kPPC_I8x16BitMask:
case kPPC_I8x16SignSelect:
case kPPC_V64x2AnyTrue:
case kPPC_V32x4AnyTrue:
case kPPC_V16x8AnyTrue:
......
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