SMIN (immediate)

Signed minimum (immediate)

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

Encoding: Integer

Variants: FEAT_CSSC (ARMv8.9)

313029282726252423222120191817161514131211109876543210
0010001110010
sfopSopcimm8RnRd

32-bit (sf == 0)

SMIN <Wd>, <Wn>, #<simm>

64-bit (sf == 1)

SMIN <Xd>, <Xn>, #<simm>

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 = SInt(imm8);

Operation

constant bits(datasize) operand1 = X[n, datasize];
constant integer result = Min(SInt(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.
<simm>: Is a signed immediate, in the range -128 to 127, 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: