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-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
11 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
12 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
13 ; CHECK-NEXT: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s32) = G_USUBO [[COPY]], [[COPY2]]
14 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
15 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[USUBO1]], [[C]]
16 ; CHECK-NEXT: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s32) = G_USUBE [[COPY1]], [[COPY3]], [[AND]]
17 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[USUBE1]](s32)
18 ; CHECK-NEXT: $x0 = COPY [[USUBO]](s64)
19 ; CHECK-NEXT: $x1 = COPY [[USUBE]](s64)
20 ; CHECK-NEXT: $x2 = COPY %carry_out_ext(s64)
25 %lhs:_(s128) = G_MERGE_VALUES %0, %1
26 %rhs:_(s128) = G_MERGE_VALUES %2, %3
27 %sub:_(s128), %carry_out:_(s1) = G_USUBO %lhs, %rhs
28 %sub0:_(s64), %sub1:_(s64) = G_UNMERGE_VALUES %sub
29 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
32 $x2 = COPY %carry_out_ext
36 name: narrow_scalar_usubo_big_nonpow2
39 ; CHECK-LABEL: name: narrow_scalar_usubo_big_nonpow2
40 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
41 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
42 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
43 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
44 ; CHECK-NEXT: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s32) = G_USUBO [[COPY]], [[COPY1]]
45 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
46 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[USUBO1]], [[C]]
47 ; CHECK-NEXT: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s32) = G_USUBE [[COPY1]], [[COPY2]], [[AND]]
48 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[USUBE1]], [[C]]
49 ; CHECK-NEXT: [[USUBE2:%[0-9]+]]:_(s64), [[USUBE3:%[0-9]+]]:_(s32) = G_USUBE [[COPY2]], [[COPY3]], [[AND1]]
50 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[USUBE3]](s32)
51 ; CHECK-NEXT: $x0 = COPY [[USUBO]](s64)
52 ; CHECK-NEXT: $x1 = COPY [[USUBE]](s64)
53 ; CHECK-NEXT: $x2 = COPY [[USUBE2]](s64)
54 ; CHECK-NEXT: $x3 = COPY %carry_out_ext(s64)
59 %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
60 %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
61 %sub:_(s192), %carry_out:_(s1) = G_USUBO %lhs, %rhs
62 %sub0:_(s64), %sub1:_(s64), %sub2:_(s64) = G_UNMERGE_VALUES %sub
63 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
67 $x3 = COPY %carry_out_ext
71 name: test_scalar_usubo_small
74 ; CHECK-LABEL: name: test_scalar_usubo_small
75 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
76 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
77 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
78 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
79 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
80 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
81 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
82 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
83 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]]
84 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
85 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SUB]](s32)
86 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
87 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
88 ; CHECK-NEXT: $x1 = COPY [[ANYEXT1]](s64)
91 %2:_(s8) = G_TRUNC %0(s64)
92 %3:_(s8) = G_TRUNC %1(s64)
93 %4:_(s8), %5:_(s1) = G_USUBO %2, %3
94 %6:_(s64) = G_ANYEXT %4(s8)
95 %7:_(s64) = G_ANYEXT %5(s1)
101 name: test_scalar_usubo_32
104 ; CHECK-LABEL: name: test_scalar_usubo_32
105 ; CHECK: %lhs:_(s32) = COPY $w0
106 ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
107 ; CHECK-NEXT: %sub:_(s32), %5:_(s32) = G_USUBO %lhs, %rhs
108 ; CHECK-NEXT: $w0 = COPY %sub(s32)
109 ; CHECK-NEXT: $w1 = COPY %5(s32)
110 %lhs:_(s32) = COPY $w0
111 %rhs:_(s32) = COPY $w1
112 %sub:_(s32), %carry_out:_(s1) = G_USUBO %lhs, %rhs
113 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
115 $w1 = COPY %carry_out_ext