Fixed move with negative numbers on arm64
This commit is contained in:
parent
b3b233c6c9
commit
d5118148c9
1 changed files with 4 additions and 3 deletions
|
@ -22,16 +22,17 @@ func MoveRegisterNumber(code []byte, destination cpu.Register, number int) []byt
|
|||
func MoveRegisterNumberMI(code []byte, destination cpu.Register, number int) []byte {
|
||||
movz := MoveZero(destination, 0, uint16(number))
|
||||
code = binary.LittleEndian.AppendUint32(code, movz)
|
||||
num := uint64(number)
|
||||
halfword := 1
|
||||
|
||||
for {
|
||||
number >>= 16
|
||||
num >>= 16
|
||||
|
||||
if number == 0 {
|
||||
if num == 0 {
|
||||
return code
|
||||
}
|
||||
|
||||
movk := MoveKeep(destination, halfword, uint16(number))
|
||||
movk := MoveKeep(destination, halfword, uint16(num))
|
||||
code = binary.LittleEndian.AppendUint32(code, movk)
|
||||
halfword++
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue