This is a collection of Intel®’ IA32® Software Developer's Manuals (URL of the day) and AMD' AMD64 Architecture Programmer's Manual together with the related specifications, application notes, white papers, and change logs. The collection aims to keep all available revisions. It was originally created by Michal Necasek, see OS/2 Museum.

If you have a public document, related to the IA32® specifications and missing from the collection, please mail it to me. The content of this URL and all sub-ULRs is available for convenient bulk download by rsync x86docs password "" (empty).

RMIF -- A64

RMIF

Rotate, mask insert flags

This instruction performs a rotation right of a value held in a general-purpose register by an immediate value, and then inserts a selection of the bottom four bits of the result of the rotation into the PSTATE flags, under the control of a second immediate mask.

Integer
(FEAT_FlagM)

313029282726252423222120191817161514131211109876543210
10111010000imm600001Rn0mask
sfopSo2

Encoding

RMIF <Xn>, #<shift>, #<mask>

Decode for this encoding

if !IsFeatureImplemented(FEAT_FlagM) then EndOfDecode(Decode_UNDEF); end; let imm : integer{} = UInt(imm6); let flagmask : bits(4) = mask; let n : integer{} = UInt(Rn);

Assembler Symbols

<Xn>

Is the 64-bit name of the general-purpose source register, encoded in the "Rn" field.

<shift>

Is the shift amount, in the range 0 to 63, defaulting to 0 and encoded in the "imm6" field.

<mask>

Is the flag bit mask, an immediate in the range 0 to 15, which selects the bits that are inserted into the NZCV condition flags, encoded in the "mask" field.

Operation

let reg : bits(64) = X{}(n); let flags : bits(4) = (reg::reg)[imm+3:imm]; if flagmask[3] == '1' then PSTATE.N = flags[3]; end; if flagmask[2] == '1' then PSTATE.Z = flags[2]; end; if flagmask[1] == '1' then PSTATE.C = flags[1]; end; if flagmask[0] == '1' then PSTATE.V = flags[0]; end;

Operational information

This instruction is a data-independent-time instruction as described in About PSTATE.DIT.


2026-03_rel 2026-03-26 20:48:11

Copyright © 2010-2026 Arm Limited or its affiliates. All rights reserved. This document is Non-Confidential.