mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-07 04:29:10 +02:00
Android changes
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ryujinx.Cpu.Nce.Arm64
|
||||
{
|
||||
struct Operand
|
||||
{
|
||||
public readonly OperandKind Kind { get; }
|
||||
public readonly OperandType Type { get; }
|
||||
public readonly ulong Value { get; }
|
||||
|
||||
public Operand(OperandKind kind, OperandType type, ulong value)
|
||||
{
|
||||
Kind = kind;
|
||||
Type = type;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public Operand(int index, RegisterType regType, OperandType type) : this(OperandKind.Register, type, (ulong)((int)regType << 24 | index))
|
||||
{
|
||||
}
|
||||
|
||||
public Operand(OperandType type, ulong value) : this(OperandKind.Constant, type, value)
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly Register GetRegister()
|
||||
{
|
||||
Debug.Assert(Kind == OperandKind.Register);
|
||||
|
||||
return new Register((int)Value & 0xffffff, (RegisterType)(Value >> 24));
|
||||
}
|
||||
|
||||
public readonly int AsInt32()
|
||||
{
|
||||
return (int)Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user