extsh
Extend Sign Halfword
Sign extends the low halfword.
Details
Sign-extends the low 16 bits (halfword) of the source register to fill all 64 bits of the destination register. The instruction replicates bit 15 of RS to all higher-order bits. No condition registers or status fields are affected unless an extended form with a recorded bit is used (extsH.).
Pseudocode Operation
RA ← EXTS(RS[48:63], 64)
Programming Note
The extsh instruction is commonly used to sign-extend a halfword value from the source register into the destination register. Ensure that the source register contains a valid halfword value, and be aware that this operation affects the entire 64-bit destination register. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.
Example
Encoding
Operands
-
RA
Target -
RS
Source