Hi,
What's the purpose of the SXTX extend? I understand the concept of sign extension when, say, the source register is 32-bit and the target is 64-bit.
In this case, however, both registers are 64-bit. So what's the point? What can you do with SXTX that you cannot do using other LDR (register) variants?
Thanks,
Nikita
Right, if the offset is 32bit and signed it needs to be sign extended.
But how is this relevant to my question? IIUC, SXTX doesn't work with 32-bit operands.
For example:
.text .global _start _start: ldr x1, =buf3 movn x2, #0 // x2 = -1 ldr x0, [x1, x2, sxtx] // x0 = [buf3 + (-1)] ldr x1, =buf3 movn x2, #0 // x2 = -1 ldr x0, [x1, w2, sxtx] // invalid .data buf0: .byte 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18 buf1: .byte 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28 buf2: .byte 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 buf3: .byte 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 buf4: .byte 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58 buf5: .byte 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68 buf6: .byte 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78
My guess above is about the first case.
Right, sxtx is not allowed, but sxtw:
<Wm> When option<0> is set to 0, is the 32-bit name of the general-purpose index register, encoded in the "Rm" field.
and
UXTW when option = 010LSL when option = 011SXTW when option = 110SXTX when option = 111But the sense behind: ldr x0,[x1,x2,sxtx] is not clear to me I have to admit.I need to test this on real hardware.
42Bastian Schick said:ldr x0,[x1,x2,sxtx]
I guess, it is just, that there are no exceptions in the coding. sxtx is completely meaningless IMHO.