rrx

Rotate Right with Extend (A32)

RRX{S}<c> <Rd>, <Rm>

Shifts register right by 1, inserting Carry flag into MSB.

Details

A32 Rotate Right with Extend by 1: Rd ← (C : Rm)[32:1], where the Carry flag is shifted into the MSB and the LSB is shifted out to C. If the S suffix is present, N and Z are updated from the result, and C is updated from the shifted-out bit; V is unaffected. Execution state: A32 only.

Pseudocode Operation

shifted_result ← (C : Rm)[32:1]
Rd ← shifted_result
if S then
  N ← shifted_result[31]
  Z ← (shifted_result == 0)
  C ← Rm[0]

Example

RRX r0, r2

Encoding

Binary Layout
cond
00011
01
0
0000
Rd
00000
11
0
Rm
 
Format Data Proc
Opcode 0x01A00060
Extension A32 (Base)

Operands

  • Rd
    Destination general-purpose register
  • Rm
    Second source / offset general-purpose register

Reference (Arm AArch32 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x01A00060 RRX{<c>}{<q>} {<Rd>,} <Rm> A32 cond | 00011 | 01 | 0 | 0000 | Rd | 00000 | 11 | 0 | Rm
0xEA4F0030 RRX{<c>}{<q>} {<Rd>,} <Rm> T32 1110101 | 0010 | 0 | 1111 | 0 | 000 | Rd | 00 | 11 | Rm

Description

Rotate Right with Extend provides the value of the contents of a register shifted right by one place, with the Carry flag shifted into bit[31].