mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-29 04:01:27 +01:00
Merge pull request #5040 from Sonicadvance1/warkwarkwarkwarkwarkwarkwark
FEXCore: Remove usage of "remote atomic" xor
This commit is contained in:
5 files changed
+10
-39
No files matched your search
@@ -138,26 +138,6 @@ DEF_OP(CAS) {
|
||||
}
|
||||
}
|
||||
|
||||
DEF_OP(AtomicXor) {
|
||||
auto Op = IROp->C<IR::IROp_AtomicXor>();
|
||||
const auto EmitSize = ConvertSize(IROp);
|
||||
const auto SubEmitSize = ConvertSubRegSize8(IROp->Size);
|
||||
|
||||
auto MemSrc = GetReg(Op->Addr);
|
||||
auto Src = GetReg(Op->Value);
|
||||
|
||||
if (CTX->HostFeatures.SupportsAtomics) {
|
||||
steorl(SubEmitSize, Src, MemSrc);
|
||||
} else {
|
||||
ARMEmitter::BackwardLabel LoopTop;
|
||||
(void)Bind(&LoopTop);
|
||||
ldaxr(SubEmitSize, TMP2, MemSrc);
|
||||
eor(EmitSize, TMP2, TMP2, Src);
|
||||
stlxr(SubEmitSize, TMP2, TMP2, MemSrc);
|
||||
(void)cbnz(EmitSize, TMP2, &LoopTop);
|
||||
}
|
||||
}
|
||||
|
||||
DEF_OP(AtomicSwap) {
|
||||
auto Op = IROp->C<IR::IROp_AtomicSwap>();
|
||||
const auto OpSize = IROp->Size;
|
||||
|
||||
@@ -2750,7 +2750,8 @@ void OpDispatchBuilder::NOTOp(OpcodeArgs) {
|
||||
if (DestIsLockedMem(Op)) {
|
||||
HandledLock = true;
|
||||
Ref DestMem = MakeSegmentAddress(Op, Op->Dest);
|
||||
_AtomicXor(Size, MaskConst, DestMem);
|
||||
// Result unused
|
||||
_AtomicFetchXor(Size, MaskConst, DestMem);
|
||||
} else if (!Op->Dest.IsGPR()) {
|
||||
// GPR version plays fast and loose with sizes, be safe for memory tho.
|
||||
Ref Src = LoadSourceGPR(Op, Op->Dest, Op->Flags);
|
||||
|
||||
@@ -804,16 +804,6 @@
|
||||
"Size == FEXCore::IR::OpSize::i32Bit || Size == FEXCore::IR::OpSize::i64Bit"
|
||||
]
|
||||
},
|
||||
"AtomicXor OpSize:#Size, GPR:$Value, GPR:$Addr": {
|
||||
"HasSideEffects": true,
|
||||
"Desc": ["Atomic integer xor",
|
||||
"IR layout must match Fetch-variant, otherwise DCE IR optimization breaks!"
|
||||
],
|
||||
"DestSize": "Size",
|
||||
"EmitValidation": [
|
||||
"Size == FEXCore::IR::OpSize::i8Bit || Size == FEXCore::IR::OpSize::i16Bit || Size == FEXCore::IR::OpSize::i32Bit || Size == FEXCore::IR::OpSize::i64Bit"
|
||||
]
|
||||
},
|
||||
"GPR = AtomicSwap OpSize:#Size, GPR:$Value, GPR:$Addr": {
|
||||
"HasSideEffects": true,
|
||||
"Desc": ["Atomic integer swap"
|
||||
|
||||
@@ -1491,7 +1491,7 @@
|
||||
"Comment": "GROUP2 0xf6 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xff",
|
||||
"steorlb w20, [x4]"
|
||||
"ldeoralb w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not word [rax]": {
|
||||
@@ -1499,7 +1499,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xffff",
|
||||
"steorlh w20, [x4]"
|
||||
"ldeoralh w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not dword [rax]": {
|
||||
@@ -1507,7 +1507,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xffffffff",
|
||||
"steorl w20, [x4]"
|
||||
"ldeoral w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not qword [rax]": {
|
||||
@@ -1515,7 +1515,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov x20, #0xffffffffffffffff",
|
||||
"steorl x20, [x4]"
|
||||
"ldeoral x20, x20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock neg byte [rax]": {
|
||||
|
||||
@@ -1294,7 +1294,7 @@
|
||||
"Comment": "GROUP2 0xf6 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xff",
|
||||
"steorlb w20, [x4]"
|
||||
"ldeoralb w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not word [rax]": {
|
||||
@@ -1302,7 +1302,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xffff",
|
||||
"steorlh w20, [x4]"
|
||||
"ldeoralh w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not dword [rax]": {
|
||||
@@ -1310,7 +1310,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov w20, #0xffffffff",
|
||||
"steorl w20, [x4]"
|
||||
"ldeoral w20, w20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock not qword [rax]": {
|
||||
@@ -1318,7 +1318,7 @@
|
||||
"Comment": "GROUP2 0xf7 /2",
|
||||
"ExpectedArm64ASM": [
|
||||
"mov x20, #0xffffffffffffffff",
|
||||
"steorl x20, [x4]"
|
||||
"ldeoral x20, x20, [x4]"
|
||||
]
|
||||
},
|
||||
"lock neg byte [rax]": {
|
||||
|
||||
Reference in new issue
Block a user