1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s
5 name: narrow_scalar_usube_s128
8 ; CHECK-LABEL: name: narrow_scalar_usube_s128
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
11 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
12 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
13 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
14 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
15 ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY2]], %carry_in
16 ; CHECK: %19:_(s64), %carry_out:_(s1) = G_USUBE [[COPY1]], [[COPY3]], [[USUBE1]]
17 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
18 ; CHECK: $x0 = COPY [[USUBE]](s64)
19 ; CHECK: $x1 = COPY %19(s64)
20 ; CHECK: $x2 = COPY %carry_out_ext(s64)
26 %lhs:_(s128) = G_MERGE_VALUES %0, %1
27 %rhs:_(s128) = G_MERGE_VALUES %2, %3
28 %carry_in:_(s1) = G_TRUNC %4
29 %sub:_(s128), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
30 %sub0:_(s64), %sub1:_(s64) = G_UNMERGE_VALUES %sub
31 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
34 $x2 = COPY %carry_out_ext
38 name: narrow_scalar_usube_big_nonpow2
41 ; CHECK-LABEL: name: narrow_scalar_usube_big_nonpow2
42 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
43 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
44 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
45 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
46 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
47 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
48 ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY1]], %carry_in
49 ; CHECK: [[USUBE2:%[0-9]+]]:_(s64), [[USUBE3:%[0-9]+]]:_(s1) = G_USUBE [[COPY1]], [[COPY2]], [[USUBE1]]
50 ; CHECK: %24:_(s64), %carry_out:_(s1) = G_USUBE [[COPY2]], [[COPY3]], [[USUBE3]]
51 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
52 ; CHECK: $x0 = COPY [[USUBE]](s64)
53 ; CHECK: $x1 = COPY [[USUBE2]](s64)
54 ; CHECK: $x2 = COPY %24(s64)
55 ; CHECK: $x3 = COPY %carry_out_ext(s64)
61 %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
62 %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
63 %carry_in:_(s1) = G_TRUNC %4
64 %sub:_(s192), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
65 %sub0:_(s64), %sub1:_(s64), %sub2:_(s64) = G_UNMERGE_VALUES %sub
66 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
70 $x3 = COPY %carry_out_ext
74 name: widen_scalar_usube_s8
77 ; CHECK-LABEL: name: widen_scalar_usube_s8
78 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
79 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
80 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
81 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY2]](s64)
82 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
83 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
84 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
85 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
86 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
87 ; CHECK: [[USUBE:%[0-9]+]]:_(s32), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[AND]], [[AND1]], %carry_in
88 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[USUBE]](s32)
89 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[USUBE]](s32)
90 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
91 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[USUBE]](s32), [[AND2]]
92 ; CHECK: %sub:_(s8) = COPY [[TRUNC2]](s8)
93 ; CHECK: %sub_ext:_(s64) = G_ANYEXT [[USUBE]](s32)
94 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
95 ; CHECK: $x0 = COPY %sub_ext(s64)
96 ; CHECK: $x1 = COPY %carry_out_ext(s64)
100 %lhs:_(s8) = G_TRUNC %0
101 %rhs:_(s8) = G_TRUNC %1
102 %carry_in:_(s1) = G_TRUNC %2
103 %sub:_(s8), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
104 %sub_ext:_(s64) = G_ANYEXT %sub
105 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
107 $x1 = COPY %carry_out_ext
111 name: test_scalar_usube_32
114 ; CHECK-LABEL: name: test_scalar_usube_32
115 ; CHECK: %lhs:_(s32) = COPY $w0
116 ; CHECK: %rhs:_(s32) = COPY $w1
117 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w2
118 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY]](s32)
119 ; CHECK: %sub:_(s32), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
120 ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
121 ; CHECK: $w0 = COPY %sub(s32)
122 ; CHECK: $w1 = COPY %carry_out_ext(s32)
123 %lhs:_(s32) = COPY $w0
124 %rhs:_(s32) = COPY $w1
126 %carry_in:_(s1) = G_TRUNC %2
127 %sub:_(s32), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
128 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
130 $w1 = COPY %carry_out_ext