Rotates the contents of a general-purpose register to the left by a specified number of bits, places a copy of the rotated data in the MQ Register, merges the rotated word and a word of 32 sign bits from the general-purpose register under control of a mask, and places the result in another general-purpose register.
Note: The srea instruction is supported only in the POWER family architecture.
Bits | Value |
---|---|
0-5 | 31 |
6-10 | RS |
11-15 | RA |
16-20 | RB |
21-30 | 921 |
31 | Rc |
POWER family | |
---|---|
srea | RA, RS, RB |
srea. | RA, RS, RB |
The srea 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, stores the rotated word in the MQ Register, and merges the rotated word and a word of 32 sign bits from GPR RS under control of a generated mask. A word of 32 sign bits is generated by taking the sign bit of a general-purpose register and repeating it 32 times to make a full word. This word can be either 0x0000 0000 or 0xFFFF FFFF depending on the value of the general-purpose register. The mask consists of N zeros followed by 32 minus N ones. The merged word is stored in GPR RA.
This instruction then ANDs the rotated data with the complement of the generated mask, ORs together the 32-bit result, and ANDs the bit result with bit 0 of GPR RS to produce the Carry bit (CA).
The srea 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 |
srea | None | CA | 0 | None |
srea | None | CA | 1 | LT,GT,EQ,SO |
The two syntax forms of the srea instruction always affect the Carry bit (CA) in 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 contains 0x9000 3000. # Assume GPR 7 contains 0x0000 0004. srea 6,4,7 # GPR 6 now contains 0xF900 0300. # The MQ Register now contains 0x0900 0300.
# Assume GPR 4 contains 0xB004 3000. # Assume GPR 7 contains 0x0000 0004. srea. 6,4,7 # GPR 6 now contains 0xFB00 4300. # The MQ Register now contains 0x0B00 4300. # Condition Register Field 0 now contains 0x8.
The addze or aze (Add to Zero Extended) instruction.
Fixed-Point Rotate and Shift Instructions .