Arm64- why all filled with 1 the lower 32bit? Isn't it should be only 1 value?

40 Views Asked by At
mov x0, #1000

mov w6, #-1
add x7,x0,x6, sxtw

what will be the value of x6 and x7? [In hex] Here ans x6=0xffffffff //why all value of lower half filled with 1? and how sxtw work when the ans will be 999 in decimal. I want to know details how this happening.

1

There are 1 best solutions below

0
Parvez Hossain On
// 1= 000000000000000000000001 (On 32bit)
// -1= 111111111111111111111111
// So -1 in hex = 0xffffffff

The lower half of x6 will be filled with above value.

On 3rd statement it sign extends the value to 64bit so -1 is correct then it add 1000+(-1) and become value 999