Skip to content

Commit

Permalink
IR: do not clobber flags in caspair
Browse files Browse the repository at this point in the history
slightly worse in the emulated case, I don't really care

Signed-off-by: Alyssa Rosenzweig <[email protected]>
  • Loading branch information
alyssarosenzweig committed Mar 29, 2024
1 parent 58a2441 commit 0cf4ee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions FEXCore/Source/Interface/Core/JIT/Arm64/AtomicOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ DEF_OP(CASPair) {
Bind(&LoopTop);

ldaxp(EmitSize, TMP2, TMP3, MemSrc);
cmp(EmitSize, TMP2, Expected.first);
ccmp(EmitSize, TMP3, Expected.second, ARMEmitter::StatusFlags::None, ARMEmitter::Condition::CC_EQ);
b(ARMEmitter::Condition::CC_NE, &LoopNotExpected);
eor(EmitSize, TMP1, TMP2, Expected.first);
eor(EmitSize, TMP4, TMP3, Expected.second);
orr(EmitSize, TMP1, TMP1, TMP4);
cbnz(EmitSize, TMP1, &LoopNotExpected);
stlxp(EmitSize, TMP2, Desired.first, Desired.second, MemSrc);
cbnz(EmitSize, TMP2, &LoopTop);
mov(EmitSize, Dst.first, Expected.first);
Expand Down
1 change: 0 additions & 1 deletion FEXCore/Source/Interface/IR/IR.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,6 @@
],
"HasDest": true,
"DestSize": "Size",
"ImplicitFlagClobber": true,
"NumElements": "2",
"EmitValidation": [
"Size == FEXCore::IR::OpSize::i64Bit || Size == FEXCore::IR::OpSize::i128Bit"
Expand Down

0 comments on commit 0cf4ee5

Please sign in to comment.