T16: Implement Add to SP (immediate)

This commit is contained in:
merry 2022-02-11 11:10:41 +00:00
parent 59e9c3d6b0
commit 1a2ae16395
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,22 @@
namespace ARMeilleure.Decoders
{
class OpCodeT16SpRel : OpCodeT16, IOpCode32AluImm
{
public int Rd { get; }
public int Rn => 13;
public bool SetFlags => false;
public int Immediate { get; }
public bool IsRotated => false;
public static new OpCode Create(InstDescriptor inst, ulong address, int opCode, bool inITBlock) => new OpCodeT16SpRel(inst, address, opCode, inITBlock);
public OpCodeT16SpRel(InstDescriptor inst, ulong address, int opCode, bool inITBlock) : base(inst, address, opCode, inITBlock)
{
Rd = (opCode >> 8) & 0x7;
Immediate = (opCode >> 0) & 0xff;
}
}
}

View file

@ -1022,6 +1022,7 @@ namespace ARMeilleure.Decoders
SetT16("10010xxxxxxxxxxx", InstName.Str, InstEmit32.Str, OpCodeT16MemSp.Create);
SetT16("10011xxxxxxxxxxx", InstName.Ldr, InstEmit32.Ldr, OpCodeT16MemSp.Create);
SetT16("10100xxxxxxxxxxx", InstName.Adr, InstEmit32.Adr, OpCodeT16Adr.Create);
SetT16("10101xxxxxxxxxxx", InstName.Add, InstEmit32.Add, OpCodeT16SpRel.Create);
#endregion
FillFastLookupTable(InstA32FastLookup, AllInstA32, ToFastLookupIndexA);