Commit 6c9c3569 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

s390 [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: I3d7a0435d7b7c8f21217863c3aa894ae5b90afae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2653808Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72378}
parent 848137c4
...@@ -4246,6 +4246,33 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -4246,6 +4246,33 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
#undef Q15_MUL_ROAUND #undef Q15_MUL_ROAUND
#define SIGN_SELECT(mode) \
Simd128Register src0 = i.InputSimd128Register(0); \
Simd128Register src1 = i.InputSimd128Register(1); \
Simd128Register src2 = i.InputSimd128Register(2); \
Simd128Register dst = i.OutputSimd128Register(); \
__ vx(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg, Condition(0), \
Condition(0), Condition(3)); \
__ vch(kScratchDoubleReg, kScratchDoubleReg, src2, Condition(0), \
Condition(mode)); \
__ vsel(dst, src0, src1, kScratchDoubleReg, Condition(0), Condition(0));
case kS390_I8x16SignSelect: {
SIGN_SELECT(0)
break;
}
case kS390_I16x8SignSelect: {
SIGN_SELECT(1)
break;
}
case kS390_I32x4SignSelect: {
SIGN_SELECT(2)
break;
}
case kS390_I64x2SignSelect: {
SIGN_SELECT(3)
break;
}
#undef SIGN_SELECT
case kS390_StoreCompressTagged: { case kS390_StoreCompressTagged: {
CHECK(!instr->HasOutput()); CHECK(!instr->HasOutput());
size_t index = 0; size_t index = 0;
......
...@@ -263,6 +263,7 @@ namespace compiler { ...@@ -263,6 +263,7 @@ namespace compiler {
V(S390_I64x2SConvertI32x4High) \ V(S390_I64x2SConvertI32x4High) \
V(S390_I64x2UConvertI32x4Low) \ V(S390_I64x2UConvertI32x4Low) \
V(S390_I64x2UConvertI32x4High) \ V(S390_I64x2UConvertI32x4High) \
V(S390_I64x2SignSelect) \
V(S390_I32x4Splat) \ V(S390_I32x4Splat) \
V(S390_I32x4ExtractLane) \ V(S390_I32x4ExtractLane) \
V(S390_I32x4ReplaceLane) \ V(S390_I32x4ReplaceLane) \
...@@ -299,6 +300,7 @@ namespace compiler { ...@@ -299,6 +300,7 @@ namespace compiler {
V(S390_I32x4ExtMulHighI16x8U) \ V(S390_I32x4ExtMulHighI16x8U) \
V(S390_I32x4ExtAddPairwiseI16x8S) \ V(S390_I32x4ExtAddPairwiseI16x8S) \
V(S390_I32x4ExtAddPairwiseI16x8U) \ V(S390_I32x4ExtAddPairwiseI16x8U) \
V(S390_I32x4SignSelect) \
V(S390_I16x8Splat) \ V(S390_I16x8Splat) \
V(S390_I16x8ExtractLaneU) \ V(S390_I16x8ExtractLaneU) \
V(S390_I16x8ExtractLaneS) \ V(S390_I16x8ExtractLaneS) \
...@@ -341,6 +343,7 @@ namespace compiler { ...@@ -341,6 +343,7 @@ namespace compiler {
V(S390_I16x8ExtAddPairwiseI8x16S) \ V(S390_I16x8ExtAddPairwiseI8x16S) \
V(S390_I16x8ExtAddPairwiseI8x16U) \ V(S390_I16x8ExtAddPairwiseI8x16U) \
V(S390_I16x8Q15MulRSatS) \ V(S390_I16x8Q15MulRSatS) \
V(S390_I16x8SignSelect) \
V(S390_I8x16Splat) \ V(S390_I8x16Splat) \
V(S390_I8x16ExtractLaneU) \ V(S390_I8x16ExtractLaneU) \
V(S390_I8x16ExtractLaneS) \ V(S390_I8x16ExtractLaneS) \
...@@ -373,6 +376,7 @@ namespace compiler { ...@@ -373,6 +376,7 @@ namespace compiler {
V(S390_I8x16BitMask) \ V(S390_I8x16BitMask) \
V(S390_I8x16Shuffle) \ V(S390_I8x16Shuffle) \
V(S390_I8x16Swizzle) \ V(S390_I8x16Swizzle) \
V(S390_I8x16SignSelect) \
V(S390_V32x4AnyTrue) \ V(S390_V32x4AnyTrue) \
V(S390_V16x8AnyTrue) \ V(S390_V16x8AnyTrue) \
V(S390_V8x16AnyTrue) \ V(S390_V8x16AnyTrue) \
......
...@@ -210,6 +210,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -210,6 +210,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kS390_I64x2SConvertI32x4High: case kS390_I64x2SConvertI32x4High:
case kS390_I64x2UConvertI32x4Low: case kS390_I64x2UConvertI32x4Low:
case kS390_I64x2UConvertI32x4High: case kS390_I64x2UConvertI32x4High:
case kS390_I64x2SignSelect:
case kS390_I32x4Splat: case kS390_I32x4Splat:
case kS390_I32x4ExtractLane: case kS390_I32x4ExtractLane:
case kS390_I32x4ReplaceLane: case kS390_I32x4ReplaceLane:
...@@ -246,6 +247,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -246,6 +247,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kS390_I32x4ExtMulHighI16x8U: case kS390_I32x4ExtMulHighI16x8U:
case kS390_I32x4ExtAddPairwiseI16x8S: case kS390_I32x4ExtAddPairwiseI16x8S:
case kS390_I32x4ExtAddPairwiseI16x8U: case kS390_I32x4ExtAddPairwiseI16x8U:
case kS390_I32x4SignSelect:
case kS390_I16x8Splat: case kS390_I16x8Splat:
case kS390_I16x8ExtractLaneU: case kS390_I16x8ExtractLaneU:
case kS390_I16x8ExtractLaneS: case kS390_I16x8ExtractLaneS:
...@@ -288,6 +290,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -288,6 +290,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kS390_I16x8ExtAddPairwiseI8x16S: case kS390_I16x8ExtAddPairwiseI8x16S:
case kS390_I16x8ExtAddPairwiseI8x16U: case kS390_I16x8ExtAddPairwiseI8x16U:
case kS390_I16x8Q15MulRSatS: case kS390_I16x8Q15MulRSatS:
case kS390_I16x8SignSelect:
case kS390_I8x16Splat: case kS390_I8x16Splat:
case kS390_I8x16ExtractLaneU: case kS390_I8x16ExtractLaneU:
case kS390_I8x16ExtractLaneS: case kS390_I8x16ExtractLaneS:
...@@ -320,6 +323,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -320,6 +323,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kS390_I8x16BitMask: case kS390_I8x16BitMask:
case kS390_I8x16Shuffle: case kS390_I8x16Shuffle:
case kS390_I8x16Swizzle: case kS390_I8x16Swizzle:
case kS390_I8x16SignSelect:
case kS390_V32x4AnyTrue: case kS390_V32x4AnyTrue:
case kS390_V16x8AnyTrue: case kS390_V16x8AnyTrue:
case kS390_V8x16AnyTrue: case kS390_V8x16AnyTrue:
......
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