29.3.3. x86 CQTO and CLTQ instructions
Examples:
Instructions without E suffix: sign extend RAX into RDX:RAX.
Instructions E suffix: sign extend withing RAX itself.
Common combo with IDIV 32-bit, which takes the input from EDX:EAX: so you need to set up EDX before calling it.
Has some Intel vs AT&T name overload hell:
GNU GAS accepts both syntaxes, see: Table 5, “CQTO and CLTQ family Intel vs AT&T”.
Intel | AT&T | From |
---|---|---|
To |
CBW |
CBTW |
AL |
AX |
CWDE |
CWTL |
AX |
EAX |
CWD |
CWTD |
AX |
DX:AX |
CDQ |
CLTD |
EAX |
EDX:EAX |
CDQE |
CLTQ |
EAX |
RAX |
CQO |
CQTO |
RAX |