diff --git a/src/codegen/ppc/constants-ppc.h b/src/codegen/ppc/constants-ppc.h index d26b686861..31bbb48044 100644 --- a/src/codegen/ppc/constants-ppc.h +++ b/src/codegen/ppc/constants-ppc.h @@ -2393,6 +2393,8 @@ using Instr = uint32_t; V(vbpermq, VBPERMQ, 0x1000054C) #define PPC_VX_OPCODE_C_FORM_LIST(V) \ + /* Vector Unpack Low Signed Word */ \ + V(vupklsw, VUPKLSW, 0x100006CE) \ /* Vector Unpack High Signed Word */ \ V(vupkhsw, VUPKHSW, 0x1000064E) \ /* Vector Unpack Low Signed Halfword */ \ @@ -2559,8 +2561,6 @@ using Instr = uint32_t; V(vupkhpx, VUPKHPX, 0x1000034E) \ /* Vector Unpack Low Pixel */ \ V(vupklpx, VUPKLPX, 0x100003CE) \ - /* Vector Unpack Low Signed Word */ \ - V(vupklsw, VUPKLSW, 0x100006CE) \ /* Vector AES Cipher */ \ V(vcipher, VCIPHER, 0x10000508) \ /* Vector AES Cipher Last */ \ diff --git a/src/compiler/backend/ppc/code-generator-ppc.cc b/src/compiler/backend/ppc/code-generator-ppc.cc index 09948739f7..b66089901b 100644 --- a/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/src/compiler/backend/ppc/code-generator-ppc.cc @@ -3100,6 +3100,40 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ xvcvuxwsp(i.OutputSimd128Register(), i.InputSimd128Register(0)); break; } + + case kPPC_I64x2SConvertI32x4Low: { + __ vupklsw(i.OutputSimd128Register(), i.InputSimd128Register(0)); + break; + } + case kPPC_I64x2SConvertI32x4High: { + __ vupkhsw(i.OutputSimd128Register(), i.InputSimd128Register(0)); + break; + } + case kPPC_I64x2UConvertI32x4Low: { + constexpr int lane_width_in_bytes = 8; + __ vupklsw(i.OutputSimd128Register(), i.InputSimd128Register(0)); + // Zero extend. + __ mov(ip, Operand(0xFFFFFFFF)); + __ mtvsrd(kScratchSimd128Reg, ip); + __ vinsertd(kScratchSimd128Reg, kScratchSimd128Reg, + Operand(1 * lane_width_in_bytes)); + __ vand(i.OutputSimd128Register(), kScratchSimd128Reg, + i.OutputSimd128Register()); + break; + } + case kPPC_I64x2UConvertI32x4High: { + constexpr int lane_width_in_bytes = 8; + __ vupkhsw(i.OutputSimd128Register(), i.InputSimd128Register(0)); + // Zero extend. + __ mov(ip, Operand(0xFFFFFFFF)); + __ mtvsrd(kScratchSimd128Reg, ip); + __ vinsertd(kScratchSimd128Reg, kScratchSimd128Reg, + Operand(1 * lane_width_in_bytes)); + __ vand(i.OutputSimd128Register(), kScratchSimd128Reg, + i.OutputSimd128Register()); + break; + } + case kPPC_I32x4SConvertI16x8Low: { __ vupklsh(i.OutputSimd128Register(), i.InputSimd128Register(0)); break; diff --git a/src/compiler/backend/ppc/instruction-codes-ppc.h b/src/compiler/backend/ppc/instruction-codes-ppc.h index b0aa6529c7..f20959b521 100644 --- a/src/compiler/backend/ppc/instruction-codes-ppc.h +++ b/src/compiler/backend/ppc/instruction-codes-ppc.h @@ -264,6 +264,10 @@ namespace compiler { V(PPC_I64x2ShrU) \ V(PPC_I64x2Neg) \ V(PPC_I64x2BitMask) \ + V(PPC_I64x2SConvertI32x4Low) \ + V(PPC_I64x2SConvertI32x4High) \ + V(PPC_I64x2UConvertI32x4Low) \ + V(PPC_I64x2UConvertI32x4High) \ V(PPC_I32x4Splat) \ V(PPC_I32x4ExtractLane) \ V(PPC_I32x4ReplaceLane) \ diff --git a/src/compiler/backend/ppc/instruction-scheduler-ppc.cc b/src/compiler/backend/ppc/instruction-scheduler-ppc.cc index a737d23e9a..fb2339862e 100644 --- a/src/compiler/backend/ppc/instruction-scheduler-ppc.cc +++ b/src/compiler/backend/ppc/instruction-scheduler-ppc.cc @@ -189,6 +189,10 @@ int InstructionScheduler::GetTargetInstructionFlags( case kPPC_I64x2ShrU: case kPPC_I64x2Neg: case kPPC_I64x2BitMask: + case kPPC_I64x2SConvertI32x4Low: + case kPPC_I64x2SConvertI32x4High: + case kPPC_I64x2UConvertI32x4Low: + case kPPC_I64x2UConvertI32x4High: case kPPC_I32x4Splat: case kPPC_I32x4ExtractLane: case kPPC_I32x4ReplaceLane: