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_saddo_s128
8 ; CHECK-LABEL: name: narrow_scalar_saddo_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: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY2]]
14 ; CHECK: %17:_(s64), %carry_out:_(s1) = G_SADDE [[COPY1]], [[COPY3]], [[UADDO1]]
15 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
16 ; CHECK: $x0 = COPY [[UADDO]](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 %add:_(s128), %carry_out:_(s1) = G_SADDO %lhs, %rhs
26 %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
27 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
30 $x2 = COPY %carry_out_ext
34 name: narrow_scalar_saddo_big_nonpow2
37 ; CHECK-LABEL: name: narrow_scalar_saddo_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: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]]
43 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDO1]]
44 ; CHECK: %22:_(s64), %carry_out:_(s1) = G_SADDE [[COPY2]], [[COPY3]], [[UADDE1]]
45 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
46 ; CHECK: $x0 = COPY [[UADDO]](s64)
47 ; CHECK: $x1 = COPY [[UADDE]](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 %add:_(s192), %carry_out:_(s1) = G_SADDO %lhs, %rhs
57 %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
58 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
62 $x3 = COPY %carry_out_ext
66 name: test_scalar_saddo_small
69 ; CHECK-LABEL: name: test_scalar_saddo_small
70 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
71 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
72 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
73 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
74 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
75 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
76 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[SEXT_INREG]], [[SEXT_INREG1]]
77 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[ADD]](s32)
78 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
79 ; CHECK: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 8
80 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[SEXT_INREG2]]
81 ; CHECK: [[COPY3:%[0-9]+]]:_(s8) = COPY [[TRUNC2]](s8)
82 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](s32)
83 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32)
84 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
85 ; CHECK: $x1 = COPY [[ANYEXT1]](s64)
88 %2:_(s8) = G_TRUNC %0(s64)
89 %3:_(s8) = G_TRUNC %1(s64)
90 %4:_(s8), %5:_(s1) = G_SADDO %2, %3
91 %6:_(s64) = G_ANYEXT %4(s8)
92 %7:_(s64) = G_ANYEXT %5(s1)
98 name: test_scalar_saddo_32
101 ; CHECK-LABEL: name: test_scalar_saddo_32
102 ; CHECK: %lhs:_(s32) = COPY $w0
103 ; CHECK: %rhs:_(s32) = COPY $w1
104 ; CHECK: %add:_(s32), %carry_out:_(s1) = G_SADDO %lhs, %rhs
105 ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
106 ; CHECK: $w0 = COPY %add(s32)
107 ; CHECK: $w1 = COPY %carry_out_ext(s32)
108 %lhs:_(s32) = COPY $w0
109 %rhs:_(s32) = COPY $w1
110 %add:_(s32), %carry_out:_(s1) = G_SADDO %lhs, %rhs
111 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
113 $w1 = COPY %carry_out_ext