mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-16 20:00:18 +00:00
41 lines
1.3 KiB
C#
41 lines
1.3 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, bool inITBlock) => new OpCodeT16MemMult(inst, address, opCode, inITBlock);
|
|||
|
|
|||
|
public OpCodeT16MemMult(InstDescriptor inst, ulong address, int opCode, bool inITBlock) : base(inst, address, opCode, inITBlock)
|
|||
|
{
|
|||
|
RegisterMask = opCode & 0xff;
|
|||
|
Rn = (opCode >> 8) & 7;
|
|||
|
|
|||
|
int regCount = BitOperations.PopCount((uint)RegisterMask);
|
|||
|
|
|||
|
switch (inst.Name)
|
|||
|
{
|
|||
|
case InstName.Stm:
|
|||
|
IsLoad = false;
|
|||
|
Offset = 0;
|
|||
|
PostOffset = 4 * regCount;
|
|||
|
break;
|
|||
|
case InstName.Ldm:
|
|||
|
IsLoad = true;
|
|||
|
Offset = 0;
|
|||
|
PostOffset = 4 * regCount;
|
|||
|
break;
|
|||
|
default:
|
|||
|
throw new InvalidOperationException();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|