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_ssubo_s128
8 ; CHECK-LABEL: name: narrow_scalar_ssubo_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: [[SSUBE:%[0-9]+]]:_(s64), [[SSUBE1:%[0-9]+]]:_(s32) = G_SSUBE [[COPY1]], [[COPY3]], [[AND]]
17 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[SSUBE1]](s32)
18 ; CHECK-NEXT: $x0 = COPY [[USUBO]](s64)
19 ; CHECK-NEXT: $x1 = COPY [[SSUBE]](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_SSUBO %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_ssubo_big_nonpow2
39 ; CHECK-LABEL: name: narrow_scalar_ssubo_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: [[SSUBE:%[0-9]+]]:_(s64), [[SSUBE1:%[0-9]+]]:_(s32) = G_SSUBE [[COPY2]], [[COPY3]], [[AND1]]
50 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[SSUBE1]](s32)
51 ; CHECK-NEXT: $x0 = COPY [[USUBO]](s64)
52 ; CHECK-NEXT: $x1 = COPY [[USUBE]](s64)
53 ; CHECK-NEXT: $x2 = COPY [[SSUBE]](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_SSUBO %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_ssubo_small
74 ; CHECK-LABEL: name: test_scalar_ssubo_small
75 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
76 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
77 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
78 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
79 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
80 ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
81 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[SEXT_INREG]], [[SEXT_INREG1]]
82 ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[SUB]], 8
83 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[SEXT_INREG2]]
84 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SUB]](s32)
85 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
86 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
87 ; CHECK-NEXT: $x1 = COPY [[ANYEXT1]](s64)
90 %2:_(s8) = G_TRUNC %0(s64)
91 %3:_(s8) = G_TRUNC %1(s64)
92 %4:_(s8), %5:_(s1) = G_SSUBO %2, %3
93 %6:_(s64) = G_ANYEXT %4(s8)
94 %7:_(s64) = G_ANYEXT %5(s1)
100 name: test_scalar_ssubo_32
103 ; CHECK-LABEL: name: test_scalar_ssubo_32
104 ; CHECK: %lhs:_(s32) = COPY $w0
105 ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
106 ; CHECK-NEXT: %sub:_(s32), %5:_(s32) = G_SSUBO %lhs, %rhs
107 ; CHECK-NEXT: $w0 = COPY %sub(s32)
108 ; CHECK-NEXT: $w1 = COPY %5(s32)
109 %lhs:_(s32) = COPY $w0
110 %rhs:_(s32) = COPY $w1
111 %sub:_(s32), %carry_out:_(s1) = G_SSUBO %lhs, %rhs
112 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
114 $w1 = COPY %carry_out_ext