Implemented more arm64 instructions

This commit is contained in:
2025-03-13 23:12:15 +01:00
parent 5b3769a0db
commit ac14ab4f7a
18 changed files with 218 additions and 29 deletions

View File

@ -25,3 +25,20 @@ func TestSubRegisterNumber(t *testing.T) {
assert.DeepEqual(t, code, pattern.Code)
}
}
func TestSubRegisterRegister(t *testing.T) {
usagePatterns := []struct {
Destination cpu.Register
Source cpu.Register
Operand cpu.Register
Code uint32
}{
{arm.X0, arm.X1, arm.X2, 0xCB020020},
}
for _, pattern := range usagePatterns {
t.Logf("sub %s, %s, %s", pattern.Destination, pattern.Source, pattern.Operand)
code := arm.SubRegisterRegister(pattern.Destination, pattern.Source, pattern.Operand)
assert.DeepEqual(t, code, pattern.Code)
}
}