extsw
Extend Sign Word
extsw RT,RS
extsw. RT,RS
extsw. RT,RS
Sign extends the low word (32-bit) to 64 bits.
Details
The contents of register RS are extended to fill the upper 32 bits of register RA, and the lower 32 bits of RA are filled with a copy of the upper 32 bits of RS.
Pseudocode Operation
Programming Note
The extsw instruction is commonly used to sign-extend a 32-bit value in RS to a 64-bit value in RA. Ensure that the source register RS contains the correct 32-bit signed integer to avoid unexpected results. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.
Example
extsw r3, r3
Encoding
Binary Layout
31
0
RS
6
RA
11
986
31
/
Operands
-
RA
Target -
RS
Source -
RT
Target General Purpose Register