mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-08-17 14:18:44 +02:00
* Implement JIT Arm64 backend * PPTC version bump * Address some feedback from Arm64 JIT PR * Address even more PR feedback * Remove unused IsPageAligned function * Sync Qc flag before calls * Fix comment and remove unused enum * Address riperiperi PR feedback * Delete Breakpoint IR instruction that was only implemented for Arm64
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
using ARMeilleure.IntermediateRepresentation;
|
|
using System;
|
|
|
|
namespace ARMeilleure.CodeGen.RegisterAllocators
|
|
{
|
|
readonly struct RegisterMasks
|
|
{
|
|
public int IntAvailableRegisters { get; }
|
|
public int VecAvailableRegisters { get; }
|
|
public int IntCallerSavedRegisters { get; }
|
|
public int VecCallerSavedRegisters { get; }
|
|
public int IntCalleeSavedRegisters { get; }
|
|
public int VecCalleeSavedRegisters { get; }
|
|
public int RegistersCount { get; }
|
|
|
|
public RegisterMasks(
|
|
int intAvailableRegisters,
|
|
int vecAvailableRegisters,
|
|
int intCallerSavedRegisters,
|
|
int vecCallerSavedRegisters,
|
|
int intCalleeSavedRegisters,
|
|
int vecCalleeSavedRegisters,
|
|
int registersCount)
|
|
{
|
|
IntAvailableRegisters = intAvailableRegisters;
|
|
VecAvailableRegisters = vecAvailableRegisters;
|
|
IntCallerSavedRegisters = intCallerSavedRegisters;
|
|
VecCallerSavedRegisters = vecCallerSavedRegisters;
|
|
IntCalleeSavedRegisters = intCalleeSavedRegisters;
|
|
VecCalleeSavedRegisters = vecCalleeSavedRegisters;
|
|
RegistersCount = registersCount;
|
|
}
|
|
|
|
public int GetAvailableRegisters(RegisterType type)
|
|
{
|
|
if (type == RegisterType.Integer)
|
|
{
|
|
return IntAvailableRegisters;
|
|
}
|
|
else if (type == RegisterType.Vector)
|
|
{
|
|
return VecAvailableRegisters;
|
|
}
|
|
else
|
|
{
|
|
throw new ArgumentException($"Invalid register type \"{type}\".");
|
|
}
|
|
}
|
|
}
|
|
} |