Fix for some SIMD issues
This commit is contained in:
parent
f469b968a8
commit
1c44d9f66d
13 changed files with 124 additions and 36 deletions
|
@ -2,6 +2,7 @@ using ChocolArm64.Exceptions;
|
|||
using ChocolArm64.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ChocolArm64.Memory
|
||||
{
|
||||
|
@ -138,6 +139,7 @@ namespace ChocolArm64.Memory
|
|||
public int ReadInt32(long Position) => (int)ReadUInt32(Position);
|
||||
public long ReadInt64(long Position) => (long)ReadUInt64(Position);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public byte ReadByte(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -147,6 +149,7 @@ namespace ChocolArm64.Memory
|
|||
return *((byte*)(RamPtr + (uint)Position));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ushort ReadUInt16(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -156,6 +159,7 @@ namespace ChocolArm64.Memory
|
|||
return *((ushort*)(RamPtr + (uint)Position));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint ReadUInt32(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -165,6 +169,7 @@ namespace ChocolArm64.Memory
|
|||
return *((uint*)(RamPtr + (uint)Position));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ulong ReadUInt64(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -174,6 +179,7 @@ namespace ChocolArm64.Memory
|
|||
return *((ulong*)(RamPtr + (uint)Position));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AVec ReadVector8(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -183,6 +189,7 @@ namespace ChocolArm64.Memory
|
|||
return new AVec() { B0 = ReadByte(Position) };
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AVec ReadVector16(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -192,6 +199,7 @@ namespace ChocolArm64.Memory
|
|||
return new AVec() { H0 = ReadUInt16(Position) };
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AVec ReadVector32(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -201,6 +209,7 @@ namespace ChocolArm64.Memory
|
|||
return new AVec() { W0 = ReadUInt32(Position) };
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AVec ReadVector64(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -210,6 +219,7 @@ namespace ChocolArm64.Memory
|
|||
return new AVec() { X0 = ReadUInt64(Position) };
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public AVec ReadVector128(long Position)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -228,6 +238,7 @@ namespace ChocolArm64.Memory
|
|||
public void WriteInt32(long Position, int Value) => WriteUInt32(Position, (uint)Value);
|
||||
public void WriteInt64(long Position, long Value) => WriteUInt64(Position, (ulong)Value);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteByte(long Position, byte Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -237,6 +248,7 @@ namespace ChocolArm64.Memory
|
|||
*((byte*)(RamPtr + (uint)Position)) = Value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteUInt16(long Position, ushort Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -246,6 +258,7 @@ namespace ChocolArm64.Memory
|
|||
*((ushort*)(RamPtr + (uint)Position)) = Value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteUInt32(long Position, uint Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -255,6 +268,7 @@ namespace ChocolArm64.Memory
|
|||
*((uint*)(RamPtr + (uint)Position)) = Value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteUInt64(long Position, ulong Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -264,6 +278,7 @@ namespace ChocolArm64.Memory
|
|||
*((ulong*)(RamPtr + (uint)Position)) = Value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteVector8(long Position, AVec Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -273,6 +288,7 @@ namespace ChocolArm64.Memory
|
|||
WriteByte(Position, Value.B0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteVector16(long Position, AVec Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -282,6 +298,7 @@ namespace ChocolArm64.Memory
|
|||
WriteUInt16(Position, Value.H0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteVector32(long Position, AVec Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -291,6 +308,7 @@ namespace ChocolArm64.Memory
|
|||
WriteUInt32(Position, Value.W0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteVector64(long Position, AVec Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
@ -300,6 +318,7 @@ namespace ChocolArm64.Memory
|
|||
WriteUInt64(Position, Value.X0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WriteVector128(long Position, AVec Value)
|
||||
{
|
||||
#if DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue