Implemented more arm64 instructions

This commit is contained in:
Eduard Urbach 2025-03-13 23:12:15 +01:00
parent 29ee6730f2
commit b7d76ff3e3
Signed by: eduard
GPG key ID: 49226B848C78F6C8
18 changed files with 218 additions and 29 deletions

View file

@ -6,7 +6,5 @@ import "git.urbach.dev/cli/q/src/cpu"
// loads two 64-bit doublewords from memory, and writes them to two registers.
// This is the post-index version of the instruction so the offset is applied to the base register after the memory access.
func LoadPair(reg1 cpu.Register, reg2 cpu.Register, base cpu.Register, offset int) uint32 {
offset /= 8
offset &= 0b111_1111
return 0b1010100011<<22 | (uint32(offset) << 15) | (uint32(reg2) << 10) | (uint32(base) << 5) | uint32(reg1)
return 0b1010100011<<22 | pair(reg1, reg2, base, offset/8)
}