AVX128: Implement support for vaddsubp{s,d}

This commit is contained in:
Ryan Houdek 2024-06-18 05:04:37 -07:00 committed by Alyssa Rosenzweig
parent d2ec9a8936
commit 64ee6b119e
2 changed files with 12 additions and 2 deletions

View File

@ -1095,6 +1095,9 @@ public:
void AVX128_VPHSUBSW(OpcodeArgs);
template<size_t ElementSize>
void AVX128_VADDSUBP(OpcodeArgs);
// End of AVX 128-bit implementation
void InvalidOp(OpcodeArgs);

View File

@ -190,8 +190,8 @@ void OpDispatchBuilder::InstallAVX128Handlers() {
// TODO: {OPD(1, 0b00, 0xC6), 1, &OpDispatchBuilder::VSHUFOp<4>},
// TODO: {OPD(1, 0b01, 0xC6), 1, &OpDispatchBuilder::VSHUFOp<8>},
// TODO: {OPD(1, 0b01, 0xD0), 1, &OpDispatchBuilder::VADDSUBPOp<8>},
// TODO: {OPD(1, 0b11, 0xD0), 1, &OpDispatchBuilder::VADDSUBPOp<4>},
{OPD(1, 0b01, 0xD0), 1, &OpDispatchBuilder::AVX128_VADDSUBP<8>},
{OPD(1, 0b11, 0xD0), 1, &OpDispatchBuilder::AVX128_VADDSUBP<4>},
{OPD(1, 0b01, 0xD1), 1, &OpDispatchBuilder::AVX128_VPSRL<2>},
{OPD(1, 0b01, 0xD2), 1, &OpDispatchBuilder::AVX128_VPSRL<4>},
@ -1385,4 +1385,11 @@ void OpDispatchBuilder::AVX128_VPHSUBSW(OpcodeArgs) {
[this](size_t _ElementSize, Ref Src1, Ref Src2) { return PHSUBSOpImpl(OpSize::i128Bit, Src1, Src2); });
}
template<size_t ElementSize>
void OpDispatchBuilder::AVX128_VADDSUBP(OpcodeArgs) {
AVX128_VectorBinaryImpl(Op, GetDstSize(Op), ElementSize, [this](size_t _ElementSize, Ref Src1, Ref Src2) {
return ADDSUBPOpImpl(OpSize::i128Bit, _ElementSize, Src1, Src2);
});
}
} // namespace FEXCore::IR