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-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: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s32) = G_UADDO [[COPY]], [[COPY2]]
14 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
15 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UADDO1]], [[C]]
16 ; CHECK-NEXT: [[SADDE:%[0-9]+]]:_(s64), [[SADDE1:%[0-9]+]]:_(s32) = G_SADDE [[COPY1]], [[COPY3]], [[AND]]
17 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[SADDE1]](s32)
18 ; CHECK-NEXT: $x0 = COPY [[UADDO]](s64)
19 ; CHECK-NEXT: $x1 = COPY [[SADDE]](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 %add:_(s128), %carry_out:_(s1) = G_SADDO %lhs, %rhs
28 %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
29 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
32 $x2 = COPY %carry_out_ext
36 name: narrow_scalar_saddo_big_nonpow2
39 ; CHECK-LABEL: name: narrow_scalar_saddo_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: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s32) = G_UADDO [[COPY]], [[COPY1]]
45 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
46 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UADDO1]], [[C]]
47 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY2]], [[AND]]
48 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UADDE1]], [[C]]
49 ; CHECK-NEXT: [[SADDE:%[0-9]+]]:_(s64), [[SADDE1:%[0-9]+]]:_(s32) = G_SADDE [[COPY2]], [[COPY3]], [[AND1]]
50 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[SADDE1]](s32)
51 ; CHECK-NEXT: $x0 = COPY [[UADDO]](s64)
52 ; CHECK-NEXT: $x1 = COPY [[UADDE]](s64)
53 ; CHECK-NEXT: $x2 = COPY [[SADDE]](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 %add:_(s192), %carry_out:_(s1) = G_SADDO %lhs, %rhs
62 %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
63 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
67 $x3 = COPY %carry_out_ext
71 name: test_scalar_saddo_small
74 ; CHECK-LABEL: name: test_scalar_saddo_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: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[SEXT_INREG]], [[SEXT_INREG1]]
82 ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ADD]], 8
83 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[SEXT_INREG2]]
84 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](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_SADDO %2, %3
93 %6:_(s64) = G_ANYEXT %4(s8)
94 %7:_(s64) = G_ANYEXT %5(s1)
100 name: test_scalar_saddo_32
103 ; CHECK-LABEL: name: test_scalar_saddo_32
104 ; CHECK: %lhs:_(s32) = COPY $w0
105 ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
106 ; CHECK-NEXT: %add:_(s32), %5:_(s32) = G_SADDO %lhs, %rhs
107 ; CHECK-NEXT: $w0 = COPY %add(s32)
108 ; CHECK-NEXT: $w1 = COPY %5(s32)
109 %lhs:_(s32) = COPY $w0
110 %rhs:_(s32) = COPY $w1
111 %add:_(s32), %carry_out:_(s1) = G_SADDO %lhs, %rhs
112 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
114 $w1 = COPY %carry_out_ext