[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Assembler Language Reference

srlq (Shift Right Long with MQ) Instruction

Purpose

Rotates the contents of a general-purpose register to the left by a specified number of bits, merges either the rotated data or a word of zeros with the contents of the MQ Register under control of a generated mask, and places the result in a general-purpose register.

Note: The srlq instruction is supported only in the POWER architecture.

Syntax

POWER
srlq RA,RS,RB
srlq. RA,RS,RB

Description

The srlq instruction rotates the contents of the source general-purpose register (GPR) RS to the left 32 minus N bits, where N is the shift amount specified in bits 27-31 of GPR RB. The merge depends on the value of bit 26 in GPR RB.

Consider the following when using the srlq instruction:

The merged word is stored in GPR RA. The MQ Register is not altered.

The srlq 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
srlq None None 0 None
srlq. None None 1 LT,GT,EQ,SO

The two syntax forms of the srlq 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.

Parameters

RA Specifies target general-purpose register where result of operation is stored.
RS Specifies source general-purpose register for operation.
RB Specifies source general-purpose register for operation.

Examples

  1. The following code rotates the contents of GPR 4 to the left by 28 bits, merges a word of zeros with the contents of the MQ Register under a mask, and places the merged result in GPR 6:
    # Assume GPR 4 contains 0x9000 300F.
    # Assume GPR 8 contains 0x0000 0024.
    # Assume the MQ Register contains 0xFFFF FFFF.
    srlq 6,4,8
    # GPR 6 now contains 0x0FFF FFFF.
    # The MQ Register remains unchanged.
  2. The following code rotates the contents of GPR 4 to the left by 28 bits, merges the rotated data with the contents of the MQ Register under a mask, places the merged result in GPR 6, and sets Condition Register Field 0 to reflect the result of the operation:
    # Assume GPR 4 contains 0xB004 3000.
    # Assume GPR 8 contains 0x00000 0004.
    # Assume the MQ Register contains 0xFFFF FFFF.
    srlq. 6,4,8
    # GPR 6 now holds 0xFB00 4300.
    # The MQ Register remains unchanged.
    # Condition Register Field 0 now contains 0x8.

Related Information

Fixed-Point Processor .

Fixed-Point Rotate and Shift Instructions .


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]