OpcodeDispatcher: Optimize the case of all flags invalidated

When flags are invalidated but we're going to insert a new flag we end
up in a situation where we loaded the prior value from memory, claimed
unknown cache status (they were all invalid!), and then did an insert.
This commit is contained in:
Ryan Houdek committed 2023-09-10 20:16:29 -07:00
1 parent 3d1bbe505d
commit 4feb059f51
1 file changed
+4 -1
@@ -1195,7 +1195,7 @@ private:
flagsOp = SelectionFlag::Nothing;
if (IsNZCV(BitOffset))
SetNZCV(InsertNZCV(GetNZCV(), BitOffset, Value));
SetNZCV(InsertNZCV(PossiblySetNZCVBits ? GetNZCV() : nullptr, BitOffset, Value));
else
_StoreFlag(Value, BitOffset);
}
@@ -1362,6 +1362,9 @@ private:
*/
void InvalidateDeferredFlags() {
CurrentDeferredFlags.Type = FlagsGenerationType::TYPE_NONE;
// No NZCV bits will be set, they are all invalid.
PossiblySetNZCVBits = 0;
}
/**