Merge pull request #3408 from alyssarosenzweig/opt/tst

Optimize TST
This commit is contained in:
Alyssa Rosenzweig authored and GitHub committed 2024-02-06 11:28:02 -04:00
commit 4331753ca0
8 files changed
+115 -61

No files matched your search

@@ -1280,8 +1280,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) {