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/State | |
| 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/State')
| -rw-r--r-- | ARMeilleure/State/NativeContext.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ARMeilleure/State/NativeContext.cs b/ARMeilleure/State/NativeContext.cs index 9df69a4e..09ec6cde 100644 --- a/ARMeilleure/State/NativeContext.cs +++ b/ARMeilleure/State/NativeContext.cs @@ -15,6 +15,9 @@ namespace ARMeilleure.State public fixed uint FpFlags[RegisterConsts.FpFlagsCount]; public int Counter; public ulong CallAddress; + public ulong ExclusiveAddress; + public ulong ExclusiveValueLow; + public ulong ExclusiveValueHigh; } private static NativeCtxStorage _dummyStorage = new NativeCtxStorage(); @@ -26,6 +29,8 @@ namespace ARMeilleure.State public NativeContext(IJitMemoryAllocator allocator) { _block = allocator.Allocate((ulong)Unsafe.SizeOf<NativeCtxStorage>()); + + GetStorage().ExclusiveAddress = ulong.MaxValue; } public unsafe ulong GetX(int index) @@ -162,6 +167,16 @@ namespace ARMeilleure.State return StorageOffset(ref _dummyStorage, ref _dummyStorage.CallAddress); } + public static int GetExclusiveAddressOffset() + { + return StorageOffset(ref _dummyStorage, ref _dummyStorage.ExclusiveAddress); + } + + public static int GetExclusiveValueOffset() + { + return StorageOffset(ref _dummyStorage, ref _dummyStorage.ExclusiveValueLow); + } + private static int StorageOffset<T>(ref NativeCtxStorage storage, ref T target) { return (int)Unsafe.ByteOffset(ref Unsafe.As<NativeCtxStorage, T>(ref storage), ref target); |
