ARM / OFFLINE REFERENCE

On this page
← Home

STGM

Store Allocation Tag multiple

This instruction writes a naturally aligned block of N Allocation Tags, where the size of N is identified in GMID_EL1.BS, and the Allocation Tag written to address A is taken from the source register at 4*A<7:4>+3:4*A<7:4>.

If the value of HCR_EL2.TGE is 0 and the Effective value of SCTLR2_EL1.GM0 is 0, this instruction is UNDEFINED at EL0.

If the value of HCR_EL2.TGE is 1 and the Effective value of SCTLR2_EL2.GM0 is 0, this instruction is UNDEFINED at EL0.

This instruction generates an Unchecked access.

Integer class
(FEAT_MTE2)

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 Rn Rt
opc imm9 op2

Encoding

STGM <Xt>, [<Xn|SP>]

Decode

if !IsFeatureImplemented(FEAT_MTE2) then EndOfDecode(Decode_UNDEF); end;
let t : integer{} = UInt(Rt);
let n : integer{} = UInt(Rn);

Assembler Symbols

<Xt>

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

<Xn|SP>

Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the "Rn" field.

Operation

if !IsGMEnabledAtEL0() && PSTATE.EL == EL0 then Undefined(); end;

let data : bits(64) = X{64}(t);
var address : bits(64);

if n == 31 then
    CheckSPAlignment();
    address = SP{64}();
else
    address = X{64}(n);
end;

let size : integer{} = 4 * 2 ^ UInt(GMID_EL1().BS);
address = AlignDownSize(address, size);
let count : integer = size >> LOG2_TAG_GRANULE;
var index : integer = UInt(address[LOG2_TAG_GRANULE+3:LOG2_TAG_GRANULE]);
let stzgm : boolean = FALSE;
let accdesc : AccessDescriptor = CreateAccDescLDGSTG(MemOp_STORE, stzgm, t);

for i = 0 to count-1 do
    let tag : bits(4) = data[index*:4];
    AArch64_MemTag(address, accdesc) = tag;
    address = AddressIncrement(address, TAG_GRANULE, accdesc);
    index = index + 1;
end;

Version 2026.09 — Copyright © 2010-2026 Arm Limited or its affiliates.

This site is provided as a community resource and is NOT affiliated with nor endorsed by Arm Limited.