Page 112 - ARM 64 Bit Assembly Language
P. 112
98 Chapter 4
• The <op> is either sdiv or udiv.
4.2.8.2 Operations
Name Effect Description
sdiv Rd ← Rm ÷ Rn Signed divide.
udiv Rd ← Rm ÷ Rn Unsigned divide.
4.2.8.3 Examples
1 sdiv x0, x1, x2 // x0 = x1 / x2 (signed)
2 udiv x0, x1, x2 // x0 = x1 / x2 (unsigned)
4.2.9 Comparison operations
These three comparison operations update the PSTATE flags, but have no other effect:
cmp Compare,
cmn Compare Negative, and
tst Test Bits.
They each perform an arithmetic operation, but result of the operation is discarded. cmp is an
alias of subs, cmn is an alias of adds,and tst is an alias of ands.
4.2.9.1 Syntax
<op> Rn, Operand2
• <op> is one of cmp, cmn,or tst.
4.2.9.2 Operations
Name Effect Description
cmp Rn − Operand2 Compare and set PSTATE flags.
cmn Rn + Operand2 Compare negative and set PSTATE
flags.
tst Rn ∧ Operand2 Test bits and set PSTATE flags.
teq Rn ⊕ Operand2 Test equivalence and set PSTATE
flags.