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_uaddo_s128
8 ; CHECK-LABEL: name: narrow_scalar_uaddo_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: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY3]], [[AND]]
17 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE1]](s32)
18 ; CHECK-NEXT: $x0 = COPY [[UADDO]](s64)
19 ; CHECK-NEXT: $x1 = COPY [[UADDE]](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_UADDO %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_uaddo_big_nonpow2
39 ; CHECK-LABEL: name: narrow_scalar_uaddo_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: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s32) = G_UADDE [[COPY2]], [[COPY3]], [[AND1]]
50 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE3]](s32)
51 ; CHECK-NEXT: $x0 = COPY [[UADDO]](s64)
52 ; CHECK-NEXT: $x1 = COPY [[UADDE]](s64)
53 ; CHECK-NEXT: $x2 = COPY [[UADDE2]](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_UADDO %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_uaddo_small
74 ; CHECK-LABEL: name: test_scalar_uaddo_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: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
83 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
84 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
85 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](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_UADDO %2, %3
94 %6:_(s64) = G_ANYEXT %4(s8)
95 %7:_(s64) = G_ANYEXT %5(s1)
101 name: test_scalar_uaddo_32
104 ; CHECK-LABEL: name: test_scalar_uaddo_32
105 ; CHECK: %lhs:_(s32) = COPY $w0
106 ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
107 ; CHECK-NEXT: %add:_(s32), %5:_(s32) = G_UADDO %lhs, %rhs
108 ; CHECK-NEXT: $w0 = COPY %add(s32)
109 ; CHECK-NEXT: $w1 = COPY %5(s32)
110 %lhs:_(s32) = COPY $w0
111 %rhs:_(s32) = COPY $w1
112 %add:_(s32), %carry_out:_(s1) = G_UADDO %lhs, %rhs
113 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
115 $w1 = COPY %carry_out_ext