Page 115 - ARM 64 Bit Assembly Language
P. 115

Data processing and other instructions 101

                     cneg    Conditional Negate,
                     cset    Conditional Set, and
                     csetm   Conditional Set Mask.
                     Conditional comparison instructions allow PSTATE to be set to either a comparison or an im-
                     mediate, depending on the flags in PSTATE:

                     ccmp    Conditional Compare,
                     ccmn    Conditional Compare Negative.
                     The conditional compare and compare negative instructions check the PSTATE flags for the
                     given condition. If it is true, then it sets the PSTATE flags to the comparison of Rn and either
                     Rm or <imm5>.Ifitisfalse,itsetsthe PSTATE flags to an immediate four bit value represent-
                     ing nzcv.

                     4.2.10.1 Syntax

                          <op>      Rd, Rn, Rm, <cond>
                          <op2>     Rd, Rn, <cond>
                          <op3>     Rd, <cond>
                          ccmp      Rn, Rm|#<imm5>, #<nzcv>, <cond>
                          ccmn      Rn, Rm|#<imm5>, #<nzcv>, <cond>


                     •   <op> is one of csel, csinc, csinv,or csneg.
                     •   <op2> is one of cinc, cinv,or cneg.
                     •   <op3> is cset or csetm.
                     •   The <cond> is any one of the codes from Table 3.2 on page 59.
                     •   The <nzcv> is any number 0-15 (0x0-0xf). It is four bits representing the N, Z, C, and V
                         flags.
                     •   The <imm5> is an unsigned 5-bit immediate.


                     4.2.10.2 Operations

                       Name     Effect                               Description
                       csel     if < cond > then                     Set Rd to Rn or Rm.
                                 Rd ← Rn
                                else
                                 Rd ← Rm
                                end if
                                                                                    continued on next page
   110   111   112   113   114   115   116   117   118   119   120