15
15 – 52
SHIFTER
LOGICAL SHIFT
Syntax: [ IF cond ] SR = [SR OR] LSHIFT xop (HI) ;
(LO)
Permissible xops Permissible conds (see Table 15.9)
SI AR EQ LE AC
SR1 MR2 NE NEG NOT AC
SR0 MR1 GT POS MV
MR0 GE AV NOT MV
LT NOT AV NOT CE
Example: IF GE SR = LSHIFT SI (HI) ;
Description: Test the optional condition and, if true, then perform the
designated logical shift. If the condition is not true then perform a no-
operation. Omitting the condition performs the shift unconditionally. The
operation logically shifts the bits of the operand by the amount and
direction specified in the Shift Code from the SE register. Positive Shift
Codes cause a left shift (upshift) and negative Codes cause a right shift
(downshift).
The shift may be referenced to the upper half of the output field (HI
option) or to the lower half (LO option). The shift output may be logically
ORed with the present contents of the SR register by selecting the SR OR
option.
For LSHIFT with a positive Shift Code, the operand is shifted left; the
numbers of positions shifted is the count in the Shift Code. The 32-bit
output field is zero-filled from the right. Bits shifted out of the high order
bit in the 32-bit destination field (SR
31
) are dropped.
For LSHIFT with a negative Shift Code, the operand is shifted right; the
number of positions shifted is the count in the Shift Code. The 32-bit
output field is zero-filled from the left. Bits shifted out of the low order bit
in the destination field (SR
0
) are dropped.
To shift a double precision number, the same Shift Code is used for both
halves of the number. On the first cycle, the upper half of the number is
shifted using the HI option; on the following cycle, the lower half of the
number is shifted using the LO and OR options.
Status Generated: None affected.