16.148 SUB (shifted register)

Subtract (shifted register).

This instruction is used by the alias NEG (shifted register).

Syntax

SUB Wd, Wn, Wm{, shift #amount} ; 32-bit

SUB Xd, Xn, Xm{, shift #amount} ; 64-bit

Where:

Wd
Is the 32-bit name of the general-purpose destination register.
Wn
Is the 32-bit name of the first general-purpose source register.
Wm
Is the 32-bit name of the second general-purpose source register.
amount

Depends on the instruction variant:

32-bit general registers
Is the shift amount, in the range 0 to 31, defaulting to 0.
64-bit general registers
Is the shift amount, in the range 0 to 63, defaulting to 0.
Xd
Is the 64-bit name of the general-purpose destination register.
Xn
Is the 64-bit name of the first general-purpose source register.
Xm
Is the 64-bit name of the second general-purpose source register.
shift
Is the optional shift type to be applied to the second source operand, defaulting to LSL, and can be one of LSL, LSR, or ASR.

Operation

Subtract (shifted register) subtracts an optionally-shifted register value from a register value, and writes the result to the destination register.

Rd = Rn - shift(Rm, amount), where R is either W or X.

Non-ConfidentialPDF file icon PDF versionARM 100069_0608_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.