I have trouble finding out what movslq
instruction does. Google isn't very helpful and there is no such instruction on this list. Here I have read that
MOVSLQ is move and sign-extend a value from a 32-bit source to a 64-bit destination.
I understand this like this. The instruction moves a value from 32-bit source to 64-bit destination but ensures that signed value of the number in the 64-bit destination is equal to the one from source, that is in case of negative number it fills first 32 bits of destination with ones, otherwise with zeros.
Is my understanding correct? If not, please explain where I am wrong.
EDIT:
This is not a duplicate of this topic: assembly cltq and movslq difference. There is no explanation for my question. And you'd have to read the whole answer for 10 minutes to convince yourself of that.
movsxd
: felixcloutier.com/x86/MOVSX:MOVSXD.html, and yes, it does 32->64 2's complement sign extension. You could figure this out yourself by assembling it with an AT&T assembler and disassembling with an Intel-syntax disassembler. (e.g.objdumpd -d -Mintel foo.o
) – Conductivitymovslq
in assembly cltq and movslq difference, the 2nd mention of it is in a sentence explaining that it'smovsx
, with a link to the Intel manual. You're right it's not a perfect duplicate, but I wanted to close it because there's a mechanical solution (assemble+disassemble) to find out Intel mnemonics for AT&T opcodes, and there's not really much else to say about it, so questions like this are somewhat low quality. – Conductivitymovslq
. – Conductivity