Commit e13967c3 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

s390: [wasm-simd] Simplify S8x16Shuffle on s390

Change-Id: I52fc8025a4a878e4494ef9134a8c2bd1cec25fe1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289903Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#68763}
parent 6daf6911
...@@ -4173,14 +4173,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -4173,14 +4173,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
// create 2 * 8 byte inputs indicating new indices // create 2 * 8 byte inputs indicating new indices
for (int i = 0, j = 0; i < 2; i++, j = +2) { for (int i = 0, j = 0; i < 2; i++, j = +2) {
#ifdef V8_TARGET_BIG_ENDIAN #ifdef V8_TARGET_BIG_ENDIAN
__ lgfi(i < 1 ? ip : r0, Operand(k8x16_indices[j + 1]));
__ iihf(i < 1 ? ip : r0, Operand(k8x16_indices[j]));
#else
__ lgfi(i < 1 ? ip : r0, Operand(k8x16_indices[j])); __ lgfi(i < 1 ? ip : r0, Operand(k8x16_indices[j]));
__ iihf(i < 1 ? ip : r0, Operand(k8x16_indices[j + 1])); __ iihf(i < 1 ? ip : r0, Operand(k8x16_indices[j + 1]));
#else
__ lgfi(i < 1 ? r0 : ip, Operand(k8x16_indices[j]));
__ iihf(i < 1 ? r0 : ip, Operand(k8x16_indices[j + 1]));
#endif #endif
} }
__ vlvgp(kScratchDoubleReg, ip, r0); __ vlvgp(kScratchDoubleReg, r0, ip);
__ vperm(dst, src0, src1, kScratchDoubleReg, Condition(0), Condition(0)); __ vperm(dst, src0, src1, kScratchDoubleReg, Condition(0), Condition(0));
break; break;
} }
......
...@@ -2834,6 +2834,7 @@ SIMD_VISIT_PMIN_MAX(F32x4Pmax) ...@@ -2834,6 +2834,7 @@ SIMD_VISIT_PMIN_MAX(F32x4Pmax)
void InstructionSelector::VisitS8x16Shuffle(Node* node) { void InstructionSelector::VisitS8x16Shuffle(Node* node) {
uint8_t shuffle[kSimd128Size]; uint8_t shuffle[kSimd128Size];
uint8_t* shuffle_p = &shuffle[0];
bool is_swizzle; bool is_swizzle;
CanonicalizeShuffle(node, shuffle, &is_swizzle); CanonicalizeShuffle(node, shuffle, &is_swizzle);
S390OperandGenerator g(this); S390OperandGenerator g(this);
...@@ -2851,22 +2852,14 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { ...@@ -2851,22 +2852,14 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) {
? max_index - current_index ? max_index - current_index
: total_lane_count - current_index + max_index); : total_lane_count - current_index + max_index);
} }
Emit(kS390_S8x16Shuffle, g.DefineAsRegister(node), g.UseRegister(input0), shuffle_p = &shuffle_remapped[0];
g.UseRegister(input1), #endif
// Pack4Lanes reverses the bytes, therefore we will need to pass it in
// reverse
g.UseImmediate(Pack4Lanes(shuffle_remapped + 12)),
g.UseImmediate(Pack4Lanes(shuffle_remapped + 8)),
g.UseImmediate(Pack4Lanes(shuffle_remapped + 4)),
g.UseImmediate(Pack4Lanes(shuffle_remapped)));
#else
Emit(kS390_S8x16Shuffle, g.DefineAsRegister(node), Emit(kS390_S8x16Shuffle, g.DefineAsRegister(node),
g.UseUniqueRegister(input0), g.UseUniqueRegister(input1), g.UseUniqueRegister(input0), g.UseUniqueRegister(input1),
g.UseImmediate(Pack4Lanes(shuffle)), g.UseImmediate(Pack4Lanes(shuffle_p)),
g.UseImmediate(Pack4Lanes(shuffle + 4)), g.UseImmediate(Pack4Lanes(shuffle_p + 4)),
g.UseImmediate(Pack4Lanes(shuffle + 8)), g.UseImmediate(Pack4Lanes(shuffle_p + 8)),
g.UseImmediate(Pack4Lanes(shuffle + 12))); g.UseImmediate(Pack4Lanes(shuffle_p + 12)));
#endif
} }
void InstructionSelector::VisitS8x16Swizzle(Node* node) { void InstructionSelector::VisitS8x16Swizzle(Node* node) {
......
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