diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-07-30 11:29:28 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-30 11:29:28 -0300 |
| commit | 9878fc2d3cf4c64f56c44c2a5de013acb6bcbade (patch) | |
| tree | 8f5e5cde68fec213ab61dbee0e121448f0970ca2 /ARMeilleure/Instructions/InstEmitMemoryEx32.cs | |
| parent | 57bb0abda3dc277dc7575250fdb080edb83abcbc (diff) | |
Implement inline memory load/store exclusive and ordered (#1413)
* Implement inline memory load/store exclusive
* Fix missing REX prefix on 8-bits CMPXCHG
* Increment PTC version due to bugfix
* Remove redundant memory checks
* Address PR feedback
* Increment PPTC version
Diffstat (limited to 'ARMeilleure/Instructions/InstEmitMemoryEx32.cs')
| -rw-r--r-- | ARMeilleure/Instructions/InstEmitMemoryEx32.cs | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs index e8e660ee..abe61cd8 100644 --- a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs +++ b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs @@ -13,7 +13,7 @@ namespace ARMeilleure.Instructions { public static void Clrex(ArmEmitterContext context) { - context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ClearExclusive))); + EmitClearExclusive(context); } public static void Dmb(ArmEmitterContext context) => EmitBarrier(context); @@ -198,34 +198,21 @@ namespace ARMeilleure.Instructions context.BranchIfTrue(lblBigEndian, GetFlag(PState.EFlag)); Operand leResult = context.BitwiseOr(lo, context.ShiftLeft(hi, Const(32))); - Operand leS = EmitStoreExclusive(context, address, leResult, exclusive, size); - if (exclusive) - { - SetIntA32(context, op.Rd, leS); - } + EmitStoreExclusive(context, address, leResult, exclusive, size, op.Rd, a32: true); context.Branch(lblEnd); context.MarkLabel(lblBigEndian); Operand beResult = context.BitwiseOr(hi, context.ShiftLeft(lo, Const(32))); - Operand beS = EmitStoreExclusive(context, address, beResult, exclusive, size); - if (exclusive) - { - SetIntA32(context, op.Rd, beS); - } + EmitStoreExclusive(context, address, beResult, exclusive, size, op.Rd, a32: true); context.MarkLabel(lblEnd); } else { - Operand s = EmitStoreExclusive(context, address, context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt)), exclusive, size); - // This is only needed for exclusive stores. The function returns 0 - // when the store is successful, and 1 otherwise. - if (exclusive) - { - SetIntA32(context, op.Rd, s); - } + Operand value = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt)); + EmitStoreExclusive(context, address, value, exclusive, size, op.Rd, a32: true); } } } |
