mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 07:00:43 +02:00
OpcodeDispatcher: optimize TST
it's just an AndWithFlags setting the PF. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
1 parent
4790a7ba79
commit
2e0cb2fbd4
1 file changed
+19
-2
@@ -1282,8 +1282,25 @@ void OpDispatchBuilder::TESTOp(OpcodeArgs) {
|
||||
|
||||
auto Size = GetDstSize(Op);
|
||||
|
||||
auto ALUOp = _And(Size == 8 ? OpSize::i64Bit : OpSize::i32Bit, Dest, Src);
|
||||
GenerateFlags_Logical(Op, ALUOp, Dest, Src);
|
||||
InvalidateDeferredFlags();
|
||||
|
||||
// SF/ZF/CF/OF
|
||||
OrderedNode *ALUOp;
|
||||
|
||||
if (Size >= 4) {
|
||||
ALUOp = _AndWithFlags(IR::SizeToOpSize(Size), Dest, Src);
|
||||
} else {
|
||||
ALUOp = _And(OpSize::i32Bit, Dest, Src);
|
||||
_TestNZ(IR::SizeToOpSize(Size), ALUOp, ALUOp);
|
||||
}
|
||||
|
||||
CachedNZCV = nullptr;
|
||||
PossiblySetNZCVBits = (1u << 31) | (1u << 30);
|
||||
NZCVDirty = false;
|
||||
|
||||
// PF/AF
|
||||
CalculatePF(ALUOp);
|
||||
_InvalidateFlags(1 << X86State::RFLAG_AF_RAW_LOC);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::MOVSXDOp(OpcodeArgs) {
|
||||
|
||||
Reference in new issue
Block a user