diff --git a/src/compiler/backend/arm/code-generator-arm.cc b/src/compiler/backend/arm/code-generator-arm.cc index b20977ed5225..2c7e85623929 100644 --- a/src/compiler/backend/arm/code-generator-arm.cc +++ b/src/compiler/backend/arm/code-generator-arm.cc @@ -3097,7 +3097,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1), i.InputInt4(2)); break; } - case kArmS8x16Swizzle: { + case kArmI8x16Swizzle: { Simd128Register dst = i.OutputSimd128Register(), tbl = i.InputSimd128Register(0), src = i.InputSimd128Register(1); @@ -3106,7 +3106,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ vtbl(dst.high(), table, src.high()); break; } - case kArmS8x16Shuffle: { + case kArmI8x16Shuffle: { Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), src1 = i.InputSimd128Register(1); diff --git a/src/compiler/backend/arm/instruction-codes-arm.h b/src/compiler/backend/arm/instruction-codes-arm.h index 64707cb61248..b3ee561e2791 100644 --- a/src/compiler/backend/arm/instruction-codes-arm.h +++ b/src/compiler/backend/arm/instruction-codes-arm.h @@ -307,8 +307,8 @@ namespace compiler { V(ArmS8x16TransposeLeft) \ V(ArmS8x16TransposeRight) \ V(ArmS8x16Concat) \ - V(ArmS8x16Swizzle) \ - V(ArmS8x16Shuffle) \ + V(ArmI8x16Swizzle) \ + V(ArmI8x16Shuffle) \ V(ArmS32x2Reverse) \ V(ArmS16x4Reverse) \ V(ArmS16x2Reverse) \ diff --git a/src/compiler/backend/arm/instruction-scheduler-arm.cc b/src/compiler/backend/arm/instruction-scheduler-arm.cc index aa9fa9e17bc8..6459d22a117a 100644 --- a/src/compiler/backend/arm/instruction-scheduler-arm.cc +++ b/src/compiler/backend/arm/instruction-scheduler-arm.cc @@ -287,8 +287,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kArmS8x16TransposeLeft: case kArmS8x16TransposeRight: case kArmS8x16Concat: - case kArmS8x16Swizzle: - case kArmS8x16Shuffle: + case kArmI8x16Swizzle: + case kArmI8x16Shuffle: case kArmS32x2Reverse: case kArmS16x4Reverse: case kArmS16x2Reverse: diff --git a/src/compiler/backend/arm/instruction-selector-arm.cc b/src/compiler/backend/arm/instruction-selector-arm.cc index c53c8f372e64..e868a1a47ae6 100644 --- a/src/compiler/backend/arm/instruction-selector-arm.cc +++ b/src/compiler/backend/arm/instruction-selector-arm.cc @@ -2870,7 +2870,7 @@ void ArrangeShuffleTable(ArmOperandGenerator* g, Node* input0, Node* input1, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -2923,18 +2923,18 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { // Code generator uses vtbl, arrange sources to form a valid lookup table. InstructionOperand src0, src1; ArrangeShuffleTable(&g, input0, input1, &src0, &src1); - Emit(kArmS8x16Shuffle, g.DefineAsRegister(node), src0, src1, + Emit(kArmI8x16Shuffle, g.DefineAsRegister(node), src0, src1, g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 4)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 8)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 12))); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { ArmOperandGenerator g(this); // We don't want input 0 (the table) to be the same as output, since we will // modify output twice (low and high), and need to keep the table the same. - Emit(kArmS8x16Swizzle, g.DefineAsRegister(node), + Emit(kArmI8x16Swizzle, g.DefineAsRegister(node), g.UseUniqueRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); } diff --git a/src/compiler/backend/arm64/code-generator-arm64.cc b/src/compiler/backend/arm64/code-generator-arm64.cc index 882e95ef690a..65245024087c 100644 --- a/src/compiler/backend/arm64/code-generator-arm64.cc +++ b/src/compiler/backend/arm64/code-generator-arm64.cc @@ -2551,12 +2551,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1).V16B(), i.InputInt4(2)); break; } - case kArm64S8x16Swizzle: { + case kArm64I8x16Swizzle: { __ Tbl(i.OutputSimd128Register().V16B(), i.InputSimd128Register(0).V16B(), i.InputSimd128Register(1).V16B()); break; } - case kArm64S8x16Shuffle: { + case kArm64I8x16Shuffle: { Simd128Register dst = i.OutputSimd128Register().V16B(), src0 = i.InputSimd128Register(0).V16B(), src1 = i.InputSimd128Register(1).V16B(); diff --git a/src/compiler/backend/arm64/instruction-codes-arm64.h b/src/compiler/backend/arm64/instruction-codes-arm64.h index 26a48b7bf493..7f84a3504bfe 100644 --- a/src/compiler/backend/arm64/instruction-codes-arm64.h +++ b/src/compiler/backend/arm64/instruction-codes-arm64.h @@ -367,8 +367,8 @@ namespace compiler { V(Arm64S8x16TransposeLeft) \ V(Arm64S8x16TransposeRight) \ V(Arm64S8x16Concat) \ - V(Arm64S8x16Swizzle) \ - V(Arm64S8x16Shuffle) \ + V(Arm64I8x16Swizzle) \ + V(Arm64I8x16Shuffle) \ V(Arm64S32x2Reverse) \ V(Arm64S16x4Reverse) \ V(Arm64S16x2Reverse) \ diff --git a/src/compiler/backend/arm64/instruction-scheduler-arm64.cc b/src/compiler/backend/arm64/instruction-scheduler-arm64.cc index 88687cd52b5a..6c572d2a1cbb 100644 --- a/src/compiler/backend/arm64/instruction-scheduler-arm64.cc +++ b/src/compiler/backend/arm64/instruction-scheduler-arm64.cc @@ -337,8 +337,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kArm64S8x16TransposeLeft: case kArm64S8x16TransposeRight: case kArm64S8x16Concat: - case kArm64S8x16Swizzle: - case kArm64S8x16Shuffle: + case kArm64I8x16Swizzle: + case kArm64I8x16Shuffle: case kArm64S32x2Reverse: case kArm64S16x4Reverse: case kArm64S16x2Reverse: diff --git a/src/compiler/backend/arm64/instruction-selector-arm64.cc b/src/compiler/backend/arm64/instruction-selector-arm64.cc index dc4fdb4d2ef1..fac7f9c1d114 100644 --- a/src/compiler/backend/arm64/instruction-selector-arm64.cc +++ b/src/compiler/backend/arm64/instruction-selector-arm64.cc @@ -1407,7 +1407,7 @@ void InstructionSelector::VisitWord64Ror(Node* node) { V(Float64Max, kArm64Float64Max) \ V(Float32Min, kArm64Float32Min) \ V(Float64Min, kArm64Float64Min) \ - V(S8x16Swizzle, kArm64S8x16Swizzle) + V(I8x16Swizzle, kArm64I8x16Swizzle) #define RR_VISITOR(Name, opcode) \ void InstructionSelector::Visit##Name(Node* node) { \ @@ -3611,7 +3611,7 @@ void ArrangeShuffleTable(Arm64OperandGenerator* g, Node* input0, Node* input1, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -3661,7 +3661,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { // Code generator uses vtbl, arrange sources to form a valid lookup table. InstructionOperand src0, src1; ArrangeShuffleTable(&g, input0, input1, &src0, &src1); - Emit(kArm64S8x16Shuffle, g.DefineAsRegister(node), src0, src1, + Emit(kArm64I8x16Shuffle, g.DefineAsRegister(node), src0, src1, g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 4)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 8)), diff --git a/src/compiler/backend/ia32/code-generator-ia32.cc b/src/compiler/backend/ia32/code-generator-ia32.cc index 5e9b074dedee..4f28a3440518 100644 --- a/src/compiler/backend/ia32/code-generator-ia32.cc +++ b/src/compiler/backend/ia32/code-generator-ia32.cc @@ -3716,7 +3716,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ Andnps(dst, src1); break; } - case kIA32S8x16Swizzle: { + case kIA32I8x16Swizzle: { DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); XMMRegister dst = i.OutputSimd128Register(); XMMRegister mask = i.TempSimd128Register(0); @@ -3729,7 +3729,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ Pshufb(dst, mask); break; } - case kIA32S8x16Shuffle: { + case kIA32I8x16Shuffle: { XMMRegister dst = i.OutputSimd128Register(); Operand src0 = i.InputOperand(0); Register tmp = i.TempRegister(0); diff --git a/src/compiler/backend/ia32/instruction-codes-ia32.h b/src/compiler/backend/ia32/instruction-codes-ia32.h index 8f9f4fcf1c00..eca9dc92278a 100644 --- a/src/compiler/backend/ia32/instruction-codes-ia32.h +++ b/src/compiler/backend/ia32/instruction-codes-ia32.h @@ -355,8 +355,8 @@ namespace compiler { V(SSES128Select) \ V(AVXS128Select) \ V(IA32S128AndNot) \ - V(IA32S8x16Swizzle) \ - V(IA32S8x16Shuffle) \ + V(IA32I8x16Swizzle) \ + V(IA32I8x16Shuffle) \ V(IA32S8x16LoadSplat) \ V(IA32S16x8LoadSplat) \ V(IA32S32x4LoadSplat) \ diff --git a/src/compiler/backend/ia32/instruction-scheduler-ia32.cc b/src/compiler/backend/ia32/instruction-scheduler-ia32.cc index 51a9a18e4416..24abd58c7fc0 100644 --- a/src/compiler/backend/ia32/instruction-scheduler-ia32.cc +++ b/src/compiler/backend/ia32/instruction-scheduler-ia32.cc @@ -336,8 +336,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kSSES128Select: case kAVXS128Select: case kIA32S128AndNot: - case kIA32S8x16Swizzle: - case kIA32S8x16Shuffle: + case kIA32I8x16Swizzle: + case kIA32I8x16Shuffle: case kIA32S32x4Swizzle: case kIA32S32x4Shuffle: case kIA32S16x8Blend: diff --git a/src/compiler/backend/ia32/instruction-selector-ia32.cc b/src/compiler/backend/ia32/instruction-selector-ia32.cc index b0556fd4efec..e8e92b320b97 100644 --- a/src/compiler/backend/ia32/instruction-selector-ia32.cc +++ b/src/compiler/backend/ia32/instruction-selector-ia32.cc @@ -2687,7 +2687,7 @@ bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -2706,7 +2706,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { // We generally need UseRegister for input0, Use for input1. bool src0_needs_reg = true; bool src1_needs_reg = false; - ArchOpcode opcode = kIA32S8x16Shuffle; // general shuffle is the default + ArchOpcode opcode = kIA32I8x16Shuffle; // general shuffle is the default uint8_t offset; uint8_t shuffle32x4[4]; @@ -2794,7 +2794,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { src0_needs_reg = true; imms[imm_count++] = index; } - if (opcode == kIA32S8x16Shuffle) { + if (opcode == kIA32I8x16Shuffle) { // Use same-as-first for general swizzle, but not shuffle. no_same_as_first = !is_swizzle; src0_needs_reg = !no_same_as_first; @@ -2827,10 +2827,10 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { Emit(opcode, 1, &dst, input_count, inputs, temp_count, temps); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { IA32OperandGenerator g(this); InstructionOperand temps[] = {g.TempSimd128Register()}; - Emit(kIA32S8x16Swizzle, g.DefineSameAsFirst(node), + Emit(kIA32I8x16Swizzle, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); } diff --git a/src/compiler/backend/instruction-selector.cc b/src/compiler/backend/instruction-selector.cc index ea68e6bb0877..1c14832bbfeb 100644 --- a/src/compiler/backend/instruction-selector.cc +++ b/src/compiler/backend/instruction-selector.cc @@ -2219,10 +2219,10 @@ void InstructionSelector::VisitNode(Node* node) { return MarkAsSimd128(node), VisitS128Select(node); case IrOpcode::kS128AndNot: return MarkAsSimd128(node), VisitS128AndNot(node); - case IrOpcode::kS8x16Swizzle: - return MarkAsSimd128(node), VisitS8x16Swizzle(node); - case IrOpcode::kS8x16Shuffle: - return MarkAsSimd128(node), VisitS8x16Shuffle(node); + case IrOpcode::kI8x16Swizzle: + return MarkAsSimd128(node), VisitI8x16Swizzle(node); + case IrOpcode::kI8x16Shuffle: + return MarkAsSimd128(node), VisitI8x16Shuffle(node); case IrOpcode::kV64x2AnyTrue: return MarkAsWord32(node), VisitV64x2AnyTrue(node); case IrOpcode::kV64x2AllTrue: diff --git a/src/compiler/backend/mips/code-generator-mips.cc b/src/compiler/backend/mips/code-generator-mips.cc index 37fb8b067b31..9fe71e15c390 100644 --- a/src/compiler/backend/mips/code-generator-mips.cc +++ b/src/compiler/backend/mips/code-generator-mips.cc @@ -3274,7 +3274,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ sldi_b(dst, i.InputSimd128Register(1), i.InputInt4(2)); break; } - case kMipsS8x16Shuffle: { + case kMipsI8x16Shuffle: { CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), @@ -3299,7 +3299,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ vshf_b(dst, src1, src0); break; } - case kMipsS8x16Swizzle: { + case kMipsI8x16Swizzle: { Simd128Register dst = i.OutputSimd128Register(), tbl = i.InputSimd128Register(0), ctl = i.InputSimd128Register(1); diff --git a/src/compiler/backend/mips/instruction-codes-mips.h b/src/compiler/backend/mips/instruction-codes-mips.h index b95bd82d28ee..46ce3d359ab0 100644 --- a/src/compiler/backend/mips/instruction-codes-mips.h +++ b/src/compiler/backend/mips/instruction-codes-mips.h @@ -307,8 +307,8 @@ namespace compiler { V(MipsS8x16PackOdd) \ V(MipsS8x16InterleaveEven) \ V(MipsS8x16InterleaveOdd) \ - V(MipsS8x16Shuffle) \ - V(MipsS8x16Swizzle) \ + V(MipsI8x16Shuffle) \ + V(MipsI8x16Swizzle) \ V(MipsS8x16Concat) \ V(MipsS8x8Reverse) \ V(MipsS8x4Reverse) \ diff --git a/src/compiler/backend/mips/instruction-scheduler-mips.cc b/src/compiler/backend/mips/instruction-scheduler-mips.cc index 507bb146641d..64e78b81229b 100644 --- a/src/compiler/backend/mips/instruction-scheduler-mips.cc +++ b/src/compiler/backend/mips/instruction-scheduler-mips.cc @@ -273,8 +273,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kMipsS8x16InterleaveRight: case kMipsS8x16PackEven: case kMipsS8x16PackOdd: - case kMipsS8x16Shuffle: - case kMipsS8x16Swizzle: + case kMipsI8x16Shuffle: + case kMipsI8x16Swizzle: case kMipsS8x2Reverse: case kMipsS8x4Reverse: case kMipsS8x8Reverse: diff --git a/src/compiler/backend/mips/instruction-selector-mips.cc b/src/compiler/backend/mips/instruction-selector-mips.cc index 6aabbf376170..b47dbd4f8edf 100644 --- a/src/compiler/backend/mips/instruction-selector-mips.cc +++ b/src/compiler/backend/mips/instruction-selector-mips.cc @@ -2378,7 +2378,7 @@ bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -2404,7 +2404,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle32x4))); return; } - Emit(kMipsS8x16Shuffle, g.DefineAsRegister(node), g.UseRegister(input0), + Emit(kMipsI8x16Shuffle, g.DefineAsRegister(node), g.UseRegister(input0), g.UseRegister(input1), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 4)), @@ -2412,15 +2412,14 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 12))); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { MipsOperandGenerator g(this); InstructionOperand temps[] = {g.TempSimd128Register()}; // We don't want input 0 or input 1 to be the same as output, since we will // modify output before do the calculation. - Emit(kMipsS8x16Swizzle, g.DefineAsRegister(node), + Emit(kMipsI8x16Swizzle, g.DefineAsRegister(node), g.UseUniqueRegister(node->InputAt(0)), - g.UseUniqueRegister(node->InputAt(1)), - arraysize(temps), temps); + g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); } void InstructionSelector::VisitSignExtendWord8ToInt32(Node* node) { diff --git a/src/compiler/backend/mips64/code-generator-mips64.cc b/src/compiler/backend/mips64/code-generator-mips64.cc index 2c6b34a4b18f..87432a22ed38 100644 --- a/src/compiler/backend/mips64/code-generator-mips64.cc +++ b/src/compiler/backend/mips64/code-generator-mips64.cc @@ -3497,7 +3497,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ sldi_b(dst, i.InputSimd128Register(1), i.InputInt4(2)); break; } - case kMips64S8x16Shuffle: { + case kMips64I8x16Shuffle: { CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), @@ -3522,7 +3522,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ vshf_b(dst, src1, src0); break; } - case kMips64S8x16Swizzle: { + case kMips64I8x16Swizzle: { Simd128Register dst = i.OutputSimd128Register(), tbl = i.InputSimd128Register(0), ctl = i.InputSimd128Register(1); diff --git a/src/compiler/backend/mips64/instruction-codes-mips64.h b/src/compiler/backend/mips64/instruction-codes-mips64.h index fb603165175b..577db6347ccd 100644 --- a/src/compiler/backend/mips64/instruction-codes-mips64.h +++ b/src/compiler/backend/mips64/instruction-codes-mips64.h @@ -342,8 +342,8 @@ namespace compiler { V(Mips64S8x16PackOdd) \ V(Mips64S8x16InterleaveEven) \ V(Mips64S8x16InterleaveOdd) \ - V(Mips64S8x16Shuffle) \ - V(Mips64S8x16Swizzle) \ + V(Mips64I8x16Shuffle) \ + V(Mips64I8x16Swizzle) \ V(Mips64S8x16Concat) \ V(Mips64S8x8Reverse) \ V(Mips64S8x4Reverse) \ diff --git a/src/compiler/backend/mips64/instruction-scheduler-mips64.cc b/src/compiler/backend/mips64/instruction-scheduler-mips64.cc index 347cf577ded6..caf472bf30be 100644 --- a/src/compiler/backend/mips64/instruction-scheduler-mips64.cc +++ b/src/compiler/backend/mips64/instruction-scheduler-mips64.cc @@ -305,8 +305,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kMips64S8x2Reverse: case kMips64S8x4Reverse: case kMips64S8x8Reverse: - case kMips64S8x16Shuffle: - case kMips64S8x16Swizzle: + case kMips64I8x16Shuffle: + case kMips64I8x16Swizzle: case kMips64Sar: case kMips64Seb: case kMips64Seh: diff --git a/src/compiler/backend/mips64/instruction-selector-mips64.cc b/src/compiler/backend/mips64/instruction-selector-mips64.cc index 5a85ca230edf..58fed2ced9d4 100644 --- a/src/compiler/backend/mips64/instruction-selector-mips64.cc +++ b/src/compiler/backend/mips64/instruction-selector-mips64.cc @@ -3080,7 +3080,7 @@ bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -3106,7 +3106,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle32x4))); return; } - Emit(kMips64S8x16Shuffle, g.DefineAsRegister(node), g.UseRegister(input0), + Emit(kMips64I8x16Shuffle, g.DefineAsRegister(node), g.UseRegister(input0), g.UseRegister(input1), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 4)), @@ -3114,15 +3114,14 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle + 12))); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { Mips64OperandGenerator g(this); InstructionOperand temps[] = {g.TempSimd128Register()}; // We don't want input 0 or input 1 to be the same as output, since we will // modify output before do the calculation. - Emit(kMips64S8x16Swizzle, g.DefineAsRegister(node), + Emit(kMips64I8x16Swizzle, g.DefineAsRegister(node), g.UseUniqueRegister(node->InputAt(0)), - g.UseUniqueRegister(node->InputAt(1)), - arraysize(temps), temps); + g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); } void InstructionSelector::VisitSignExtendWord8ToInt32(Node* node) { diff --git a/src/compiler/backend/ppc/code-generator-ppc.cc b/src/compiler/backend/ppc/code-generator-ppc.cc index f0b5af20f074..767247b2fd85 100644 --- a/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/src/compiler/backend/ppc/code-generator-ppc.cc @@ -3229,7 +3229,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1)); break; } - case kPPC_S8x16Shuffle: { + case kPPC_I8x16Shuffle: { Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), src1 = i.InputSimd128Register(1); @@ -3288,7 +3288,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1)); break; } - case kPPC_S8x16Swizzle: { + case kPPC_I8x16Swizzle: { // Reverse the input to match IBM lane numbering. Simd128Register tempFPReg1 = i.ToSimd128Register(instr->TempAt(0)); __ addi(sp, sp, Operand(-16)); diff --git a/src/compiler/backend/ppc/instruction-codes-ppc.h b/src/compiler/backend/ppc/instruction-codes-ppc.h index 1c33d8b68141..fb5151ebd444 100644 --- a/src/compiler/backend/ppc/instruction-codes-ppc.h +++ b/src/compiler/backend/ppc/instruction-codes-ppc.h @@ -352,8 +352,8 @@ namespace compiler { V(PPC_I8x16AddSaturateU) \ V(PPC_I8x16SubSaturateU) \ V(PPC_I8x16RoundingAverageU) \ - V(PPC_S8x16Shuffle) \ - V(PPC_S8x16Swizzle) \ + V(PPC_I8x16Shuffle) \ + V(PPC_I8x16Swizzle) \ V(PPC_V64x2AnyTrue) \ V(PPC_V32x4AnyTrue) \ V(PPC_V16x8AnyTrue) \ diff --git a/src/compiler/backend/ppc/instruction-scheduler-ppc.cc b/src/compiler/backend/ppc/instruction-scheduler-ppc.cc index 647ff6f679e0..8beaa8539c83 100644 --- a/src/compiler/backend/ppc/instruction-scheduler-ppc.cc +++ b/src/compiler/backend/ppc/instruction-scheduler-ppc.cc @@ -275,8 +275,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kPPC_I8x16AddSaturateU: case kPPC_I8x16SubSaturateU: case kPPC_I8x16RoundingAverageU: - case kPPC_S8x16Shuffle: - case kPPC_S8x16Swizzle: + case kPPC_I8x16Shuffle: + case kPPC_I8x16Swizzle: case kPPC_V64x2AnyTrue: case kPPC_V32x4AnyTrue: case kPPC_V16x8AnyTrue: diff --git a/src/compiler/backend/ppc/instruction-selector-ppc.cc b/src/compiler/backend/ppc/instruction-selector-ppc.cc index d41b39b36715..0c61821cf5ba 100644 --- a/src/compiler/backend/ppc/instruction-selector-ppc.cc +++ b/src/compiler/backend/ppc/instruction-selector-ppc.cc @@ -2232,7 +2232,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { V(I8x16AddSaturateU) \ V(I8x16SubSaturateU) \ V(I8x16RoundingAverageU) \ - V(S8x16Swizzle) \ + V(I8x16Swizzle) \ V(S128And) \ V(S128Or) \ V(S128Xor) \ @@ -2380,7 +2380,7 @@ SIMD_BOOL_LIST(SIMD_VISIT_BOOL) #undef SIMD_BOOL_LIST #undef SIMD_TYPES -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -2397,7 +2397,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { ? max_index - current_index : total_lane_count - current_index + max_index); } - Emit(kPPC_S8x16Shuffle, g.DefineAsRegister(node), g.UseUniqueRegister(input0), + Emit(kPPC_I8x16Shuffle, g.DefineAsRegister(node), g.UseUniqueRegister(input0), g.UseUniqueRegister(input1), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_remapped)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_remapped + 4)), diff --git a/src/compiler/backend/s390/code-generator-s390.cc b/src/compiler/backend/s390/code-generator-s390.cc index 5cc442d5d8dd..e8f5e4831677 100644 --- a/src/compiler/backend/s390/code-generator-s390.cc +++ b/src/compiler/backend/s390/code-generator-s390.cc @@ -4176,7 +4176,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( break; } #undef BINOP_EXTRACT - case kS390_S8x16Shuffle: { + case kS390_I8x16Shuffle: { Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), src1 = i.InputSimd128Register(1); @@ -4196,7 +4196,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ vperm(dst, src0, src1, kScratchDoubleReg, Condition(0), Condition(0)); break; } - case kS390_S8x16Swizzle: { + case kS390_I8x16Swizzle: { Simd128Register dst = i.OutputSimd128Register(), src0 = i.InputSimd128Register(0), src1 = i.InputSimd128Register(1); diff --git a/src/compiler/backend/s390/instruction-codes-s390.h b/src/compiler/backend/s390/instruction-codes-s390.h index 693b555ae78e..ab7973c089f6 100644 --- a/src/compiler/backend/s390/instruction-codes-s390.h +++ b/src/compiler/backend/s390/instruction-codes-s390.h @@ -365,8 +365,8 @@ namespace compiler { V(S390_I8x16RoundingAverageU) \ V(S390_I8x16Abs) \ V(S390_I8x16BitMask) \ - V(S390_S8x16Shuffle) \ - V(S390_S8x16Swizzle) \ + V(S390_I8x16Shuffle) \ + V(S390_I8x16Swizzle) \ V(S390_V64x2AnyTrue) \ V(S390_V32x4AnyTrue) \ V(S390_V16x8AnyTrue) \ diff --git a/src/compiler/backend/s390/instruction-scheduler-s390.cc b/src/compiler/backend/s390/instruction-scheduler-s390.cc index 1117ec51411a..c0a854b7f1ca 100644 --- a/src/compiler/backend/s390/instruction-scheduler-s390.cc +++ b/src/compiler/backend/s390/instruction-scheduler-s390.cc @@ -311,8 +311,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kS390_I8x16RoundingAverageU: case kS390_I8x16Abs: case kS390_I8x16BitMask: - case kS390_S8x16Shuffle: - case kS390_S8x16Swizzle: + case kS390_I8x16Shuffle: + case kS390_I8x16Swizzle: case kS390_V64x2AnyTrue: case kS390_V32x4AnyTrue: case kS390_V16x8AnyTrue: diff --git a/src/compiler/backend/s390/instruction-selector-s390.cc b/src/compiler/backend/s390/instruction-selector-s390.cc index 9bab00946a13..ee3e996169b7 100644 --- a/src/compiler/backend/s390/instruction-selector-s390.cc +++ b/src/compiler/backend/s390/instruction-selector-s390.cc @@ -2824,7 +2824,7 @@ SIMD_VISIT_PMIN_MAX(F32x4Pmax) #undef SIMD_VISIT_PMIN_MAX #undef SIMD_TYPES -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; uint8_t* shuffle_p = &shuffle[0]; bool is_swizzle; @@ -2845,7 +2845,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { } shuffle_p = &shuffle_remapped[0]; #endif - Emit(kS390_S8x16Shuffle, g.DefineAsRegister(node), + Emit(kS390_I8x16Shuffle, g.DefineAsRegister(node), g.UseUniqueRegister(input0), g.UseUniqueRegister(input1), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_p)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_p + 4)), @@ -2853,9 +2853,9 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_p + 12))); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { S390OperandGenerator g(this); - Emit(kS390_S8x16Swizzle, g.DefineAsRegister(node), + Emit(kS390_I8x16Swizzle, g.DefineAsRegister(node), g.UseUniqueRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1))); } diff --git a/src/compiler/backend/x64/code-generator-x64.cc b/src/compiler/backend/x64/code-generator-x64.cc index f54b9ab743af..d2b872835ca1 100644 --- a/src/compiler/backend/x64/code-generator-x64.cc +++ b/src/compiler/backend/x64/code-generator-x64.cc @@ -3666,7 +3666,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ Andnps(dst, i.InputSimd128Register(1)); break; } - case kX64S8x16Swizzle: { + case kX64I8x16Swizzle: { DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); XMMRegister dst = i.OutputSimd128Register(); XMMRegister mask = i.TempSimd128Register(0); @@ -3679,7 +3679,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ Pshufb(dst, mask); break; } - case kX64S8x16Shuffle: { + case kX64I8x16Shuffle: { XMMRegister dst = i.OutputSimd128Register(); XMMRegister tmp_simd = i.TempSimd128Register(0); if (instr->InputCount() == 5) { // only one input operand diff --git a/src/compiler/backend/x64/instruction-codes-x64.h b/src/compiler/backend/x64/instruction-codes-x64.h index 21f718b3155e..7312121a0af1 100644 --- a/src/compiler/backend/x64/instruction-codes-x64.h +++ b/src/compiler/backend/x64/instruction-codes-x64.h @@ -325,8 +325,8 @@ namespace compiler { V(X64S128Xor) \ V(X64S128Select) \ V(X64S128AndNot) \ - V(X64S8x16Swizzle) \ - V(X64S8x16Shuffle) \ + V(X64I8x16Swizzle) \ + V(X64I8x16Shuffle) \ V(X64S8x16LoadSplat) \ V(X64S16x8LoadSplat) \ V(X64S32x4LoadSplat) \ diff --git a/src/compiler/backend/x64/instruction-scheduler-x64.cc b/src/compiler/backend/x64/instruction-scheduler-x64.cc index 56ca9f1dc123..169753b40eeb 100644 --- a/src/compiler/backend/x64/instruction-scheduler-x64.cc +++ b/src/compiler/backend/x64/instruction-scheduler-x64.cc @@ -303,8 +303,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kX64V32x4AllTrue: case kX64V16x8AnyTrue: case kX64V16x8AllTrue: - case kX64S8x16Swizzle: - case kX64S8x16Shuffle: + case kX64I8x16Swizzle: + case kX64I8x16Shuffle: case kX64S32x4Swizzle: case kX64S32x4Shuffle: case kX64S16x8Blend: diff --git a/src/compiler/backend/x64/instruction-selector-x64.cc b/src/compiler/backend/x64/instruction-selector-x64.cc index 73549cdadff6..995f55e22e4e 100644 --- a/src/compiler/backend/x64/instruction-selector-x64.cc +++ b/src/compiler/backend/x64/instruction-selector-x64.cc @@ -3269,7 +3269,7 @@ bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table, } // namespace -void InstructionSelector::VisitS8x16Shuffle(Node* node) { +void InstructionSelector::VisitI8x16Shuffle(Node* node) { uint8_t shuffle[kSimd128Size]; bool is_swizzle; CanonicalizeShuffle(node, shuffle, &is_swizzle); @@ -3287,7 +3287,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { // We generally need UseRegister for input0, Use for input1. bool src0_needs_reg = true; bool src1_needs_reg = false; - ArchOpcode opcode = kX64S8x16Shuffle; // general shuffle is the default + ArchOpcode opcode = kX64I8x16Shuffle; // general shuffle is the default uint8_t offset; uint8_t shuffle32x4[4]; @@ -3377,7 +3377,7 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { src0_needs_reg = true; imms[imm_count++] = index; } - if (opcode == kX64S8x16Shuffle) { + if (opcode == kX64I8x16Shuffle) { // Use same-as-first for general swizzle, but not shuffle. no_same_as_first = !is_swizzle; src0_needs_reg = !no_same_as_first; @@ -3410,10 +3410,10 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) { Emit(opcode, 1, &dst, input_count, inputs, temp_count, temps); } -void InstructionSelector::VisitS8x16Swizzle(Node* node) { +void InstructionSelector::VisitI8x16Swizzle(Node* node) { X64OperandGenerator g(this); InstructionOperand temps[] = {g.TempSimd128Register()}; - Emit(kX64S8x16Swizzle, g.DefineSameAsFirst(node), + Emit(kX64I8x16Swizzle, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); } diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc index 644c445b941d..98befab0600f 100644 --- a/src/compiler/machine-operator.cc +++ b/src/compiler/machine-operator.cc @@ -495,7 +495,7 @@ ShiftKind ShiftKindOf(Operator const* op) { V(V16x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ V(V8x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ V(V8x16AllTrue, Operator::kNoProperties, 1, 0, 1) \ - V(S8x16Swizzle, Operator::kNoProperties, 2, 0, 1) + V(I8x16Swizzle, Operator::kNoProperties, 2, 0, 1) // The format is: // V(Name, properties, value_input_count, control_input_count, output_count) @@ -1575,7 +1575,7 @@ std::ostream& operator<<(std::ostream& os, S128ImmediateParameter const& p) { } S128ImmediateParameter const& S128ImmediateParameterOf(Operator const* op) { - DCHECK(IrOpcode::kS8x16Shuffle == op->opcode() || + DCHECK(IrOpcode::kI8x16Shuffle == op->opcode() || IrOpcode::kS128Const == op->opcode()); return OpParameter(op); } @@ -1586,10 +1586,10 @@ const Operator* MachineOperatorBuilder::S128Const(const uint8_t value[16]) { S128ImmediateParameter(value)); } -const Operator* MachineOperatorBuilder::S8x16Shuffle( +const Operator* MachineOperatorBuilder::I8x16Shuffle( const uint8_t shuffle[16]) { return zone_->New>( - IrOpcode::kS8x16Shuffle, Operator::kPure, "Shuffle", 2, 0, 0, 1, 0, 0, + IrOpcode::kI8x16Shuffle, Operator::kPure, "Shuffle", 2, 0, 0, 1, 0, 0, S128ImmediateParameter(shuffle)); } diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h index d5c03e63ca85..702c05022373 100644 --- a/src/compiler/machine-operator.h +++ b/src/compiler/machine-operator.h @@ -765,8 +765,8 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final const Operator* S128Select(); const Operator* S128AndNot(); - const Operator* S8x16Swizzle(); - const Operator* S8x16Shuffle(const uint8_t shuffle[16]); + const Operator* I8x16Swizzle(); + const Operator* I8x16Shuffle(const uint8_t shuffle[16]); const Operator* V64x2AnyTrue(); const Operator* V64x2AllTrue(); diff --git a/src/compiler/opcodes.h b/src/compiler/opcodes.h index 0cd280e0a39c..f1faeec93675 100644 --- a/src/compiler/opcodes.h +++ b/src/compiler/opcodes.h @@ -952,8 +952,8 @@ V(S128Xor) \ V(S128Select) \ V(S128AndNot) \ - V(S8x16Swizzle) \ - V(S8x16Shuffle) \ + V(I8x16Swizzle) \ + V(I8x16Shuffle) \ V(V64x2AnyTrue) \ V(V64x2AllTrue) \ V(V32x4AnyTrue) \ diff --git a/src/compiler/simd-scalar-lowering.cc b/src/compiler/simd-scalar-lowering.cc index 49606ed392f0..4ef70e529f01 100644 --- a/src/compiler/simd-scalar-lowering.cc +++ b/src/compiler/simd-scalar-lowering.cc @@ -286,8 +286,8 @@ void SimdScalarLowering::LowerGraph() { V(I8x16LeU) \ V(I8x16GeS) \ V(I8x16GeU) \ - V(S8x16Swizzle) \ - V(S8x16Shuffle) \ + V(I8x16Swizzle) \ + V(I8x16Shuffle) \ V(I8x16RoundingAverageU) \ V(I8x16Abs) \ V(I8x16BitMask) @@ -1968,7 +1968,7 @@ void SimdScalarLowering::LowerNode(Node* node) { ReplaceNode(node, rep_node, num_lanes); break; } - case IrOpcode::kS8x16Swizzle: { + case IrOpcode::kI8x16Swizzle: { DCHECK_EQ(2, node->InputCount()); Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type); Node** indices = GetReplacementsWithType(node->InputAt(1), rep_type); @@ -2007,7 +2007,7 @@ void SimdScalarLowering::LowerNode(Node* node) { ReplaceNode(node, rep_nodes, num_lanes); break; } - case IrOpcode::kS8x16Shuffle: { + case IrOpcode::kI8x16Shuffle: { DCHECK_EQ(2, node->InputCount()); S128ImmediateParameter shuffle = S128ImmediateParameterOf(node->op()); Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type); diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc index 20613325e170..933109c450c1 100644 --- a/src/compiler/wasm-compiler.cc +++ b/src/compiler/wasm-compiler.cc @@ -4951,8 +4951,8 @@ Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, Node* const* inputs) { return graph()->NewNode(mcgraph()->machine()->V8x16AnyTrue(), inputs[0]); case wasm::kExprV8x16AllTrue: return graph()->NewNode(mcgraph()->machine()->V8x16AllTrue(), inputs[0]); - case wasm::kExprS8x16Swizzle: - return graph()->NewNode(mcgraph()->machine()->S8x16Swizzle(), inputs[0], + case wasm::kExprI8x16Swizzle: + return graph()->NewNode(mcgraph()->machine()->I8x16Swizzle(), inputs[0], inputs[1]); default: FATAL_UNSUPPORTED_OPCODE(opcode); @@ -5013,7 +5013,7 @@ Node* WasmGraphBuilder::SimdLaneOp(wasm::WasmOpcode opcode, uint8_t lane, Node* WasmGraphBuilder::Simd8x16ShuffleOp(const uint8_t shuffle[16], Node* const* inputs) { has_simd_ = true; - return graph()->NewNode(mcgraph()->machine()->S8x16Shuffle(shuffle), + return graph()->NewNode(mcgraph()->machine()->I8x16Shuffle(shuffle), inputs[0], inputs[1]); } diff --git a/src/wasm/baseline/arm/liftoff-assembler-arm.h b/src/wasm/baseline/arm/liftoff-assembler-arm.h index b55cb9fba47e..b4966c012be6 100644 --- a/src/wasm/baseline/arm/liftoff-assembler-arm.h +++ b/src/wasm/baseline/arm/liftoff-assembler-arm.h @@ -2278,7 +2278,7 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, } } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { UseScratchRegisterScope temps(this); @@ -3106,7 +3106,7 @@ void LiftoffAssembler::emit_i16x8_replace_lane(LiftoffRegister dst, imm_lane_idx); } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], diff --git a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h index bb35327315d1..4fe3abc54494 100644 --- a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h +++ b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h @@ -1522,7 +1522,7 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, } } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { Tbl(dst.fp().V16B(), lhs.fp().V16B(), rhs.fp().V16B()); @@ -2163,7 +2163,7 @@ void LiftoffAssembler::emit_i16x8_max_u(LiftoffRegister dst, Umax(dst.fp().V8H(), lhs.fp().V8H(), rhs.fp().V8H()); } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], diff --git a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h index ac24a88c8346..4773e2de30f0 100644 --- a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h +++ b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h @@ -2680,7 +2680,7 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, } } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], @@ -2739,7 +2739,7 @@ void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, mov(esp, tmp.gp()); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { XMMRegister mask = liftoff::kScratchDoubleReg; diff --git a/src/wasm/baseline/liftoff-assembler.h b/src/wasm/baseline/liftoff-assembler.h index 44c5aed52219..e2bd99841fa6 100644 --- a/src/wasm/baseline/liftoff-assembler.h +++ b/src/wasm/baseline/liftoff-assembler.h @@ -761,10 +761,10 @@ class LiftoffAssembler : public TurboAssembler { Register offset_reg, uint32_t offset_imm, LoadType type, LoadTransformationKind transform, uint32_t* protected_load_pc); - inline void emit_s8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, + inline void emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], bool is_swizzle); - inline void emit_s8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, + inline void emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs); inline void emit_i8x16_splat(LiftoffRegister dst, LiftoffRegister src); inline void emit_i16x8_splat(LiftoffRegister dst, LiftoffRegister src); diff --git a/src/wasm/baseline/liftoff-compiler.cc b/src/wasm/baseline/liftoff-compiler.cc index 0cb4b4600555..5f7328be26e3 100644 --- a/src/wasm/baseline/liftoff-compiler.cc +++ b/src/wasm/baseline/liftoff-compiler.cc @@ -2519,8 +2519,8 @@ class LiftoffCompiler { return unsupported(decoder, kSimd, "simd"); } switch (opcode) { - case wasm::kExprS8x16Swizzle: - return EmitBinOp(&LiftoffAssembler::emit_s8x16_swizzle); + case wasm::kExprI8x16Swizzle: + return EmitBinOp(&LiftoffAssembler::emit_i8x16_swizzle); case wasm::kExprI8x16Splat: return EmitUnOp(&LiftoffAssembler::emit_i8x16_splat); case wasm::kExprI16x8Splat: @@ -3044,7 +3044,7 @@ class LiftoffCompiler { if (needs_swap) { std::swap(lhs, rhs); } - __ LiftoffAssembler::emit_s8x16_shuffle(dst, lhs, rhs, shuffle, is_swizzle); + __ LiftoffAssembler::emit_i8x16_shuffle(dst, lhs, rhs, shuffle, is_swizzle); __ PushRegister(kWasmS128, dst); } diff --git a/src/wasm/baseline/mips/liftoff-assembler-mips.h b/src/wasm/baseline/mips/liftoff-assembler-mips.h index 9273d4998075..97b8487848ea 100644 --- a/src/wasm/baseline/mips/liftoff-assembler-mips.h +++ b/src/wasm/baseline/mips/liftoff-assembler-mips.h @@ -1615,18 +1615,18 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, bailout(kSimd, "load extend and load splat unimplemented"); } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], bool is_swizzle) { - bailout(kSimd, "emit_s8x16_shuffle"); + bailout(kSimd, "emit_i8x16_shuffle"); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { - bailout(kSimd, "emit_s8x16_swizzle"); + bailout(kSimd, "emit_i8x16_swizzle"); } void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, diff --git a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h index 3f3358366d79..3775033943c2 100644 --- a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h +++ b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h @@ -1505,7 +1505,7 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, } } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], @@ -1538,7 +1538,7 @@ void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, vshf_b(dst_msa, rhs_msa, lhs_msa); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { MSARegister dst_msa = dst.fp().toW(); diff --git a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h index d5975f660b34..ef7b720ea9e0 100644 --- a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h +++ b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h @@ -565,10 +565,10 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, bailout(kSimd, "Load transform unimplemented"); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { - bailout(kUnsupportedArchitecture, "emit_s8x16_swizzle"); + bailout(kUnsupportedArchitecture, "emit_i8x16_swizzle"); } void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst, @@ -1083,12 +1083,12 @@ void LiftoffAssembler::emit_i16x8_extract_lane_s(LiftoffRegister dst, bailout(kUnsupportedArchitecture, "emit_i16x8extractlane_s"); } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], bool is_swizzle) { - bailout(kSimd, "s8x16_shuffle"); + bailout(kSimd, "i8x16_shuffle"); } void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, diff --git a/src/wasm/baseline/s390/liftoff-assembler-s390.h b/src/wasm/baseline/s390/liftoff-assembler-s390.h index 5cc6667b003f..dc6ce2f0b3f9 100644 --- a/src/wasm/baseline/s390/liftoff-assembler-s390.h +++ b/src/wasm/baseline/s390/liftoff-assembler-s390.h @@ -569,10 +569,10 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, bailout(kSimd, "Load transform unimplemented"); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { - bailout(kUnsupportedArchitecture, "emit_s8x16_swizzle"); + bailout(kUnsupportedArchitecture, "emit_i8x16_swizzle"); } void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst, @@ -1087,12 +1087,12 @@ void LiftoffAssembler::emit_i16x8_extract_lane_s(LiftoffRegister dst, bailout(kUnsupportedArchitecture, "emit_i16x8extractlane_s"); } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], bool is_swizzle) { - bailout(kSimd, "s8x16_shuffle"); + bailout(kSimd, "i8x16_shuffle"); } void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, diff --git a/src/wasm/baseline/x64/liftoff-assembler-x64.h b/src/wasm/baseline/x64/liftoff-assembler-x64.h index e558fdbe121b..876c1b89e3ec 100644 --- a/src/wasm/baseline/x64/liftoff-assembler-x64.h +++ b/src/wasm/baseline/x64/liftoff-assembler-x64.h @@ -2313,7 +2313,7 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, } } -void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_shuffle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs, const uint8_t shuffle[16], @@ -2370,7 +2370,7 @@ void LiftoffAssembler::emit_s8x16_shuffle(LiftoffRegister dst, Por(dst.fp(), kScratchDoubleReg); } -void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst, +void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { XMMRegister mask = kScratchDoubleReg; diff --git a/src/wasm/function-body-decoder-impl.h b/src/wasm/function-body-decoder-impl.h index 05a46faeb985..c3ba99795fb5 100644 --- a/src/wasm/function-body-decoder-impl.h +++ b/src/wasm/function-body-decoder-impl.h @@ -1654,7 +1654,7 @@ class WasmDecoder : public Decoder { } // Shuffles require a byte per lane, or 16 immediate bytes. case kExprS128Const: - case kExprS8x16Shuffle: + case kExprI8x16Shuffle: return 1 + length + kSimd128Size; default: decoder->error(pc, "invalid SIMD opcode"); @@ -3380,7 +3380,7 @@ class WasmFullDecoder : public WasmDecoder { case kExprI16x8ReplaceLane: case kExprI8x16ReplaceLane: return SimdReplaceLane(opcode, kWasmI32, opcode_length); - case kExprS8x16Shuffle: + case kExprI8x16Shuffle: return Simd8x16ShuffleOp(opcode_length); case kExprS128LoadMem: return DecodeLoadMem(LoadType::kS128Load, opcode_length); diff --git a/src/wasm/wasm-opcodes-inl.h b/src/wasm/wasm-opcodes-inl.h index 2ad8699dd130..e050d1294749 100644 --- a/src/wasm/wasm-opcodes-inl.h +++ b/src/wasm/wasm-opcodes-inl.h @@ -35,7 +35,6 @@ namespace wasm { #define CASE_S64x2_OP(name, str) CASE_OP(S64x2##name, "s64x2." str) #define CASE_S32x4_OP(name, str) CASE_OP(S32x4##name, "s32x4." str) #define CASE_S16x8_OP(name, str) CASE_OP(S16x8##name, "s16x8." str) -#define CASE_S8x16_OP(name, str) CASE_OP(S8x16##name, "s8x16." str) #define CASE_V64x2_OP(name, str) CASE_OP(V64x2##name, "v64x2." str) #define CASE_V32x4_OP(name, str) CASE_OP(V32x4##name, "v32x4." str) #define CASE_V16x8_OP(name, str) CASE_OP(V16x8##name, "v16x8." str) @@ -295,8 +294,8 @@ constexpr const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { CASE_S128_OP(Not, "not") CASE_S128_OP(Select, "select") CASE_S128_OP(AndNot, "andnot") - CASE_S8x16_OP(Swizzle, "swizzle") - CASE_S8x16_OP(Shuffle, "shuffle") + CASE_I8x16_OP(Swizzle, "swizzle") + CASE_I8x16_OP(Shuffle, "shuffle") CASE_SIMDV_OP(AnyTrue, "any_true") CASE_SIMDV_OP(AllTrue, "all_true") CASE_V64x2_OP(AnyTrue, "any_true") @@ -413,7 +412,6 @@ constexpr const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { #undef CASE_S64x2_OP #undef CASE_S32x4_OP #undef CASE_S16x8_OP -#undef CASE_S8x16_OP #undef CASE_INT_OP #undef CASE_FLOAT_OP #undef CASE_ALL_OP diff --git a/src/wasm/wasm-opcodes.h b/src/wasm/wasm-opcodes.h index 44d40ccee298..04767f53a22a 100644 --- a/src/wasm/wasm-opcodes.h +++ b/src/wasm/wasm-opcodes.h @@ -291,10 +291,10 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmModule* module, #define FOREACH_SIMD_CONST_OPCODE(V) V(S128Const, 0xfd0c, _) -#define FOREACH_SIMD_MASK_OPERAND_OPCODE(V) V(S8x16Shuffle, 0xfd0d, s_ss) +#define FOREACH_SIMD_MASK_OPERAND_OPCODE(V) V(I8x16Shuffle, 0xfd0d, s_ss) #define FOREACH_SIMD_MVP_0_OPERAND_OPCODE(V) \ - V(S8x16Swizzle, 0xfd0e, s_ss) \ + V(I8x16Swizzle, 0xfd0e, s_ss) \ V(I8x16Splat, 0xfd0f, s_i) \ V(I16x8Splat, 0xfd10, s_i) \ V(I32x4Splat, 0xfd11, s_i) \ diff --git a/test/cctest/wasm/test-run-wasm-simd-liftoff.cc b/test/cctest/wasm/test-run-wasm-simd-liftoff.cc index 1c00c404b986..7192ff24052a 100644 --- a/test/cctest/wasm/test-run-wasm-simd-liftoff.cc +++ b/test/cctest/wasm/test-run-wasm-simd-liftoff.cc @@ -108,7 +108,7 @@ WASM_SIMD_LIFTOFF_TEST(REGRESS_1088273) { // A test to exercise logic in Liftoff's implementation of shuffle. The // implementation in Liftoff is a bit more tricky due to shuffle requiring // adjacent registers in ARM/ARM64. -WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle) { +WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle) { WasmRunner r(TestExecutionTier::kLiftoff, kNoLowerSimd); // Temps to use up registers and force non-adjacent registers for shuffle. byte local0 = r.AllocateLocal(kWasmS128); @@ -127,7 +127,7 @@ WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle) { // Output global holding a kWasmS128. byte* output = r.builder().AddGlobal(kWasmS128); - // s8x16_shuffle(lhs, rhs, pattern) will take the last element of rhs and + // i8x16_shuffle(lhs, rhs, pattern) will take the last element of rhs and // place it into the last lane of lhs. std::array pattern = { {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 31}}; @@ -137,8 +137,8 @@ WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle) { WASM_SET_LOCAL(local1, WASM_GET_GLOBAL(0)), // local1 is in v1 WASM_GET_GLOBAL(0), // global0 is in v2 WASM_GET_LOCAL(local0), // local0 is in v0 - WASM_SET_GLOBAL(2, WASM_SIMD_S8x16_SHUFFLE_OP( - kExprS8x16Shuffle, pattern, WASM_NOP, WASM_NOP)), + WASM_SET_GLOBAL(2, WASM_SIMD_I8x16_SHUFFLE_OP( + kExprI8x16Shuffle, pattern, WASM_NOP, WASM_NOP)), WASM_ONE); r.Call(); @@ -153,7 +153,7 @@ WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle) { // Exercise logic in Liftoff's implementation of shuffle when inputs to the // shuffle are the same register. -WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle_SingleOperand) { +WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle_SingleOperand) { WasmRunner r(TestExecutionTier::kLiftoff, kNoLowerSimd); byte local0 = r.AllocateLocal(kWasmS128); @@ -173,8 +173,8 @@ WASM_SIMD_LIFTOFF_TEST(S8x16Shuffle_SingleOperand) { // Set up locals so shuffle is called with non-adjacent registers v2 and v0. BUILD(r, WASM_SET_LOCAL(local0, WASM_GET_GLOBAL(0)), WASM_GET_LOCAL(local0), WASM_GET_LOCAL(local0), - WASM_SET_GLOBAL(1, WASM_SIMD_S8x16_SHUFFLE_OP( - kExprS8x16Shuffle, pattern, WASM_NOP, WASM_NOP)), + WASM_SET_GLOBAL(1, WASM_SIMD_I8x16_SHUFFLE_OP( + kExprI8x16Shuffle, pattern, WASM_NOP, WASM_NOP)), WASM_ONE); r.Call(); diff --git a/test/cctest/wasm/test-run-wasm-simd.cc b/test/cctest/wasm/test-run-wasm-simd.cc index 7f000efa60d7..8fdcabf44e98 100644 --- a/test/cctest/wasm/test-run-wasm-simd.cc +++ b/test/cctest/wasm/test-run-wasm-simd.cc @@ -2665,9 +2665,9 @@ void RunBinaryLaneOpTest( WriteLittleEndianValue(&src0[i], i); WriteLittleEndianValue(&src1[i], kElems + i); } - if (simd_op == kExprS8x16Shuffle) { + if (simd_op == kExprI8x16Shuffle) { BUILD(r, - WASM_SET_GLOBAL(0, WASM_SIMD_S8x16_SHUFFLE_OP(simd_op, expected, + WASM_SET_GLOBAL(0, WASM_SIMD_I8x16_SHUFFLE_OP(simd_op, expected, WASM_GET_GLOBAL(0), WASM_GET_GLOBAL(1))), WASM_ONE); @@ -2839,7 +2839,7 @@ ShuffleMap test_shuffles = { WASM_SIMD_TEST(Name) { \ ShuffleMap::const_iterator it = test_shuffles.find(k##Name); \ DCHECK_NE(it, test_shuffles.end()); \ - RunShuffleOpTest(execution_tier, lower_simd, kExprS8x16Shuffle, \ + RunShuffleOpTest(execution_tier, lower_simd, kExprI8x16Shuffle, \ it->second); \ } SHUFFLE_LIST(SHUFFLE_TEST) @@ -2852,7 +2852,7 @@ WASM_SIMD_TEST(S8x16Blend) { for (int bias = 1; bias < kSimd128Size; bias++) { for (int i = 0; i < bias; i++) expected[i] = i; for (int i = bias; i < kSimd128Size; i++) expected[i] = i + kSimd128Size; - RunShuffleOpTest(execution_tier, lower_simd, kExprS8x16Shuffle, expected); + RunShuffleOpTest(execution_tier, lower_simd, kExprI8x16Shuffle, expected); } } @@ -2870,7 +2870,7 @@ WASM_SIMD_TEST(S8x16Concat) { for (int j = 0; j < n; ++j) { expected[i++] = j + kSimd128Size; } - RunShuffleOpTest(execution_tier, lower_simd, kExprS8x16Shuffle, expected); + RunShuffleOpTest(execution_tier, lower_simd, kExprI8x16Shuffle, expected); } } @@ -2898,7 +2898,7 @@ static constexpr SwizzleTestArgs swizzle_test_args[] = { static constexpr Vector swizzle_test_vector = ArrayVector(swizzle_test_args); -WASM_SIMD_TEST(S8x16Swizzle) { +WASM_SIMD_TEST(I8x16Swizzle) { // RunBinaryLaneOpTest set up the two globals to be consecutive integers, // [0-15] and [16-31]. Using [0-15] as the indices will not sufficiently test // swizzle since the expected result is a no-op, using [16-31] will result in @@ -2910,7 +2910,7 @@ WASM_SIMD_TEST(S8x16Swizzle) { uint8_t* src1 = r.builder().AddGlobal(kWasmS128); BUILD( r, - WASM_SET_GLOBAL(0, WASM_SIMD_BINOP(kExprS8x16Swizzle, WASM_GET_GLOBAL(1), + WASM_SET_GLOBAL(0, WASM_SIMD_BINOP(kExprI8x16Swizzle, WASM_GET_GLOBAL(1), WASM_GET_GLOBAL(2))), WASM_ONE); @@ -2945,18 +2945,18 @@ const Shuffle& GetRandomTestShuffle(v8::base::RandomNumberGenerator* rng) { // Test shuffles that are random combinations of 3 test shuffles. Completely // random shuffles almost always generate the slow general shuffle code, so // don't exercise as many code paths. -WASM_SIMD_TEST(S8x16ShuffleFuzz) { +WASM_SIMD_TEST(I8x16ShuffleFuzz) { v8::base::RandomNumberGenerator* rng = CcTest::random_number_generator(); static const int kTests = 100; for (int i = 0; i < kTests; ++i) { auto shuffle = Combine(GetRandomTestShuffle(rng), GetRandomTestShuffle(rng), GetRandomTestShuffle(rng)); - RunShuffleOpTest(execution_tier, lower_simd, kExprS8x16Shuffle, shuffle); + RunShuffleOpTest(execution_tier, lower_simd, kExprI8x16Shuffle, shuffle); } } void AppendShuffle(const Shuffle& shuffle, std::vector* buffer) { - byte opcode[] = {WASM_SIMD_OP(kExprS8x16Shuffle)}; + byte opcode[] = {WASM_SIMD_OP(kExprI8x16Shuffle)}; for (size_t i = 0; i < arraysize(opcode); ++i) buffer->push_back(opcode[i]); for (size_t i = 0; i < kSimd128Size; ++i) buffer->push_back((shuffle[i])); } @@ -3898,7 +3898,7 @@ WASM_EXTRACT_I16x8_TEST(S, UINT16) WASM_EXTRACT_I16x8_TEST(I, INT16) #undef WASM_SIMD_I8x16_EXTRACT_LANE #undef WASM_SIMD_I8x16_EXTRACT_LANE_U #undef WASM_SIMD_I8x16_REPLACE_LANE -#undef WASM_SIMD_S8x16_SHUFFLE_OP +#undef WASM_SIMD_I8x16_SHUFFLE_OP #undef WASM_SIMD_LOAD_MEM #undef WASM_SIMD_LOAD_MEM_OFFSET #undef WASM_SIMD_STORE_MEM diff --git a/test/common/wasm/wasm-interpreter.cc b/test/common/wasm/wasm-interpreter.cc index e2517627ea37..b1d57bdd6596 100644 --- a/test/common/wasm/wasm-interpreter.cc +++ b/test/common/wasm/wasm-interpreter.cc @@ -2562,7 +2562,7 @@ class WasmInterpreterInternals { *len += 16; return true; } - case kExprS8x16Swizzle: { + case kExprI8x16Swizzle: { int16 v2 = Pop().to_s128().to_i8x16(); int16 v1 = Pop().to_s128().to_i8x16(); int16 res; @@ -2574,7 +2574,7 @@ class WasmInterpreterInternals { Push(WasmValue(Simd128(res))); return true; } - case kExprS8x16Shuffle: { + case kExprI8x16Shuffle: { Simd128Immediate imm(decoder, code->at(pc + *len)); *len += 16; diff --git a/test/common/wasm/wasm-macro-gen.h b/test/common/wasm/wasm-macro-gen.h index 486a7a0bf000..ddb2bd64c614 100644 --- a/test/common/wasm/wasm-macro-gen.h +++ b/test/common/wasm/wasm-macro-gen.h @@ -880,7 +880,7 @@ inline WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) { #define WASM_SIMD_I8x16_REPLACE_LANE(lane, x, y) \ x, y, WASM_SIMD_OP(kExprI8x16ReplaceLane), TO_BYTE(lane) -#define WASM_SIMD_S8x16_SHUFFLE_OP(opcode, m, x, y) \ +#define WASM_SIMD_I8x16_SHUFFLE_OP(opcode, m, x, y) \ x, y, WASM_SIMD_OP(opcode), TO_BYTE(m[0]), TO_BYTE(m[1]), TO_BYTE(m[2]), \ TO_BYTE(m[3]), TO_BYTE(m[4]), TO_BYTE(m[5]), TO_BYTE(m[6]), \ TO_BYTE(m[7]), TO_BYTE(m[8]), TO_BYTE(m[9]), TO_BYTE(m[10]), \ diff --git a/test/fuzzer/wasm-compile.cc b/test/fuzzer/wasm-compile.cc index 1c984d88da91..8cace3230eb5 100644 --- a/test/fuzzer/wasm-compile.cc +++ b/test/fuzzer/wasm-compile.cc @@ -418,7 +418,7 @@ class WasmGenerator { void simd_shuffle(DataRange* data) { Generate(data); - builder_->EmitWithPrefix(kExprS8x16Shuffle); + builder_->EmitWithPrefix(kExprI8x16Shuffle); for (int i = 0; i < kSimd128Size; i++) { builder_->EmitByte(static_cast(data->get() % 32)); } @@ -1533,7 +1533,7 @@ void WasmGenerator::Generate(DataRange* data) { ValueType::kS128, ValueType::kS128>, &WasmGenerator::simd_shuffle, - &WasmGenerator::op_with_prefix, &WasmGenerator::memop, diff --git a/test/mjsunit/regress/wasm/regress-1070078.js b/test/mjsunit/regress/wasm/regress-1070078.js index 8df2e35e65da..5301c5747d56 100644 --- a/test/mjsunit/regress/wasm/regress-1070078.js +++ b/test/mjsunit/regress/wasm/regress-1070078.js @@ -23,12 +23,12 @@ builder.addFunction(undefined, 0 /* sig */).addBodyWithEnd([ kSimdPrefix, kExprI8x16Splat, // i8x16.splat kExprI32Const, 0x19, // i32.const kSimdPrefix, kExprI8x16Splat, // i8x16.splat - kSimdPrefix, kExprS8x16Shuffle, + kSimdPrefix, kExprI8x16Shuffle, 0x00, 0x00, 0x17, 0x00, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x10, 0x01, 0x00, 0x04, 0x04, 0x04, 0x04, // s8x16.shuffle - kSimdPrefix, kExprS8x16Shuffle, + 0x04, 0x10, 0x01, 0x00, 0x04, 0x04, 0x04, 0x04, // i8x16.shuffle + kSimdPrefix, kExprI8x16Shuffle, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // s8x16.shuffle + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // i8x16.shuffle kSimdPrefix, kExprI8x16LeU, // i8x16.le_u kSimdPrefix, kExprV8x16AnyTrue, // v8x16.any_true kExprMemoryGrow, 0x00, // memory.grow diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js index d330275f8890..b914ee91e3cc 100644 --- a/test/mjsunit/wasm/wasm-module-builder.js +++ b/test/mjsunit/wasm/wasm-module-builder.js @@ -497,9 +497,9 @@ let kExprS128Load64Splat = 0x0a; let kExprS128StoreMem = 0x0b; let kExprS128Const = 0x0c; -let kExprS8x16Shuffle = 0x0d; +let kExprI8x16Shuffle = 0x0d; -let kExprS8x16Swizzle = 0x0e; +let kExprI8x16Swizzle = 0x0e; let kExprI8x16Splat = 0x0f; let kExprI16x8Splat = 0x10; let kExprI32x4Splat = 0x11; diff --git a/test/unittests/wasm/function-body-decoder-unittest.cc b/test/unittests/wasm/function-body-decoder-unittest.cc index 2f6a44136f7a..242c90bff136 100644 --- a/test/unittests/wasm/function-body-decoder-unittest.cc +++ b/test/unittests/wasm/function-body-decoder-unittest.cc @@ -1842,14 +1842,14 @@ TEST_F(FunctionBodyDecoderTest, IncompleteStore) { ExpectFailure(sig, ArrayVector(code), kOmitEnd); } -TEST_F(FunctionBodyDecoderTest, IncompleteS8x16Shuffle) { +TEST_F(FunctionBodyDecoderTest, IncompleteI8x16Shuffle) { WASM_FEATURE_SCOPE(simd); const FunctionSig* sig = sigs.i_i(); builder.InitializeMemory(); builder.InitializeTable(wasm::kWasmStmt); static byte code[] = {kSimdPrefix, - static_cast(kExprS8x16Shuffle & 0xff)}; + static_cast(kExprI8x16Shuffle & 0xff)}; ExpectFailure(sig, ArrayVector(code), kOmitEnd); } @@ -4500,7 +4500,7 @@ TEST_F(WasmOpcodeLengthTest, SimdExpressions) { #define TEST_SIMD(name, opcode, sig) ExpectLengthPrefixed(1, kExpr##name); FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD) #undef TEST_SIMD - ExpectLengthPrefixed(16, kExprS8x16Shuffle); + ExpectLengthPrefixed(16, kExprI8x16Shuffle); // test for bad simd opcode, 0xFF is encoded in two bytes. ExpectLength(3, kSimdPrefix, 0xFF, 0x1); }