diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-06-08 23:49:53 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-06-08 23:49:53 -0300 |
| commit | 9136897d4a0aabed7e12f9756bc9a50e4bdbea72 (patch) | |
| tree | 2acf711a2c16b7a4f7627c4e8f53c4b8ee37418e | |
| parent | 231fae1a4c97d7588655e9775f37c1dc9bd55fb0 (diff) | |
Do not inline the scalar vector load methods as a workaround to a .net JIT bug
| -rw-r--r-- | ChocolArm64/Memory/AMemory.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ChocolArm64/Memory/AMemory.cs b/ChocolArm64/Memory/AMemory.cs index 7e9a358a..7af288a6 100644 --- a/ChocolArm64/Memory/AMemory.cs +++ b/ChocolArm64/Memory/AMemory.cs @@ -387,12 +387,14 @@ namespace ChocolArm64.Memory } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] public Vector128<float> ReadVector32Unchecked(long Position) { if (Sse.IsSupported) { - return Sse.LoadScalarVector128((float*)(RamPtr + (uint)Position)); + byte* Address = RamPtr + (uint)Position; + + return Sse.LoadScalarVector128((float*)Address); } else { @@ -400,7 +402,7 @@ namespace ChocolArm64.Memory } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] public Vector128<float> ReadVector64Unchecked(long Position) { if (Sse2.IsSupported) @@ -418,7 +420,9 @@ namespace ChocolArm64.Memory { if (Sse.IsSupported) { - return Sse.LoadVector128((float*)(RamPtr + (uint)Position)); + byte* Address = RamPtr + (uint)Position; + + return Sse.LoadVector128((float*)Address); } else { @@ -620,7 +624,7 @@ namespace ChocolArm64.Memory } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] public void WriteVector32Unchecked(long Position, Vector128<float> Value) { if (Sse.IsSupported) @@ -633,7 +637,7 @@ namespace ChocolArm64.Memory } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] public void WriteVector64Unchecked(long Position, Vector128<float> Value) { if (Sse2.IsSupported) |
