STBFMAX, STBFMAXL

BFloat16 floating-point atomic maximum in memory, without return

This instruction atomically loads a 16-bit value from memory, computes the BFloat16 maximum with the value held in a register, and stores the result back to memory.

  • STBFMAXL stores to memory with release semantics.
  • STBFMAX has no release semantics.
  • This instruction:

  • Disables alternative floating-point behaviors, as if FPCR.AH is 0.
  • Generates only the default NaN, as if FPCR.DN is 1.
  • Does not modify the cumulative FPSR exception bits (IDC, IXC, UFC, OFC, DZC, and IOC).
  • Disables trapped floating-point exceptions, as if the FPCR trap enable bits (IDE, IXE, UFE, OFE, DZE, and IOE) are all zero.
  • For more information about memory ordering semantics, see Load-Acquire, Store-Release.

    For information about addressing modes, see Load/Store addressing modes.

    Encoding: Floating-point

    Variants: FEAT_LSFE (ARMv9.6)

    313029282726252423222120191817161514131211109876543210
    001111000111000011111
    sizeVRARRso3opcRnRt

    No memory ordering (R == 0)

    STBFMAX <Hs>, [<Xn|SP>]

    Release (R == 1)

    STBFMAXL <Hs>, [<Xn|SP>]

    Decoding algorithm

    if !IsFeatureImplemented(FEAT_LSFE) then EndOfDecode(Decode_UNDEF);
    
    constant integer s = UInt(Rs);
    constant integer n = UInt(Rn);
    
    constant integer datasize = 16;
    constant boolean acquire = FALSE;
    constant boolean release = R == '1';
    constant boolean tagchecked = n != 31;

    Operation

    CheckFPEnabled64();
    bits(64) address;
    bits(datasize) value;
    bits(datasize) data;
    constant AccessDescriptor accdesc = CreateAccDescFPAtomicOp(MemAtomicOp_BFMAX, acquire,
                                                                release, tagchecked);
    
    value = V[s, datasize];
    if n == 31 then
        CheckSPAlignment();
        address = SP[64];
    else
        address = X[n, 64];
    
    constant bits(datasize) comparevalue = bits(datasize) UNKNOWN; // Irrelevant when not executing CAS
    data = MemAtomic(address, comparevalue, value, accdesc);

    Explanations

    <Hs>: Is the 16-bit name of the SIMD&FP register holding the data value to be operated on with the contents of the memory location, encoded in the "Rs" field.
    <Xn|SP>: Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the "Rn" field.