UMAX (immediate)

Unsigned maximum (immediate)

This instruction determines the unsigned maximum of the source register value and immediate, and writes the result to the destination register.

Encoding: Integer

Variants: FEAT_CSSC (ARMv8.9)

313029282726252423222120191817161514131211109876543210
0010001110001
sfopSopcimm8RnRd

32-bit (sf == 0)

UMAX <Wd>, <Wn>, #<uimm>

64-bit (sf == 1)

UMAX <Xd>, <Xn>, #<uimm>

Decoding algorithm

if !IsFeatureImplemented(FEAT_CSSC) then EndOfDecode(Decode_UNDEF);
constant integer d = UInt(Rd);
constant integer n = UInt(Rn);
constant integer datasize = 32 << UInt(sf);
constant integer imm = UInt(imm8);

Operation

constant bits(datasize) operand1 = X[n, datasize];
constant integer result = Max(UInt(operand1), imm);
X[d, datasize] = result;

Explanations

<Wd>: Is the 32-bit name of the general-purpose destination register, encoded in the "Rd" field.
<Wn>: Is the 32-bit name of the general-purpose source register, encoded in the "Rn" field.
<uimm>: Is an unsigned immediate, in the range 0 to 255, encoded in the "imm8" field.
<Xd>: Is the 64-bit name of the general-purpose destination register, encoded in the "Rd" field.
<Xn>: Is the 64-bit name of the general-purpose source register, encoded in the "Rn" field.

Operational Notes

If PSTATE.DIT is 1: