Move the rules for CBZ/TBZ to be above the rules for
CBB<cond>/CBH<cond>/CB<cond>. We want them to have higher priority
because they can express larger displacements.

gcc/ChangeLog:

        * config/aarch64/aarch64.md (aarch64_cbz<optab><mode>1): Move
        above rules for CBB<cond>/CBH<cond>/CB<cond>.
        (*aarch64_tbz<optab><mode>1): Likewise.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/cmpbr.c: Update tests.
---
 gcc/config/aarch64/aarch64.md            | 162 ++++++++++++-----------
 gcc/testsuite/gcc.target/aarch64/cmpbr.c |  32 ++---
 2 files changed, 104 insertions(+), 90 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 0b708f8b2f6..d3514ff1ef9 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -697,27 +697,38 @@ (define_insn "jump"
 ;; Maximum PC-relative positive/negative displacements for various branching
 ;; instructions.
 (define_constants
   [
     ;; +/- 128MiB.  Used by B, BL.
     (BRANCH_LEN_P_128MiB  134217724)
     (BRANCH_LEN_N_128MiB -134217728)
 
     ;; +/- 1MiB.  Used by B.<cond>, CBZ, CBNZ.
     (BRANCH_LEN_P_1MiB  1048572)
     (BRANCH_LEN_N_1MiB -1048576)
 
     ;; +/- 32KiB.  Used by TBZ, TBNZ.
     (BRANCH_LEN_P_32KiB  32764)
     (BRANCH_LEN_N_32KiB -32768)
 
     ;; +/- 1KiB.  Used by CBB<cond>, CBH<cond>, CB<cond>.
     (BRANCH_LEN_P_1Kib  1020)
     (BRANCH_LEN_N_1Kib -1024)
   ]
 )
 
 ;; -------------------------------------------------------------------
 ;; Conditional jumps
+;; The order of the rules below is important.
+;; Higher priority rules are preferred because they can express larger
+;; displacements.
+;; 1) EQ/NE comparisons against zero are handled by CBZ/CBNZ.
+;; 2) LT/GE comparisons against zero are handled by TBZ/TBNZ.
+;; 3) When the CMPBR extension is enabled:
+;;   a) Comparisons between two registers are handled by
+;;      CBB<cond>/CBH<cond>/CB<cond>.
+;;   b) Comparisons between a GP register and an immediate in the range 0-63 
are
+;;      handled by CB<cond> (immediate).
+;; 4) Otherwise, emit a CMP+B<cond> sequence.
 ;; -------------------------------------------------------------------
 
 (define_expand "cbranch<GPI:mode>4"
@@ -770,14 +781,91 @@ (define_expand "cbranch<mode>4"
 (define_expand "cbranchcc4"
   [(set (pc) (if_then_else (match_operator 0 "aarch64_comparison_operator"
                            [(match_operand 1 "cc_register")
                             (match_operand 2 "const0_operand")])
                           (label_ref (match_operand 3))
                           (pc)))]
   ""
   ""
 )
 
+;; For an EQ/NE comparison against zero, emit `CBZ`/`CBNZ`
+(define_insn "aarch64_cbz<optab><mode>1"
+  [(set (pc) (if_then_else (EQL (match_operand:GPI 0 "register_operand" "r")
+                               (const_int 0))
+                          (label_ref (match_operand 1))
+                          (pc)))]
+  "!aarch64_track_speculation"
+  {
+    if (get_attr_length (insn) == 8)
+      return aarch64_gen_far_branch (operands, 1, "Lcb", "<inv_cb>\\t%<w>0, ");
+    else
+      return "<cbz>\\t%<w>0, %l1";
+  }
+  [(set_attr "type" "branch")
+   (set (attr "length")
+       (if_then_else (and (ge (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_N_1MiB))
+                          (lt (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_P_1MiB)))
+                     (const_int 4)
+                     (const_int 8)))
+   (set (attr "far_branch")
+       (if_then_else (and (ge (minus (match_dup 2) (pc))
+                              (const_int BRANCH_LEN_N_1MiB))
+                          (lt (minus (match_dup 2) (pc))
+                              (const_int BRANCH_LEN_P_1MiB)))
+                     (const_string "no")
+                     (const_string "yes")))]
+)
+
+;; For an LT/GE comparison against zero, emit `TBZ`/`TBNZ`
+(define_insn "*aarch64_tbz<optab><mode>1"
+  [(set (pc) (if_then_else (LTGE (match_operand:ALLI 0 "register_operand" "r")
+                                (const_int 0))
+                          (label_ref (match_operand 1))
+                          (pc)))
+   (clobber (reg:CC CC_REGNUM))]
+  "!aarch64_track_speculation"
+  {
+    if (get_attr_length (insn) == 8)
+      {
+       if (get_attr_far_branch (insn) == FAR_BRANCH_YES)
+         return aarch64_gen_far_branch (operands, 1, "Ltb",
+                                        "<inv_tb>\\t%<w>0, <sizem1>, ");
+       else
+         {
+           char buf[64];
+           uint64_t val = ((uint64_t) 1)
+               << (GET_MODE_SIZE (<MODE>mode) * BITS_PER_UNIT - 1);
+           sprintf (buf, "tst\t%%<w>0, %" PRId64, val);
+           output_asm_insn (buf, operands);
+           return "<bcond>\t%l1";
+         }
+      }
+    else
+      return "<tbz>\t%<w>0, <sizem1>, %l1";
+  }
+  [(set_attr "type" "branch")
+   (set (attr "length")
+       (if_then_else (and (ge (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_N_32KiB))
+                          (lt (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_P_32KiB)))
+                     (const_int 4)
+                     (const_int 8)))
+   (set (attr "far_branch")
+       (if_then_else (and (ge (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_N_1MiB))
+                          (lt (minus (match_dup 1) (pc))
+                              (const_int BRANCH_LEN_P_1MiB)))
+                     (const_string "no")
+                     (const_string "yes")))]
+)
+
 ;; Emit a `CB<cond> (register)` or `CB<cond> (immediate)` instruction.
+;; Only immediates in the range 0-63 are supported.
+;; Comparisons against immediates outside this range fall back to
+;; CMP + B<cond>.
 (define_insn "aarch64_cb<GPI:mode>"
   [(set (pc) (if_then_else (match_operator 0 "aarch64_comparison_operator"
                            [(match_operand:GPI 1 "register_operand" "r")
@@ -867,112 +955,38 @@ (define_insn "aarch64_bcond"
 ;; For a 24-bit immediate CST we can optimize the compare for equality
 ;; and branch sequence from:
 ;;     mov     x0, #imm1
 ;;     movk    x0, #imm2, lsl 16 /* x0 contains CST.  */
 ;;     cmp     x1, x0
 ;;     b<ne,eq> .Label
 ;; into the shorter:
 ;;     sub     x0, x1, #(CST & 0xfff000)
 ;;     subs    x0, x0, #(CST & 0x000fff)
 ;;     b<ne,eq> .Label
 (define_insn_and_split "*aarch64_bcond_wide_imm<GPI:mode>"
   [(set (pc) (if_then_else (EQL (match_operand:GPI 0 "register_operand" "r")
                                (match_operand:GPI 1 "aarch64_imm24" "n"))
                           (label_ref:P (match_operand 2))
                           (pc)))]
   "!aarch64_move_imm (INTVAL (operands[1]), <GPI:MODE>mode)
    && !aarch64_plus_operand (operands[1], <GPI:MODE>mode)
    && !reload_completed"
   "#"
   "&& true"
   [(const_int 0)]
   {
     HOST_WIDE_INT lo_imm = UINTVAL (operands[1]) & 0xfff;
     HOST_WIDE_INT hi_imm = UINTVAL (operands[1]) & 0xfff000;
     rtx tmp = gen_reg_rtx (<GPI:MODE>mode);
     emit_insn (gen_add<GPI:mode>3 (tmp, operands[0], GEN_INT (-hi_imm)));
     emit_insn (gen_add<GPI:mode>3_compare0 (tmp, tmp, GEN_INT (-lo_imm)));
     rtx cc_reg = gen_rtx_REG (CC_NZmode, CC_REGNUM);
     rtx cmp_rtx = gen_rtx_fmt_ee (<EQL:CMP>, <GPI:MODE>mode,
                                  cc_reg, const0_rtx);
     emit_jump_insn (gen_aarch64_bcond (cmp_rtx, cc_reg, operands[2]));
     DONE;
   }
 )
 
-;; For an EQ/NE comparison against zero, emit `CBZ`/`CBNZ`
-(define_insn "aarch64_cbz<optab><mode>1"
-  [(set (pc) (if_then_else (EQL (match_operand:GPI 0 "register_operand" "r")
-                               (const_int 0))
-                          (label_ref (match_operand 1))
-                          (pc)))]
-  "!aarch64_track_speculation"
-  {
-    if (get_attr_length (insn) == 8)
-      return aarch64_gen_far_branch (operands, 1, "Lcb", "<inv_cb>\\t%<w>0, ");
-    else
-      return "<cbz>\\t%<w>0, %l1";
-  }
-  [(set_attr "type" "branch")
-   (set (attr "length")
-       (if_then_else (and (ge (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_N_1MiB))
-                          (lt (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_P_1MiB)))
-                     (const_int 4)
-                     (const_int 8)))
-   (set (attr "far_branch")
-       (if_then_else (and (ge (minus (match_dup 2) (pc))
-                              (const_int BRANCH_LEN_N_1MiB))
-                          (lt (minus (match_dup 2) (pc))
-                              (const_int BRANCH_LEN_P_1MiB)))
-                     (const_string "no")
-                     (const_string "yes")))]
-)
-
-;; For an LT/GE comparison against zero, emit `TBZ`/`TBNZ`
-(define_insn "*aarch64_tbz<optab><mode>1"
-  [(set (pc) (if_then_else (LTGE (match_operand:ALLI 0 "register_operand" "r")
-                                (const_int 0))
-                          (label_ref (match_operand 1))
-                          (pc)))
-   (clobber (reg:CC CC_REGNUM))]
-  "!aarch64_track_speculation"
-  {
-    if (get_attr_length (insn) == 8)
-      {
-       if (get_attr_far_branch (insn) == FAR_BRANCH_YES)
-         return aarch64_gen_far_branch (operands, 1, "Ltb",
-                                        "<inv_tb>\\t%<w>0, <sizem1>, ");
-       else
-         {
-           char buf[64];
-           uint64_t val = ((uint64_t) 1)
-               << (GET_MODE_SIZE (<MODE>mode) * BITS_PER_UNIT - 1);
-           sprintf (buf, "tst\t%%<w>0, %" PRId64, val);
-           output_asm_insn (buf, operands);
-           return "<bcond>\t%l1";
-         }
-      }
-    else
-      return "<tbz>\t%<w>0, <sizem1>, %l1";
-  }
-  [(set_attr "type" "branch")
-   (set (attr "length")
-       (if_then_else (and (ge (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_N_32KiB))
-                          (lt (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_P_32KiB)))
-                     (const_int 4)
-                     (const_int 8)))
-   (set (attr "far_branch")
-       (if_then_else (and (ge (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_N_1MiB))
-                          (lt (minus (match_dup 1) (pc))
-                              (const_int BRANCH_LEN_P_1MiB)))
-                     (const_string "no")
-                     (const_string "yes")))]
-)
-
 ;; -------------------------------------------------------------------
 ;; Test bit and branch
 ;; -------------------------------------------------------------------
diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr.c 
b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
index f97b8026efe..62448214892 100644
--- a/gcc/testsuite/gcc.target/aarch64/cmpbr.c
+++ b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
@@ -85,1397 +85,1397 @@ COMPARE_ALL(u32, i32, 4098);
 COMPARE_ALL(u64, i64, 4098);
 
 /*
 ** u8_x0_eq_x1:
 **     cbbeq   w1, w0, .L4
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u8_x0_ne_x1:
 **     cbbeq   w1, w0, .L6
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ult_x1:
 **     cbbls   w1, w0, .L8
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ule_x1:
 **     cbbcc   w1, w0, .L10
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ugt_x1:
 **     cbbcs   w1, w0, .L12
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_uge_x1:
 **     cbbhi   w1, w0, .L14
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_slt_x1:
 **     cbble   w1, w0, .L16
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sle_x1:
 **     cbblt   w1, w0, .L18
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sgt_x1:
 **     cbbge   w1, w0, .L20
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sge_x1:
 **     cbbgt   w1, w0, .L22
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_eq_x1:
 **     cbheq   w1, w0, .L25
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u16_x0_ne_x1:
 **     cbheq   w1, w0, .L27
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ult_x1:
 **     cbhls   w1, w0, .L29
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ule_x1:
 **     cbhcc   w1, w0, .L31
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ugt_x1:
 **     cbhcs   w1, w0, .L33
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_uge_x1:
 **     cbhhi   w1, w0, .L35
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_slt_x1:
 **     cbhle   w1, w0, .L37
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sle_x1:
 **     cbhlt   w1, w0, .L39
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sgt_x1:
 **     cbhge   w1, w0, .L41
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sge_x1:
 **     cbhgt   w1, w0, .L43
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_eq_x1:
 **     cbeq    w0, w1, .L46
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u32_x0_ne_x1:
 **     cbeq    w0, w1, .L48
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ult_x1:
 **     cbcs    w0, w1, .L50
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ule_x1:
 **     cbhi    w0, w1, .L52
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ugt_x1:
 **     cbls    w0, w1, .L54
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_uge_x1:
 **     cbcc    w0, w1, .L56
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_slt_x1:
 **     cbge    w0, w1, .L58
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sle_x1:
 **     cbgt    w0, w1, .L60
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sgt_x1:
 **     cble    w0, w1, .L62
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sge_x1:
 **     cblt    w0, w1, .L64
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_eq_x1:
 **     cbeq    x0, x1, .L67
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u64_x0_ne_x1:
 **     cbeq    x0, x1, .L69
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ult_x1:
 **     cbcs    x0, x1, .L71
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ule_x1:
 **     cbhi    x0, x1, .L73
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ugt_x1:
 **     cbls    x0, x1, .L75
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_uge_x1:
 **     cbcc    x0, x1, .L77
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_slt_x1:
 **     cbge    x0, x1, .L79
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sle_x1:
 **     cbgt    x0, x1, .L81
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sgt_x1:
 **     cble    x0, x1, .L83
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sge_x1:
 **     cblt    x0, x1, .L85
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_eq_42:
 **     cbeq    w0, 42, .L88
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u32_x0_ne_42:
 **     cbeq    w0, 42, .L90
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ult_42:
 **     cbhi    w0, 41, .L92
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ule_42:
 **     cbhi    w0, 42, .L94
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ugt_42:
 **     cbls    w0, 42, .L96
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_uge_42:
 **     cbls    w0, 41, .L98
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_slt_42:
 **     cbgt    w0, 41, .L100
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sle_42:
 **     cbgt    w0, 42, .L102
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sgt_42:
 **     cble    w0, 42, .L104
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sge_42:
 **     cble    w0, 41, .L106
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_eq_42:
 **     cbeq    x0, 42, .L109
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u64_x0_ne_42:
 **     cbeq    x0, 42, .L111
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ult_42:
 **     cbhi    x0, 41, .L113
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ule_42:
 **     cbhi    x0, 42, .L115
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ugt_42:
 **     cbls    x0, 42, .L117
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_uge_42:
 **     cbls    x0, 41, .L119
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_slt_42:
 **     cbgt    x0, 41, .L121
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sle_42:
 **     cbgt    x0, 42, .L123
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sgt_42:
 **     cble    x0, 42, .L125
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sge_42:
 **     cble    x0, 41, .L127
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_eq_0:
 **     cbbne   w0, wzr, .L129
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ne_0:
 **     cbbeq   w0, wzr, .L131
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ult_0:
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ule_0:
 **     cbbne   w0, wzr, .L134
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ugt_0:
 **     cbbeq   w0, wzr, .L136
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_uge_0:
 **     b       taken
 */
 
 /*
 ** i8_x0_slt_0:
-**     cbblt   w0, wzr, .L140
+**     tbnz    w0, #7, .L140
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i8_x0_sle_0:
 **     cbble   w0, wzr, .L143
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i8_x0_sgt_0:
 **     cbble   w0, wzr, .L145
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sge_0:
-**     cbblt   w0, wzr, .L147
+**     tbnz    w0, #7, .L147
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_eq_0:
 **     cbhne   w0, wzr, .L149
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ne_0:
 **     cbheq   w0, wzr, .L151
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ult_0:
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ule_0:
 **     cbhne   w0, wzr, .L154
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ugt_0:
 **     cbheq   w0, wzr, .L156
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_uge_0:
 **     b       taken
 */
 
 /*
 ** i16_x0_slt_0:
-**     cbhlt   w0, wzr, .L160
+**     tbnz    w0, #15, .L160
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i16_x0_sle_0:
 **     cbhle   w0, wzr, .L163
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i16_x0_sgt_0:
 **     cbhle   w0, wzr, .L165
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sge_0:
-**     cbhlt   w0, wzr, .L167
+**     tbnz    w0, #15, .L167
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_eq_0:
-**     cbne    w0, wzr, .L169
+**     cbnz    w0, .L169
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ne_0:
-**     cbeq    w0, wzr, .L171
+**     cbz     w0, .L171
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ult_0:
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ule_0:
-**     cbne    w0, wzr, .L174
+**     cbnz    w0, .L174
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ugt_0:
-**     cbeq    w0, wzr, .L176
+**     cbz     w0, .L176
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_uge_0:
 **     b       taken
 */
 
 /*
 ** i32_x0_slt_0:
-**     cblt    w0, wzr, .L180
+**     tbnz    w0, #31, .L180
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i32_x0_sle_0:
 **     cble    w0, wzr, .L183
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i32_x0_sgt_0:
 **     cble    w0, wzr, .L185
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sge_0:
-**     cblt    w0, wzr, .L187
+**     tbnz    w0, #31, .L187
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_eq_0:
-**     cbne    x0, xzr, .L189
+**     cbnz    x0, .L189
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ne_0:
-**     cbeq    x0, xzr, .L191
+**     cbz     x0, .L191
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ult_0:
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ule_0:
-**     cbne    x0, xzr, .L194
+**     cbnz    x0, .L194
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ugt_0:
-**     cbeq    x0, xzr, .L196
+**     cbz     x0, .L196
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_uge_0:
 **     b       taken
 */
 
 /*
 ** i64_x0_slt_0:
-**     cblt    x0, xzr, .L200
+**     tbnz    x0, #63, .L200
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i64_x0_sle_0:
 **     cble    x0, xzr, .L203
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** i64_x0_sgt_0:
 **     cble    x0, xzr, .L205
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sge_0:
-**     cblt    x0, xzr, .L207
+**     tbnz    x0, #63, .L207
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_eq_42:
 **     mov     w1, 42
 **     cbbeq   w0, w1, .L210
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u8_x0_ne_42:
 **     mov     w1, 42
 **     cbbeq   w0, w1, .L212
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ult_42:
 **     mov     w1, 41
 **     cbbhi   w0, w1, .L214
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ule_42:
 **     mov     w1, 42
 **     cbbhi   w0, w1, .L216
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ugt_42:
 **     mov     w1, 42
 **     cbbls   w0, w1, .L218
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_uge_42:
 **     mov     w1, 41
 **     cbbls   w0, w1, .L220
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_slt_42:
 **     mov     w1, 41
 **     cbbgt   w0, w1, .L222
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sle_42:
 **     mov     w1, 42
 **     cbbgt   w0, w1, .L224
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sgt_42:
 **     mov     w1, 42
 **     cbble   w0, w1, .L226
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sge_42:
 **     mov     w1, 41
 **     cbble   w0, w1, .L228
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_eq_42:
 **     mov     w1, 42
 **     cbheq   w0, w1, .L231
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u16_x0_ne_42:
 **     mov     w1, 42
 **     cbheq   w0, w1, .L233
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ult_42:
 **     mov     w1, 41
 **     cbhhi   w0, w1, .L235
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ule_42:
 **     mov     w1, 42
 **     cbhhi   w0, w1, .L237
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ugt_42:
 **     mov     w1, 42
 **     cbhls   w0, w1, .L239
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_uge_42:
 **     mov     w1, 41
 **     cbhls   w0, w1, .L241
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_slt_42:
 **     mov     w1, 41
 **     cbhgt   w0, w1, .L243
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sle_42:
 **     mov     w1, 42
 **     cbhgt   w0, w1, .L245
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sgt_42:
 **     mov     w1, 42
 **     cbhle   w0, w1, .L247
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sge_42:
 **     mov     w1, 41
 **     cbhle   w0, w1, .L249
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_eq_64:
 **     mov     w1, 64
 **     cbbeq   w0, w1, .L252
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u8_x0_ne_64:
 **     mov     w1, 64
 **     cbbeq   w0, w1, .L254
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ult_64:
 **     mov     w1, 63
 **     cbbhi   w0, w1, .L256
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ule_64:
 **     mov     w1, 64
 **     cbbhi   w0, w1, .L258
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_ugt_64:
 **     mov     w1, 64
 **     cbbls   w0, w1, .L260
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u8_x0_uge_64:
 **     mov     w1, 63
 **     cbbls   w0, w1, .L262
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_slt_64:
 **     mov     w1, 63
 **     cbbgt   w0, w1, .L264
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sle_64:
 **     mov     w1, 64
 **     cbbgt   w0, w1, .L266
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sgt_64:
 **     mov     w1, 64
 **     cbble   w0, w1, .L268
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i8_x0_sge_64:
 **     mov     w1, 63
 **     cbble   w0, w1, .L270
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_eq_64:
 **     mov     w1, 64
 **     cbheq   w0, w1, .L273
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u16_x0_ne_64:
 **     mov     w1, 64
 **     cbheq   w0, w1, .L275
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ult_64:
 **     mov     w1, 63
 **     cbhhi   w0, w1, .L277
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ule_64:
 **     mov     w1, 64
 **     cbhhi   w0, w1, .L279
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ugt_64:
 **     mov     w1, 64
 **     cbhls   w0, w1, .L281
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_uge_64:
 **     mov     w1, 63
 **     cbhls   w0, w1, .L283
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_slt_64:
 **     mov     w1, 63
 **     cbhgt   w0, w1, .L285
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sle_64:
 **     mov     w1, 64
 **     cbhgt   w0, w1, .L287
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sgt_64:
 **     mov     w1, 64
 **     cbhle   w0, w1, .L289
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sge_64:
 **     mov     w1, 63
 **     cbhle   w0, w1, .L291
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_eq_64:
 **     cmp     w0, 64
 **     beq     .L294
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u32_x0_ne_64:
 **     cmp     w0, 64
 **     beq     .L296
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ult_64:
 **     cbhi    w0, 63, .L298
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ule_64:
 **     cmp     w0, 64
 **     bhi     .L300
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ugt_64:
 **     cmp     w0, 64
 **     bls     .L302
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_uge_64:
 **     cbls    w0, 63, .L304
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_slt_64:
 **     cbgt    w0, 63, .L306
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sle_64:
 **     cmp     w0, 64
 **     bgt     .L308
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sgt_64:
 **     cmp     w0, 64
 **     ble     .L310
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sge_64:
 **     cble    w0, 63, .L312
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_eq_64:
 **     cmp     x0, 64
 **     beq     .L315
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u64_x0_ne_64:
 **     cmp     x0, 64
 **     beq     .L317
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ult_64:
 **     cbhi    x0, 63, .L319
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ule_64:
 **     cmp     x0, 64
 **     bhi     .L321
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ugt_64:
 **     cmp     x0, 64
 **     bls     .L323
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_uge_64:
 **     cbls    x0, 63, .L325
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_slt_64:
 **     cbgt    x0, 63, .L327
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sle_64:
 **     cmp     x0, 64
 **     bgt     .L329
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sgt_64:
 **     cmp     x0, 64
 **     ble     .L331
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sge_64:
 **     cble    x0, 63, .L333
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_eq_4098:
 **     mov     w1, 4098
 **     cbheq   w0, w1, .L336
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u16_x0_ne_4098:
 **     mov     w1, 4098
 **     cbheq   w0, w1, .L338
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ult_4098:
 **     mov     w1, 4097
 **     cbhhi   w0, w1, .L340
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ule_4098:
 **     mov     w1, 4098
 **     cbhhi   w0, w1, .L342
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_ugt_4098:
 **     mov     w1, 4098
 **     cbhls   w0, w1, .L344
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u16_x0_uge_4098:
 **     mov     w1, 4097
 **     cbhls   w0, w1, .L346
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_slt_4098:
 **     mov     w1, 4097
 **     cbhgt   w0, w1, .L348
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sle_4098:
 **     mov     w1, 4098
 **     cbhgt   w0, w1, .L350
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sgt_4098:
 **     mov     w1, 4098
 **     cbhle   w0, w1, .L352
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i16_x0_sge_4098:
 **     mov     w1, 4097
 **     cbhle   w0, w1, .L354
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_eq_4098:
 **     mov     w1, 4098
 **     cbeq    w0, w1, .L357
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u32_x0_ne_4098:
 **     mov     w1, 4098
 **     cbeq    w0, w1, .L359
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ult_4098:
 **     mov     w1, 4097
 **     cbhi    w0, w1, .L361
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ule_4098:
 **     mov     w1, 4098
 **     cbhi    w0, w1, .L363
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_ugt_4098:
 **     mov     w1, 4098
 **     cbls    w0, w1, .L365
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u32_x0_uge_4098:
 **     mov     w1, 4097
 **     cbls    w0, w1, .L367
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_slt_4098:
 **     mov     w1, 4097
 **     cbgt    w0, w1, .L369
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sle_4098:
 **     mov     w1, 4098
 **     cbgt    w0, w1, .L371
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sgt_4098:
 **     mov     w1, 4098
 **     cble    w0, w1, .L373
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i32_x0_sge_4098:
 **     mov     w1, 4097
 **     cble    w0, w1, .L375
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_eq_4098:
 **     mov     x1, 4098
 **     cbeq    x0, x1, .L378
 **     b       not_taken
 **     b       taken
 */
 
 /*
 ** u64_x0_ne_4098:
 **     mov     x1, 4098
 **     cbeq    x0, x1, .L380
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ult_4098:
 **     mov     x1, 4097
 **     cbhi    x0, x1, .L382
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ule_4098:
 **     mov     x1, 4098
 **     cbhi    x0, x1, .L384
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_ugt_4098:
 **     mov     x1, 4098
 **     cbls    x0, x1, .L386
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** u64_x0_uge_4098:
 **     mov     x1, 4097
 **     cbls    x0, x1, .L388
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_slt_4098:
 **     mov     x1, 4097
 **     cbgt    x0, x1, .L390
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sle_4098:
 **     mov     x1, 4098
 **     cbgt    x0, x1, .L392
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sgt_4098:
 **     mov     x1, 4098
 **     cble    x0, x1, .L394
 **     b       taken
 **     b       not_taken
 */
 
 /*
 ** i64_x0_sge_4098:
 **     mov     x1, 4097
 **     cble    x0, x1, .L396
 **     b       taken
 **     b       not_taken
 */
-- 
2.45.2


Reply via email to