mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-16 03:20:18 +00:00
33 lines
1 KiB
C#
33 lines
1 KiB
C#
using ARMeilleure.Instructions;
|
|
using System;
|
|
using System.Numerics;
|
|
|
|
namespace ARMeilleure.Decoders
|
|
{
|
|
class OpCodeT16MemMult : OpCodeT16, IOpCode32MemMult
|
|
{
|
|
public int Rn { get; }
|
|
public int RegisterMask { get; }
|
|
public int PostOffset { get; }
|
|
public bool IsLoad { get; }
|
|
public int Offset { get; }
|
|
|
|
public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeT16MemMult(inst, address, opCode);
|
|
|
|
public OpCodeT16MemMult(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
|
|
{
|
|
int regCount = BitOperations.PopCount((uint)RegisterMask);
|
|
|
|
RegisterMask = opCode & 0xff;
|
|
Rn = (opCode >> 8) & 7;
|
|
Offset = 0;
|
|
PostOffset = 4 * regCount;
|
|
IsLoad = inst.Name switch
|
|
{
|
|
InstName.Ldm => true,
|
|
InstName.Stm => false,
|
|
_ => throw new InvalidOperationException()
|
|
};
|
|
}
|
|
}
|
|
}
|