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_ssube_s128
8 ; CHECK-LABEL: name: narrow_scalar_ssube_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_SSUBE [[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_SSUBE %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_ssube_big_nonpow2
41 ; CHECK-LABEL: name: narrow_scalar_ssube_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_SSUBE [[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_SSUBE %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_ssube_s8
77 ; CHECK-LABEL: name: widen_scalar_ssube_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: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
83 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
84 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
85 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
86 ; CHECK: [[USUBE:%[0-9]+]]:_(s32), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[SEXT_INREG]], [[SEXT_INREG1]], %carry_in
87 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[USUBE]](s32)
88 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[USUBE]](s32)
89 ; CHECK: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 8
90 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[USUBE]](s32), [[SEXT_INREG2]]
91 ; CHECK: %sub:_(s8) = COPY [[TRUNC2]](s8)
92 ; CHECK: %sub_ext:_(s64) = G_ANYEXT [[USUBE]](s32)
93 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
94 ; CHECK: $x0 = COPY %sub_ext(s64)
95 ; CHECK: $x1 = COPY %carry_out_ext(s64)
99 %lhs:_(s8) = G_TRUNC %0
100 %rhs:_(s8) = G_TRUNC %1
101 %carry_in:_(s1) = G_TRUNC %2
102 %sub:_(s8), %carry_out:_(s1) = G_SSUBE %lhs, %rhs, %carry_in
103 %sub_ext:_(s64) = G_ANYEXT %sub
104 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
106 $x1 = COPY %carry_out_ext
110 name: test_scalar_ssube_32
113 ; CHECK-LABEL: name: test_scalar_ssube_32
114 ; CHECK: %lhs:_(s32) = COPY $w0
115 ; CHECK: %rhs:_(s32) = COPY $w1
116 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w2
117 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY]](s32)
118 ; CHECK: %sub:_(s32), %carry_out:_(s1) = G_SSUBE %lhs, %rhs, %carry_in
119 ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
120 ; CHECK: $w0 = COPY %sub(s32)
121 ; CHECK: $w1 = COPY %carry_out_ext(s32)
122 %lhs:_(s32) = COPY $w0
123 %rhs:_(s32) = COPY $w1
125 %carry_in:_(s1) = G_TRUNC %2
126 %sub:_(s32), %carry_out:_(s1) = G_SSUBE %lhs, %rhs, %carry_in
127 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
129 $w1 = COPY %carry_out_ext