STADDB, STADDLB

Atomic add on byte in memory, without return, atomically loads an 8-bit byte from memory, adds the value held in a register to it, and stores the result back to memory.

For information about memory accesses see Load/Store addressing modes.

Integer
(ARMv8.1)

313029282726252423222120191817161514131211109876543210
001110000R1Rs000000Rn11111
sizeVAo3opc

No memory ordering (R == 0)

STADDB <Ws>, [<Xn|SP>]

Release (R == 1)

STADDLB <Ws>, [<Xn|SP>]

if !HaveAtomicExt() then UnallocatedEncoding(); integer n = UInt(Rn); integer s = UInt(Rs); AccType stacctype = if R == '1' then AccType_ORDEREDRW else AccType_ATOMICRW;

Assembler Symbols

<Ws>

Is the 32-bit name of the general-purpose 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.

Operation

bits(64) address; bits(8) value; bits(8) data; bits(8) result; value = X[s]; if n == 31 then CheckSPAlignment(); address = SP[]; else address = X[n]; data = Mem[address, 1, AccType_ATOMICRW]; result = data + value; // All observers in the shareability domain observe the // following load and store atomically. Mem[address, 1, stacctype] = result;


Internal version only: isa v25.07, AdvSIMD v23.0, pseudocode v31.3

Copyright © 2010-2017 ARM Limited or its affiliates. All rights reserved. This document is Confidential.