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_usubo_s128
8 ; CHECK-LABEL: name: narrow_scalar_usubo_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: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY2]]
14 ; CHECK: %17:_(s64), %carry_out:_(s1) = G_USUBE [[COPY1]], [[COPY3]], [[USUBO1]]
15 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
16 ; CHECK: $x0 = COPY [[USUBO]](s64)
17 ; CHECK: $x1 = COPY %17(s64)
18 ; CHECK: $x2 = COPY %carry_out_ext(s64)
23 %lhs:_(s128) = G_MERGE_VALUES %0, %1
24 %rhs:_(s128) = G_MERGE_VALUES %2, %3
25 %sub:_(s128), %carry_out:_(s1) = G_USUBO %lhs, %rhs
26 %sub0:_(s64), %sub1:_(s64) = G_UNMERGE_VALUES %sub
27 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
30 $x2 = COPY %carry_out_ext
34 name: narrow_scalar_usubo_big_nonpow2
37 ; CHECK-LABEL: name: narrow_scalar_usubo_big_nonpow2
38 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
39 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
40 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
41 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
42 ; CHECK: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY1]]
43 ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY1]], [[COPY2]], [[USUBO1]]
44 ; CHECK: %22:_(s64), %carry_out:_(s1) = G_USUBE [[COPY2]], [[COPY3]], [[USUBE1]]
45 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
46 ; CHECK: $x0 = COPY [[USUBO]](s64)
47 ; CHECK: $x1 = COPY [[USUBE]](s64)
48 ; CHECK: $x2 = COPY %22(s64)
49 ; CHECK: $x3 = COPY %carry_out_ext(s64)
54 %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
55 %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
56 %sub:_(s192), %carry_out:_(s1) = G_USUBO %lhs, %rhs
57 %sub0:_(s64), %sub1:_(s64), %sub2:_(s64) = G_UNMERGE_VALUES %sub
58 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
62 $x3 = COPY %carry_out_ext
66 name: test_scalar_usubo_small
69 ; CHECK-LABEL: name: test_scalar_usubo_small
70 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
71 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
72 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
73 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
74 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
75 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
76 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
77 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
78 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[SUB]](s32)
79 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
80 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
81 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
82 ; CHECK: [[COPY3:%[0-9]+]]:_(s8) = COPY [[TRUNC2]](s8)
83 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SUB]](s32)
84 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
85 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
86 ; CHECK: $x1 = COPY [[ANYEXT1]](s64)
89 %2:_(s8) = G_TRUNC %0(s64)
90 %3:_(s8) = G_TRUNC %1(s64)
91 %4:_(s8), %5:_(s1) = G_USUBO %2, %3
92 %6:_(s64) = G_ANYEXT %4(s8)
93 %7:_(s64) = G_ANYEXT %5(s1)
99 name: test_scalar_usubo_32
102 ; CHECK-LABEL: name: test_scalar_usubo_32
103 ; CHECK: %lhs:_(s32) = COPY $w0
104 ; CHECK: %rhs:_(s32) = COPY $w1
105 ; CHECK: %sub:_(s32), %carry_out:_(s1) = G_USUBO %lhs, %rhs
106 ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
107 ; CHECK: $w0 = COPY %sub(s32)
108 ; CHECK: $w1 = COPY %carry_out_ext(s32)
109 %lhs:_(s32) = COPY $w0
110 %rhs:_(s32) = COPY $w1
111 %sub:_(s32), %carry_out:_(s1) = G_USUBO %lhs, %rhs
112 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
114 $w1 = COPY %carry_out_ext