[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Assembler Language Reference

sradi (Shift Right Algebraic Double Word Immediate) Instruction

Purpose

Algebraically shift the contents of a general purpose register right by the number of bits specified by the immediate value. Place the result of the operation in another general purpose register.

Syntax

Bits Value
0-5 31
6-10 S
11-15 A
16-20 sh
21-29 413
30 sh
31 Rc
POWER family
sradi RA, RS, SH (Rc=0)
sradi. RA, RS, SH (Rc=1)

Description

The contents of general purpose register (GPR) RS are shifted right SH bits. Bits shifted out of position 63 are lost. Bit 0 of GPR RS is replicated to fill the vacated positions on the left. The result is placed into GPR RA. XER[CA] is set if GPR RS is negative and any 1 bits are shifted out of position 63; otherwise XER[CA] is cleared. A shift amount of zero causes GPR RA to be set equal to GPR RS, and XER[CA] to be cleared.

Note that the sradi instruction, followed by addze, can by used to divide quickly by 2**n. The setting of the CA bit, by sradi, is independent of mode.

Other registers altered:

Parameters

RA Specifies target general-purpose register for the result of the operation.
RS Specifies source general-purpose register containing the operand for the shift operation.
SH Specifies shift value for operation.

Implementation

This instruction is defined only for 64-bit implementations. Using it on a 32-bit implementation will cause the system illegal instruction error handler to be invoked.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]