NEG (shifted register)
Negate (shifted register).
This instruction is an alias of SUB
(shifted register).
Syntax
NEG
Wd
, Wm
{, shift
#amount
} ; 32-bit general registers
Equivalent to SUB
.Wd
, WZR, Wm
{, shift
#amount
}
NEG
Xd
, Xm
{, shift
#amount
} ; 64-bit general registers
Equivalent to SUB
.Xd
, XZR, Xm
{, shift
#amount
}
Where:
Wd
-
Is the 32-bit name of the general-purpose destination register.
Wm
-
Is the 32-bit name of the 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.
Xm
-
Is the 64-bit name of the 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 ofLSL
,LSR
, orASR
.
Operation
Negate (shifted register) negates an optionally-shifted register value, and writes the result to the destination register.
, where R
d = 0 - shift
(R
m, amount
)
is either R
W
or X
.