I have updated the tests in `cmpbr.c` to reflect the fixes. There are a
few regressions, but they can be fixed later; let's just make GCC
crash-free first.

---
 gcc/testsuite/gcc.target/aarch64/cmpbr.c | 334 +++++++++++++----------
 1 file changed, 185 insertions(+), 149 deletions(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr.c 
b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
index 34630f9a2bf..95393b83fc8 100644
--- a/gcc/testsuite/gcc.target/aarch64/cmpbr.c
+++ b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
@@ -169,33 +169,41 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_slt_x1:
-**     (?:cbbgt        w1, w0|cbblt    w0, w1), .L([0-9]+)
+**     sxtb    (w[0-9]+), w1
+**     cmp     \1, w0, sxtb
+**     bgt     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i8_x0_sle_x1:
-**     (?:cbbge        w1, w0|cbble    w0, w1), .L([0-9]+)
+**     sxtb    (w[0-9]+), w1
+**     cmp     \1, w0, sxtb
+**     bge     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i8_x0_sgt_x1:
-**     (?:cbblt        w1, w0|cbbgt    w0, w1), .L([0-9]+)
+**     sxtb    (w[0-9]+), w1
+**     cmp     \1, w0, sxtb
+**     blt     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i8_x0_sge_x1:
-**     (?:cbble        w1, w0|cbbge    w0, w1), .L([0-9]+)
+**     sxtb    (w[0-9]+), w1
+**     cmp     \1, w0, sxtb
+**     ble     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
@@ -249,33 +257,41 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_slt_x1:
-**     (?:cbhgt        w1, w0|cbhlt    w0, w1), .L([0-9]+)
+**     sxth    (w[0-9]+), w1
+**     cmp     \1, w0, sxth
+**     bgt     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i16_x0_sle_x1:
-**     (?:cbhge        w1, w0|cbhle    w0, w1), .L([0-9]+)
+**     sxth    (w[0-9]+), w1
+**     cmp     \1, w0, sxth
+**     bge     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i16_x0_sgt_x1:
-**     (?:cbhlt        w1, w0|cbhgt    w0, w1), .L([0-9]+)
+**     sxth    (w[0-9]+), w1
+**     cmp     \1, w0, sxth
+**     blt     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
 /*
 ** i16_x0_sge_x1:
-**     (?:cbhle        w1, w0|cbhge    w0, w1), .L([0-9]+)
+**     sxth    (w[0-9]+), w1
+**     cmp     \1, w0, sxth
+**     ble     .L([0-9]+)
 **     b       not_taken
-** .L\1:
+** .L\2:
 **     b       taken
 */
 
@@ -643,7 +659,7 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_slt_0:
-**     tbnz    w0, #7, .L([0-9]+)
+**     tbnz    w0, 7, .L([0-9]+)
 **     b       not_taken
 ** .L\1:
 **     b       taken
@@ -667,7 +683,7 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sge_0:
-**     tbz     w0, #7, .L([0-9]+)
+**     tbz     w0, 7, .L([0-9]+)
 **     b       not_taken
 ** .L\1:
 **     b       taken
@@ -717,7 +733,7 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_slt_0:
-**     tbnz    w0, #15, .L([0-9]+)
+**     tbnz    w0, 15, .L([0-9]+)
 **     b       not_taken
 ** .L\1:
 **     b       taken
@@ -741,7 +757,7 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sge_0:
-**     tbz     w0, #15, .L([0-9]+)
+**     tbz     w0, 15, .L([0-9]+)
 **     b       not_taken
 ** .L\1:
 **     b       taken
@@ -897,8 +913,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_eq_42:
-**     mov     w([0-9]+), 42
-**     cbbeq   w0, w\1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbeq    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -906,8 +922,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ne_42:
-**     mov     (w[0-9]+), 42
-**     cbbne   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbne    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -915,8 +931,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ult_42:
-**     mov     (w[0-9]+), 41
-**     cbbls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbls    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -924,8 +940,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ule_42:
-**     mov     (w[0-9]+), 42
-**     cbbls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbls    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -933,8 +949,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ugt_42:
-**     mov     (w[0-9]+), 42
-**     cbbhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbhi    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -942,8 +958,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_uge_42:
-**     mov     (w[0-9]+), 41
-**     cbbhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cbhi    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -951,8 +967,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_slt_42:
-**     mov     (w[0-9]+), 41
-**     cbble   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cble    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -960,8 +976,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sle_42:
-**     mov     (w[0-9]+), 42
-**     cbble   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cble    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -969,8 +985,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sgt_42:
-**     mov     (w[0-9]+), 42
-**     cbbgt   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cbgt    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -978,8 +994,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sge_42:
-**     mov     (w[0-9]+), 41
-**     cbbgt   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cbgt    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -987,8 +1003,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_eq_42:
-**     mov     w([0-9]+), 42
-**     cbheq   w0, w\1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbeq    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -996,8 +1012,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ne_42:
-**     mov     (w[0-9]+), 42
-**     cbhne   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbne    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1005,8 +1021,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ult_42:
-**     mov     (w[0-9]+), 41
-**     cbhls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbls    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1014,8 +1030,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ule_42:
-**     mov     (w[0-9]+), 42
-**     cbhls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbls    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1023,8 +1039,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ugt_42:
-**     mov     (w[0-9]+), 42
-**     cbhhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbhi    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1032,8 +1048,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_uge_42:
-**     mov     (w[0-9]+), 41
-**     cbhhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cbhi    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1041,8 +1057,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_slt_42:
-**     mov     (w[0-9]+), 41
-**     cbhle   w0, \1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cble    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1050,8 +1066,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sle_42:
-**     mov     (w[0-9]+), 42
-**     cbhle   w0, \1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cble    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1059,8 +1075,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sgt_42:
-**     mov     (w[0-9]+), 42
-**     cbhgt   w0, \1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cbgt    \1, 42, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1068,8 +1084,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sge_42:
-**     mov     (w[0-9]+), 41
-**     cbhgt   w0, \1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cbgt    \1, 41, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1077,8 +1093,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_eq_64:
-**     mov     w([0-9]+), 64
-**     cbbeq   w0, w\1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cmp     \1, 64
+**     beq     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1086,8 +1103,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ne_64:
-**     mov     (w[0-9]+), 64
-**     cbbne   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cmp     \1, 64
+**     bne     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1095,17 +1113,18 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ult_64:
-**     mov     (w[0-9]+), 63
-**     cbbls   w0, \1, .L([0-9]+)
-**     b       not_taken
-** .L\2:
+**     and     (w[0-9]+), w0, 255
+**     cbhi    \1, 63, .L([0-9]+)
 **     b       taken
+** .L\2:
+**     b       not_taken
 */
 
 /*
 ** u8_x0_ule_64:
-**     mov     (w[0-9]+), 64
-**     cbbls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cmp     \1, 64
+**     bls     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1113,8 +1132,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_ugt_64:
-**     mov     (w[0-9]+), 64
-**     cbbhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cmp     \1, 64
+**     bhi     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1122,8 +1142,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u8_x0_uge_64:
-**     mov     (w[0-9]+), 63
-**     cbbhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 255
+**     cmp     \1, 63
+**     bhi     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1131,17 +1152,18 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_slt_64:
-**     mov     (w[0-9]+), 63
-**     cbble   w0, \1, .L([0-9]+)
-**     b       not_taken
-** .L\2:
+**     sxtb    (w[0-9]+), w0
+**     cbgt    \1, 63, .L([0-9]+)
 **     b       taken
+** .L\2:
+**     b       not_taken
 */
 
 /*
 ** i8_x0_sle_64:
-**     mov     (w[0-9]+), 64
-**     cbble   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cmp     \1, 64
+**     ble     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1149,8 +1171,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sgt_64:
-**     mov     (w[0-9]+), 64
-**     cbbgt   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cmp     \1, 64
+**     bgt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1158,8 +1181,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i8_x0_sge_64:
-**     mov     (w[0-9]+), 63
-**     cbbgt   w0, \1, .L([0-9]+)
+**     sxtb    (w[0-9]+), w0
+**     cmp     \1, 63
+**     bgt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1167,8 +1191,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_eq_64:
-**     mov     w([0-9]+), 64
-**     cbheq   w0, w\1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cmp     \1, 64
+**     beq     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1176,8 +1201,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ne_64:
-**     mov     (w[0-9]+), 64
-**     cbhne   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cmp     \1, 64
+**     bne     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1185,17 +1211,18 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ult_64:
-**     mov     (w[0-9]+), 63
-**     cbhls   w0, \1, .L([0-9]+)
-**     b       not_taken
-** .L\2:
+**     and     (w[0-9]+), w0, 65535
+**     cbhi    \1, 63, .L([0-9]+)
 **     b       taken
+** .L\2:
+**     b       not_taken
 */
 
 /*
 ** u16_x0_ule_64:
-**     mov     (w[0-9]+), 64
-**     cbhls   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cmp     \1, 64
+**     bls     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1203,8 +1230,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_ugt_64:
-**     mov     (w[0-9]+), 64
-**     cbhhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cmp     \1, 64
+**     bhi     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1212,8 +1240,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_uge_64:
-**     mov     (w[0-9]+), 63
-**     cbhhi   w0, \1, .L([0-9]+)
+**     and     (w[0-9]+), w0, 65535
+**     cmp     \1, 63
+**     bhi     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1221,17 +1250,18 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_slt_64:
-**     mov     (w[0-9]+), 63
-**     cbhle   w0, \1, .L([0-9]+)
-**     b       not_taken
-** .L\2:
+**     sxth    (w[0-9]+), w0
+**     cbgt    \1, 63, .L([0-9]+)
 **     b       taken
+** .L\2:
+**     b       not_taken
 */
 
 /*
 ** i16_x0_sle_64:
-**     mov     (w[0-9]+), 64
-**     cbhle   w0, \1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cmp     \1, 64
+**     ble     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1239,8 +1269,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sgt_64:
-**     mov     (w[0-9]+), 64
-**     cbhgt   w0, w1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cmp     \1, 64
+**     bgt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1248,8 +1279,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** i16_x0_sge_64:
-**     mov     (w[0-9]+), 63
-**     cbhgt   w0, w1, .L([0-9]+)
+**     sxth    (w[0-9]+), w0
+**     cmp     \1, 63
+**     bgt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1433,8 +1465,9 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u16_x0_eq_4098:
-**     mov     w([0-9]+), 4098
-**     cbheq   w0, w\1, .L([0-9]+)
+**     mov     (w[0-9]+), 4098
+**     cmp     \1, w0, uxth
+**     beq     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1443,7 +1476,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** u16_x0_ne_4098:
 **     mov     (w[0-9]+), 4098
-**     cbhne   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, uxth
+**     bne     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1452,7 +1486,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** u16_x0_ult_4098:
 **     mov     (w[0-9]+), 4097
-**     cbhls   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, uxth
+**     bcs     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1461,7 +1496,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** u16_x0_ule_4098:
 **     mov     (w[0-9]+), 4098
-**     cbhls   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, uxth
+**     bcs     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1470,7 +1506,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** u16_x0_ugt_4098:
 **     mov     (w[0-9]+), 4098
-**     cbhhi   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, uxth
+**     bcc     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1479,7 +1516,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** u16_x0_uge_4098:
 **     mov     (w[0-9]+), 4097
-**     cbhhi   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, uxth
+**     bcc     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1488,7 +1526,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** i16_x0_slt_4098:
 **     mov     (w[0-9]+), 4097
-**     cbhle   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, sxth
+**     bge     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1497,7 +1536,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** i16_x0_sle_4098:
 **     mov     (w[0-9]+), 4098
-**     cbhle   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, sxth
+**     bge     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1506,7 +1546,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** i16_x0_sgt_4098:
 **     mov     (w[0-9]+), 4098
-**     cbhgt   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, sxth
+**     blt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1515,7 +1556,8 @@ FAR_BRANCH(u64, 42);
 /*
 ** i16_x0_sge_4098:
 **     mov     (w[0-9]+), 4097
-**     cbhgt   w0, \1, .L([0-9]+)
+**     cmp     \1, w0, sxth
+**     blt     .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1523,8 +1565,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u32_x0_eq_4098:
-**     mov     w([0-9]+), 4098
-**     cbeq    w0, w\1, .L([0-9]+)
+**     mov     (w[0-9]+), 4098
+**     cbeq    w0, \1, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1613,8 +1655,8 @@ FAR_BRANCH(u64, 42);
 
 /*
 ** u64_x0_eq_4098:
-**     mov     x([0-9]+), 4098
-**     cbeq    x0, x\1, .L([0-9]+)
+**     mov     (x[0-9]+), 4098
+**     cbeq    x0, \1, .L([0-9]+)
 **     b       not_taken
 ** .L\2:
 **     b       taken
@@ -1735,13 +1777,12 @@ FAR_BRANCH(u64, 42);
 ** far_branch_u32_x0_eq_x1:
 **     sub     sp, sp, #16
 **     str     wzr, \[sp, 12\]
-**     cbeq    w0, w1, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\1:
+**     cmp     w0, w1
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\2:
+** .L\1:
 **     add     sp, sp, 16
 **     b       taken
 */
@@ -1750,13 +1791,12 @@ FAR_BRANCH(u64, 42);
 ** far_branch_u64_x0_eq_x1:
 **     sub     sp, sp, #16
 **     str     wzr, \[sp, 12\]
-**     cbeq    x0, x1, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\1:
+**     cmp     x0, x1
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\2:
+** .L\1:
 **     add     sp, sp, 16
 **     b       taken
 */
@@ -1764,15 +1804,14 @@ FAR_BRANCH(u64, 42);
 /*
 ** far_branch_u8_x0_eq_42:
 **     sub     sp, sp, #16
-**     mov     w([0-9]+), 42
+**     and     (w[0-9]+), w0, 255
 **     str     wzr, \[sp, 12\]
-**     cbbeq   w0, w\1, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\2:
+**     cmp     \1, 42
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\3:
+** .L\2:
 **     add     sp, sp, 16
 **     b       taken
 */
@@ -1780,15 +1819,14 @@ FAR_BRANCH(u64, 42);
 /*
 ** far_branch_u16_x0_eq_42:
 **     sub     sp, sp, #16
-**     mov     w([0-9]+), 42
+**     and     (w[0-9]+), w0, 65535
 **     str     wzr, \[sp, 12\]
-**     cbheq   w0, w\1, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\2:
+**     cmp     \1, 42
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\3:
+** .L\2:
 **     add     sp, sp, 16
 **     b       taken
 */
@@ -1797,13 +1835,12 @@ FAR_BRANCH(u64, 42);
 ** far_branch_u32_x0_eq_42:
 **     sub     sp, sp, #16
 **     str     wzr, \[sp, 12\]
-**     cbeq    w0, 42, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\1:
+**     cmp     w0, 42
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\2:
+** .L\1:
 **     add     sp, sp, 16
 **     b       taken
 */
@@ -1812,13 +1849,12 @@ FAR_BRANCH(u64, 42);
 ** far_branch_u64_x0_eq_42:
 **     sub     sp, sp, #16
 **     str     wzr, \[sp, 12\]
-**     cbeq    x0, 42, .L([0-9]+)
-**     b       .L([0-9]+)
-** .L\1:
+**     cmp     x0, 42
+**     bne     .L([0-9]+)
 **     str     wzr, \[sp, 12\]
 **     ...
 **     str     wzr, \[sp, 12\]
-** .L\2:
+** .L\1:
 **     add     sp, sp, 16
 **     b       taken
 */
-- 
2.43.0

Reply via email to