AVX128: Implement support for vphaddsw

This commit is contained in:
Ryan Houdek 2024-06-19 05:18:41 -07:00 committed by Alyssa Rosenzweig
parent c283f80f48
commit a48c65cd65
2 changed files with 8 additions and 1 deletions

View File

@ -1163,6 +1163,8 @@ public:
template<IROps IROp, size_t ElementSize>
void AVX128_VHADDP(OpcodeArgs);
void AVX128_VPHADDSW(OpcodeArgs);
// End of AVX 128-bit implementation
void InvalidOp(OpcodeArgs);

View File

@ -252,7 +252,7 @@ void OpDispatchBuilder::InstallAVX128Handlers() {
// TODO: {OPD(2, 0b01, 0x00), 1, &OpDispatchBuilder::VPSHUFBOp},
{OPD(2, 0b01, 0x01), 1, &OpDispatchBuilder::AVX128_VHADDP<IR::OP_VADDP, 2>},
{OPD(2, 0b01, 0x02), 1, &OpDispatchBuilder::AVX128_VHADDP<IR::OP_VADDP, 4>},
// TODO: {OPD(2, 0b01, 0x03), 1, &OpDispatchBuilder::VPHADDSWOp},
{OPD(2, 0b01, 0x03), 1, &OpDispatchBuilder::AVX128_VPHADDSW},
// TODO: {OPD(2, 0b01, 0x04), 1, &OpDispatchBuilder::VPMADDUBSWOp},
{OPD(2, 0b01, 0x05), 1, &OpDispatchBuilder::AVX128_VPHSUB<2>},
@ -1852,4 +1852,9 @@ void OpDispatchBuilder::AVX128_VHADDP(OpcodeArgs) {
});
}
void OpDispatchBuilder::AVX128_VPHADDSW(OpcodeArgs) {
AVX128_VectorBinaryImpl(Op, GetDstSize(Op), OpSize::i16Bit,
[this](size_t _ElementSize, Ref Src1, Ref Src2) { return PHADDSOpImpl(OpSize::i128Bit, Src1, Src2); });
}
} // namespace FEXCore::IR