mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-10 15:01:43 +00:00
38 lines
957 B
C#
38 lines
957 B
C#
|
using System;
|
||
|
|
||
|
namespace ARMeilleure.Decoders
|
||
|
{
|
||
|
class OpCodeAluImm : OpCodeAlu, IOpCodeAluImm
|
||
|
{
|
||
|
public long Immediate { get; private set; }
|
||
|
|
||
|
public OpCodeAluImm(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
|
||
|
{
|
||
|
if (DataOp == DataOp.Arithmetic)
|
||
|
{
|
||
|
Immediate = (opCode >> 10) & 0xfff;
|
||
|
|
||
|
int shift = (opCode >> 22) & 3;
|
||
|
|
||
|
Immediate <<= shift * 12;
|
||
|
}
|
||
|
else if (DataOp == DataOp.Logical)
|
||
|
{
|
||
|
var bm = DecoderHelper.DecodeBitMask(opCode, true);
|
||
|
|
||
|
if (bm.IsUndefined)
|
||
|
{
|
||
|
Instruction = InstDescriptor.Undefined;
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
Immediate = bm.WMask;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
throw new ArgumentException(nameof(opCode));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|