From 862e575100077a94751069240862fbf9d6fcc110 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 13 Nov 2023 12:08:46 -0400 Subject: [PATCH] OpcodeDispatcher: avoid some ubfx for rcr with flagm Signed-off-by: Alyssa Rosenzweig --- FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index 4f1480b6e..b0c203021 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -2380,12 +2380,10 @@ void OpDispatchBuilder::RCROp1Bit(OpcodeArgs) { auto Res = _Extr(OpSizeFromSrc(Op), CF, Dest, Shift); // Our new CF will be bit (Shift - 1) of the source - auto NewCF = _Bfe(OpSizeFromSrc(Op), 1, Shift - 1, Dest); + SetRFLAG(Dest, Shift - 1, true); StoreResult(GPRClass, Op, Res, -1); - SetRFLAG(NewCF); - if (Shift == 1) { // OF is the top two MSBs XOR'd together SetRFLAG(_Xor(OpSizeFromSrc(Op), _Bfe(OpSizeFromSrc(Op), 1, Size - 1, Res), _Bfe(OpSizeFromSrc(Op), 1, Size - 2, Res))); @@ -2402,8 +2400,7 @@ void OpDispatchBuilder::RCROp1Bit(OpcodeArgs) { // CF only changes if we actually shifted // Our new CF will be bit (Shift - 1) of the source - auto NewCF = _Bfe(OpSize::i32Bit, 1, Shift - 1, Dest); - SetRFLAG(NewCF); + SetRFLAG(Dest, Shift - 1, true); // OF is the top two MSBs XOR'd together // Only when Shift == 1, it is undefined otherwise @@ -2422,7 +2419,7 @@ void OpDispatchBuilder::RCROp8x1Bit(OpcodeArgs) { uint32_t Shift = 1; // Our new CF will be bit (Shift - 1) of the source - auto NewCF = _Bfe(OpSize::i32Bit, 1, Shift - 1, Dest); + SetRFLAG(Dest, Shift - 1, true); // Rotate and insert CF in the upper bit OrderedNode *Res = _Bfe(OpSize::i32Bit, 7, 1, Dest); @@ -2430,7 +2427,6 @@ void OpDispatchBuilder::RCROp8x1Bit(OpcodeArgs) { StoreResult(GPRClass, Op, Res, -1); - SetRFLAG(NewCF); if (Shift == 1) { // OF is the top two MSBs XOR'd together