1 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @cbz_s32() { ret void }
5 define void @cbz_s64() { ret void }
6 define void @cbnz_s32() { ret void }
7 define void @cbnz_s64() { ret void }
11 # CHECK-LABEL: name: cbz_s32
18 # CHECK: %0:gpr32 = COPY $w0
19 # CHECK: CBZW %0, %bb.1
24 successors: %bb.0, %bb.1
26 %0:gpr(s32) = COPY $w0
27 %1:gpr(s32) = G_CONSTANT i32 0
28 %2:gpr(s32) = G_ICMP intpred(eq), %0, %1
29 %3:gpr(s1) = G_TRUNC %2(s32)
30 G_BRCOND %3(s1), %bb.1
37 # CHECK-LABEL: name: cbz_s64
44 # CHECK: %0:gpr64 = COPY $x0
45 # CHECK: CBZX %0, %bb.1
50 successors: %bb.0, %bb.1
52 %0:gpr(s64) = COPY $x0
53 %1:gpr(s64) = G_CONSTANT i64 0
54 %2:gpr(s32) = G_ICMP intpred(eq), %0, %1
55 %3:gpr(s1) = G_TRUNC %2(s32)
56 G_BRCOND %3(s1), %bb.1
63 # CHECK-LABEL: name: cbnz_s32
70 # CHECK: %0:gpr32 = COPY $w0
71 # CHECK: CBNZW %0, %bb.1
76 successors: %bb.0, %bb.1
78 %0:gpr(s32) = COPY $w0
79 %1:gpr(s32) = G_CONSTANT i32 0
80 %2:gpr(s32) = G_ICMP intpred(ne), %0, %1
81 %3:gpr(s1) = G_TRUNC %2(s32)
82 G_BRCOND %3(s1), %bb.1
89 # CHECK-LABEL: name: cbnz_s64
96 # CHECK: %0:gpr64 = COPY $x0
97 # CHECK: CBNZX %0, %bb.1
102 successors: %bb.0, %bb.1
104 %0:gpr(s64) = COPY $x0
105 %1:gpr(s64) = G_CONSTANT i64 0
106 %2:gpr(s32) = G_ICMP intpred(ne), %0, %1
107 %3:gpr(s1) = G_TRUNC %2(s32)
108 G_BRCOND %3(s1), %bb.1