mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-03-04 20:47:03 +00:00
OpcodeDispatcher: Avoid monomorphization of even more functions
This commit is contained in:
parent
c9e7bfdf16
commit
59fd13cc2f
@ -35,8 +35,7 @@ using X86Tables::OpToIndex;
|
||||
|
||||
#define OpcodeArgs [[maybe_unused]] FEXCore::X86Tables::DecodedOp Op
|
||||
|
||||
template<bool IsSyscallInst>
|
||||
void OpDispatchBuilder::SyscallOp(OpcodeArgs) {
|
||||
void OpDispatchBuilder::SyscallOp(OpcodeArgs, bool IsSyscallInst) {
|
||||
constexpr size_t SyscallArgs = 7;
|
||||
using SyscallArray = std::array<uint64_t, SyscallArgs>;
|
||||
|
||||
@ -130,6 +129,11 @@ void OpDispatchBuilder::SyscallOp(OpcodeArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
template<bool IsSyscallInst>
|
||||
void OpDispatchBuilder::SyscallOp(OpcodeArgs) {
|
||||
SyscallOp(Op, IsSyscallInst);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::ThunkOp(OpcodeArgs) {
|
||||
const uint8_t GPRSize = CTX->GetGPRSize();
|
||||
uint8_t* sha256 = (uint8_t*)(Op->PC + 2);
|
||||
@ -1678,11 +1682,10 @@ void OpDispatchBuilder::ASHROp(OpcodeArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
template<bool Left, bool IsImmediate, bool Is1Bit>
|
||||
void OpDispatchBuilder::RotateOp(OpcodeArgs) {
|
||||
void OpDispatchBuilder::RotateOp(OpcodeArgs, bool Left, bool IsImmediate, bool Is1Bit) {
|
||||
CalculateDeferredFlags();
|
||||
|
||||
auto LoadShift = [this, Op](bool MustMask) -> Ref {
|
||||
auto LoadShift = [=, this](bool MustMask) -> Ref {
|
||||
if (Is1Bit || IsImmediate) {
|
||||
return _Constant(LoadConstantShift(Op, Is1Bit));
|
||||
} else {
|
||||
@ -1697,7 +1700,7 @@ void OpDispatchBuilder::RotateOp(OpcodeArgs) {
|
||||
|
||||
Calculate_ShiftVariable(
|
||||
Op, LoadShift(true),
|
||||
[this, LoadShift, Op]() {
|
||||
[this, LoadShift, Op, Left]() {
|
||||
const uint32_t Size = GetSrcBitSize(Op);
|
||||
const auto OpSize = Size == 64 ? OpSize::i64Bit : OpSize::i32Bit;
|
||||
|
||||
@ -1740,6 +1743,11 @@ void OpDispatchBuilder::RotateOp(OpcodeArgs) {
|
||||
GetSrcSize(Op) == OpSize::i32Bit ? std::make_optional(&OpDispatchBuilder::ZeroShiftResult) : std::nullopt);
|
||||
}
|
||||
|
||||
template<bool Left, bool IsImmediate, bool Is1Bit>
|
||||
void OpDispatchBuilder::RotateOp(OpcodeArgs) {
|
||||
RotateOp(Op, Left, IsImmediate, Is1Bit);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::ANDNBMIOp(OpcodeArgs) {
|
||||
auto* Src1 = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, {.AllowUpperGarbage = true});
|
||||
auto* Src2 = LoadSource(GPRClass, Op, Op->Src[1], Op->Flags, {.AllowUpperGarbage = true});
|
||||
@ -2428,8 +2436,7 @@ void OpDispatchBuilder::RCLSmallerOp(OpcodeArgs) {
|
||||
});
|
||||
}
|
||||
|
||||
template<uint32_t SrcIndex, BTAction Action>
|
||||
void OpDispatchBuilder::BTOp(OpcodeArgs) {
|
||||
void OpDispatchBuilder::BTOp(OpcodeArgs, uint32_t SrcIndex, BTAction Action) {
|
||||
Ref Value;
|
||||
Ref Src {};
|
||||
bool IsNonconstant = Op->Src[SrcIndex].IsGPR();
|
||||
@ -2573,6 +2580,11 @@ void OpDispatchBuilder::BTOp(OpcodeArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
template<uint32_t SrcIndex, BTAction Action>
|
||||
void OpDispatchBuilder::BTOp(OpcodeArgs) {
|
||||
BTOp(Op, SrcIndex, Action);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::IMUL1SrcOp(OpcodeArgs) {
|
||||
/* We're just going to sign-extend the non-garbage anyway.. */
|
||||
Ref Src1 = LoadSource(GPRClass, Op, Op->Dest, Op->Flags, {.AllowUpperGarbage = true});
|
||||
|
@ -293,6 +293,7 @@ public:
|
||||
void INTOp(OpcodeArgs);
|
||||
template<bool IsSyscallInst>
|
||||
void SyscallOp(OpcodeArgs);
|
||||
void SyscallOp(OpcodeArgs, bool IsSyscallInst);
|
||||
void ThunkOp(OpcodeArgs);
|
||||
void LEAOp(OpcodeArgs);
|
||||
void NOPOp(OpcodeArgs);
|
||||
@ -357,6 +358,7 @@ public:
|
||||
void ASHROp(OpcodeArgs);
|
||||
template<bool Left, bool IsImmediate, bool Is1Bit>
|
||||
void RotateOp(OpcodeArgs);
|
||||
void RotateOp(OpcodeArgs, bool Left, bool IsImmediate, bool Is1Bit);
|
||||
void RCROp1Bit(OpcodeArgs);
|
||||
void RCROp8x1Bit(OpcodeArgs);
|
||||
void RCROp(OpcodeArgs);
|
||||
@ -367,6 +369,7 @@ public:
|
||||
|
||||
template<uint32_t SrcIndex, enum BTAction Action>
|
||||
void BTOp(OpcodeArgs);
|
||||
void BTOp(OpcodeArgs, uint32_t SrcIndex, enum BTAction Action);
|
||||
|
||||
void IMUL1SrcOp(OpcodeArgs);
|
||||
void IMUL2SrcOp(OpcodeArgs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user