Rotates the contents of a general-purpose register to the left by a specified number of bits, places the rotated word in the MQ Register, and places the logical AND of the rotated word and a generated mask in a general-purpose register.
Note: The srq instruction is supported only in the POWER architecture.
POWER | |
---|---|
srq | RA,RS,RB |
srq. | RA,RS,RB |
The srq instruction rotates the contents of the source general-purpose register (GPR) RS to the left by 32 minus N bits, where N is the shift amount specified in bits 27-31 of GPR RB, and stores the rotated word in the MQ Register. The mask depends on bit 26 of GPR RB.
Consider the following when using the srq instruction:
This instruction then stores the logical AND of the rotated word and the generated mask in GPR RA.
The srq instruction has two syntax forms. Each syntax form has a different effect on Condition Register Field 0.
Syntax Form | Overflow Exception (OE) | Fixed-Point Exception Register | Record Bit (Rc) | Condition Register Field 0 |
srq | None | None | 0 | None |
srq. | None | None | 1 | LT,GT,EQ,SO |
The two syntax forms of the srq instruction never affect the Fixed-Point Exception Register. If the syntax form sets the Record (Rc) bit to 1, the instruction affects the Less Than (LT) zero, Greater Than (GT) zero, Equal To (EQ) zero, and Summary Overflow (SO) bits in Condition Register Field 0.
# Assume GPR 4 holds 0x9000 300F. # Assume GPR 25 holds 0x0000 00024. srq 6,4,25 # GPR 6 now holds 0x0000 0000. # The MQ Register now holds 0xF900 0300.
# Assume GPR 4 holds 0xB000 300F. # Assume GPR 25 holds 0x0000 0004. srq. 6,4,8 # GPR 6 now holds 0x0B00 0300. # The MQ Register now holds 0xFB00 0300. # Condition Register Field 0 now contains 0x4.
Fixed-Point Rotate and Shift Instructions .