mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-29 04:26:24 +02:00

* Implement a new JIT for Arm devices * Auto-format * Make a lot of Assembler members read-only * More read-only * Fix more warnings * ObjectDisposedException.ThrowIf * New JIT cache for platforms that enforce W^X, currently unused * Remove unused using * Fix assert * Pass memory manager type around * Safe memory manager mode support + other improvements * Actual safe memory manager mode masking support * PR feedback
42 lines
931 B
C#
42 lines
931 B
C#
using System;
|
|
|
|
namespace Ryujinx.Cpu.LightningJit.CodeGen
|
|
{
|
|
readonly struct Register : IEquatable<Register>
|
|
{
|
|
public int Index { get; }
|
|
|
|
public RegisterType Type { get; }
|
|
|
|
public Register(int index, RegisterType type)
|
|
{
|
|
Index = index;
|
|
Type = type;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return (ushort)Index | ((int)Type << 16);
|
|
}
|
|
|
|
public static bool operator ==(Register x, Register y)
|
|
{
|
|
return x.Equals(y);
|
|
}
|
|
|
|
public static bool operator !=(Register x, Register y)
|
|
{
|
|
return !x.Equals(y);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is Register reg && Equals(reg);
|
|
}
|
|
|
|
public bool Equals(Register other)
|
|
{
|
|
return other.Index == Index && other.Type == Type;
|
|
}
|
|
}
|
|
}
|