16.8 ADDS (extended register)

Add (extended register), setting flags.

This instruction is used by the alias CMN (extended register).

Syntax

ADDS Wd, Wn|WSP, Wm{, extend {#amount}} ; 32-bit

ADDS Xd, Xn|SP, Rm{, extend {#amount}} ; 64-bit

Where:

Wd
Is the 32-bit name of the general-purpose destination register.
Wn|WSP
Is the 32-bit name of the first source general-purpose register or stack pointer.
Wm
Is the 32-bit name of the second general-purpose source register.
extend

Is the extension to be applied to the second source operand:

32-bit general registers

Can be one of UXTB, UXTH, LSL|UXTW, UXTX, SXTB, SXTH, SXTW or SXTX.

If Rn is WSP then LSL is preferred rather than UXTW, and can be omitted when amount is 0. In all other cases extend is required and must be UXTW rather than LSL.

64-bit general registers

Can be one of UXTB, UXTH, UXTW, LSL|UXTX, SXTB, SXTH, SXTW or SXTX.

If Rn is SP then LSL is preferred rather than UXTX, and can be omitted when amount is 0. In all other cases extend is required and must be UXTX rather than LSL.

Xd
Is the 64-bit name of the general-purpose destination register.
Xn|SP
Is the 64-bit name of the first source general-purpose register or stack pointer.
R
Is a width specifier, and can be either W or X.
m
Is the number [0-30] of the second general-purpose source register or the name ZR (31).
amount
Is the left shift amount to be applied after extension in the range 0 to 4, defaulting to 0. It must be absent when extend is absent, is required when extend is LSL, and is optional when extend is present but not LSL.

Operation

Add (extended register), setting flags, adds a register value and a sign or zero-extended register value, followed by an optional left shift amount, and writes the result to the destination register. The argument that is extended from the Rm register can be a byte, halfword, word, or doubleword. It updates the condition flags based on the result.

Rd = Rn + LSL(extend(Rm), amount), where R is either W or X.

Usage

Table 16-3 ADDS (64-bit general registers) specifier combinations

R extend
W SXTB
W SXTH
W SXTW
W UXTB
W UXTH
W UXTW
X LSL|UXTX
X SXTX
Non-ConfidentialPDF file icon PDF versionARM 100069_0608_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.