Fixed add and sub instruction encoding on arm64

This commit is contained in:
2025-03-15 15:51:08 +01:00
parent fea4e4cbe7
commit 93042f81e7
7 changed files with 49 additions and 13 deletions

View File

@ -33,6 +33,7 @@ func TestMoveRegisterNumber(t *testing.T) {
Number uint64
Code []byte
}{
{arm.X0, 0, []byte{0x00, 0x00, 0x80, 0xD2}},
{arm.X0, 0xCAFEBABE, []byte{0xC0, 0x57, 0x97, 0xD2, 0xC0, 0x5F, 0xB9, 0xF2}},
{arm.X0, 0xDEADC0DE, []byte{0xC0, 0x1B, 0x98, 0xD2, 0xA0, 0xD5, 0xBB, 0xF2}},
}
@ -51,8 +52,9 @@ func TestMoveRegisterNumberSI(t *testing.T) {
Code uint32
}{
// MOVZ
{arm.X0, 0, 0xD2800000},
{arm.X0, 1, 0xD2800020},
{arm.X0, 0x0, 0xD2800000},
{arm.X0, 0x1, 0xD2800020},
{arm.X0, 0x1000, 0xD2820000},
// MOV (bitmask immediate)
{arm.X0, 0x1FFFF, 0xB24043E0},