mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-05 14:56:26 +02:00
Implement a new JIT for Arm devices
This commit is contained in:
parent
59a0c7cfd8
commit
cee2e2f600
127 changed files with 42538 additions and 25 deletions
38
src/Ryujinx.Cpu/LightningJit/CodeGen/Operand.cs
Normal file
38
src/Ryujinx.Cpu/LightningJit/CodeGen/Operand.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System.Diagnostics;
|
||||
|
||||
namespace Ryujinx.Cpu.LightningJit.CodeGen
|
||||
{
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue