SUBS (extended register)
Subtract (extended register), setting flags.
This instruction is used by the alias CMP
(extended register).
Syntax
SUBS
Wd
, Wn|WSP
, Wm
{, extend
{#amount
}} ; 32-bit general registers
SUBS
Xd
, Xn|SP
, R
m
{, extend
{#amount
}} ; 64-bit general registers
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
orSXTX
.If
is WSP thenRn
LSL
is preferred rather thanUXTW
, and can be omitted when
is 0. In all other casesamount
is required and must beextend
UXTW
rather thanLSL
. - 64-bit general registers
-
Can be one of
UXTB
,UXTH
,UXTW
,LSL|UXTX
,SXTB
,SXTH
,SXTW
orSXTX
.If
is SP thenRn
LSL
is preferred rather thanUXTX
, and can be omitted when
is 0. In all other casesamount
is required and must beextend
UXTX
rather thanLSL
.
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
orX
. 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 whenextend
isLSL
, and is optional whenextend
is present but notLSL
.
Usage
The following table shows the valid specifier combinations:
Table 16-7 SUBS (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 |