1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=aarch64 -run-pass=legalizer %s -o - | FileCheck %s
4 name: test_scalar_add_big
7 ; CHECK-LABEL: name: test_scalar_add_big
8 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
9 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
10 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
11 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
12 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
13 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[C]](s32)
14 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY2]], [[TRUNC]]
15 ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY3]], [[UADDE1]]
16 ; CHECK: $x0 = COPY [[UADDE]](s64)
17 ; CHECK: $x1 = COPY [[UADDE2]](s64)
22 %4:_(s128) = G_MERGE_VALUES %0(s64), %1(s64)
23 %5:_(s128) = G_MERGE_VALUES %2(s64), %3(s64)
24 %6:_(s128) = G_ADD %4, %5
25 %7:_(s64), %8:_(s64) = G_UNMERGE_VALUES %6(s128)
31 name: test_scalar_add_big_nonpow2
34 ; CHECK-LABEL: name: test_scalar_add_big_nonpow2
35 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
36 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
37 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
38 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
39 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
40 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[C]](s32)
41 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], [[TRUNC]]
42 ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
43 ; CHECK: [[UADDE4:%[0-9]+]]:_(s64), [[UADDE5:%[0-9]+]]:_(s1) = G_UADDE [[COPY2]], [[COPY3]], [[UADDE3]]
44 ; CHECK: $x0 = COPY [[UADDE]](s64)
45 ; CHECK: $x1 = COPY [[UADDE2]](s64)
46 ; CHECK: $x2 = COPY [[UADDE4]](s64)
51 %4:_(s192) = G_MERGE_VALUES %0(s64), %1(s64), %2(s64)
52 %5:_(s192) = G_MERGE_VALUES %1(s64), %2(s64), %3(s64)
53 %6:_(s192) = G_ADD %4, %5
54 %7:_(s64), %8:_(s64), %9:_(s64) = G_UNMERGE_VALUES %6(s192)
61 name: test_scalar_add_small
64 ; CHECK-LABEL: name: test_scalar_add_small
65 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
66 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
67 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
68 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
69 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[TRUNC]], [[TRUNC1]]
70 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](s32)
71 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
74 %2:_(s8) = G_TRUNC %0(s64)
75 %3:_(s8) = G_TRUNC %1(s64)
76 %4:_(s8) = G_ADD %2, %3
77 %5:_(s64) = G_ANYEXT %4(s8)
85 ; CHECK-LABEL: name: test_vector_add
86 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
87 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
88 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
89 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
90 ; CHECK: [[ADD:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY]], [[COPY2]]
91 ; CHECK: [[ADD1:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY1]], [[COPY3]]
92 ; CHECK: $q0 = COPY [[ADD]](<2 x s64>)
93 ; CHECK: $q1 = COPY [[ADD1]](<2 x s64>)
94 %0:_(<2 x s64>) = COPY $q0
95 %1:_(<2 x s64>) = COPY $q1
96 %2:_(<2 x s64>) = COPY $q2
97 %3:_(<2 x s64>) = COPY $q3
98 %4:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1
99 %5:_(<4 x s64>) = G_CONCAT_VECTORS %2, %3
100 %6:_(<4 x s64>) = G_ADD %4, %5
101 %7:_(<2 x s64>), %8:_(<2 x s64>) = G_UNMERGE_VALUES %6(<4 x s64>)
102 $q0 = COPY %7(<2 x s64>)
103 $q1 = COPY %8(<2 x s64>)
107 name: test_vector_add_nonpow2
110 ; CHECK-LABEL: name: test_vector_add_nonpow2
111 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
112 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
113 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
114 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
115 ; CHECK: [[ADD:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY]], [[COPY1]]
116 ; CHECK: [[ADD1:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY1]], [[COPY2]]
117 ; CHECK: [[ADD2:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY2]], [[COPY3]]
118 ; CHECK: $q0 = COPY [[ADD]](<2 x s64>)
119 ; CHECK: $q1 = COPY [[ADD1]](<2 x s64>)
120 ; CHECK: $q2 = COPY [[ADD2]](<2 x s64>)
121 %0:_(<2 x s64>) = COPY $q0
122 %1:_(<2 x s64>) = COPY $q1
123 %2:_(<2 x s64>) = COPY $q2
124 %3:_(<2 x s64>) = COPY $q3
125 %4:_(<6 x s64>) = G_CONCAT_VECTORS %0(<2 x s64>), %1(<2 x s64>), %2(<2 x s64>)
126 %5:_(<6 x s64>) = G_CONCAT_VECTORS %1(<2 x s64>), %2(<2 x s64>), %3(<2 x s64>)
127 %6:_(<6 x s64>) = G_ADD %4, %5
128 %7:_(<2 x s64>), %8:_(<2 x s64>), %9:_(<2 x s64>) = G_UNMERGE_VALUES %6(<6 x s64>)
129 $q0 = COPY %7(<2 x s64>)
130 $q1 = COPY %8(<2 x s64>)
131 $q2 = COPY %9(<2 x s64>)