1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
3 # RUN: llc -mtriple=aarch64 -run-pass=legalizer -mattr=+cssc -global-isel-abort=1 %s -o - | FileCheck %s --check-prefix=CHECK-CSSC
9 ; CHECK-LABEL: name: abs_s32
10 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
11 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
12 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s64)
13 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ASHR]]
14 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ADD]], [[ASHR]]
15 ; CHECK-NEXT: $w0 = COPY [[XOR]](s32)
16 ; CHECK-CSSC-LABEL: name: abs_s32
17 ; CHECK-CSSC: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
18 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(s32) = G_ABS [[COPY]]
19 ; CHECK-CSSC-NEXT: $w0 = COPY [[ABS]](s32)
21 %1:_(s32) = G_ABS %0(s32)
29 ; CHECK-LABEL: name: abs_s64
30 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
31 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
32 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s64)
33 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[ASHR]]
34 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[ADD]], [[ASHR]]
35 ; CHECK-NEXT: $x0 = COPY [[XOR]](s64)
36 ; CHECK-CSSC-LABEL: name: abs_s64
37 ; CHECK-CSSC: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
38 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(s64) = G_ABS [[COPY]]
39 ; CHECK-CSSC-NEXT: $x0 = COPY [[ABS]](s64)
41 %1:_(s64) = G_ABS %0(s64)
46 tracksRegLiveness: true
51 ; CHECK-LABEL: name: abs_v4s16
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
55 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<4 x s16>) = G_ABS [[COPY]]
56 ; CHECK-NEXT: $d0 = COPY [[ABS]](<4 x s16>)
57 ; CHECK-NEXT: RET_ReallyLR implicit $d0
58 ; CHECK-CSSC-LABEL: name: abs_v4s16
59 ; CHECK-CSSC: liveins: $d0
60 ; CHECK-CSSC-NEXT: {{ $}}
61 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
62 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<4 x s16>) = G_ABS [[COPY]]
63 ; CHECK-CSSC-NEXT: $d0 = COPY [[ABS]](<4 x s16>)
64 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $d0
65 %0:_(<4 x s16>) = COPY $d0
66 %1:_(<4 x s16>) = G_ABS %0
67 $d0 = COPY %1(<4 x s16>)
68 RET_ReallyLR implicit $d0
73 tracksRegLiveness: true
78 ; CHECK-LABEL: name: abs_v8s16
81 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
82 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<8 x s16>) = G_ABS [[COPY]]
83 ; CHECK-NEXT: $q0 = COPY [[ABS]](<8 x s16>)
84 ; CHECK-NEXT: RET_ReallyLR implicit $q0
85 ; CHECK-CSSC-LABEL: name: abs_v8s16
86 ; CHECK-CSSC: liveins: $q0
87 ; CHECK-CSSC-NEXT: {{ $}}
88 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
89 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<8 x s16>) = G_ABS [[COPY]]
90 ; CHECK-CSSC-NEXT: $q0 = COPY [[ABS]](<8 x s16>)
91 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $q0
92 %0:_(<8 x s16>) = COPY $q0
93 %1:_(<8 x s16>) = G_ABS %0
94 $q0 = COPY %1(<8 x s16>)
95 RET_ReallyLR implicit $q0
100 tracksRegLiveness: true
105 ; CHECK-LABEL: name: abs_v2s32
106 ; CHECK: liveins: $d0
108 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
109 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<2 x s32>) = G_ABS [[COPY]]
110 ; CHECK-NEXT: $d0 = COPY [[ABS]](<2 x s32>)
111 ; CHECK-NEXT: RET_ReallyLR implicit $d0
112 ; CHECK-CSSC-LABEL: name: abs_v2s32
113 ; CHECK-CSSC: liveins: $d0
114 ; CHECK-CSSC-NEXT: {{ $}}
115 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
116 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<2 x s32>) = G_ABS [[COPY]]
117 ; CHECK-CSSC-NEXT: $d0 = COPY [[ABS]](<2 x s32>)
118 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $d0
119 %0:_(<2 x s32>) = COPY $d0
120 %1:_(<2 x s32>) = G_ABS %0
121 $d0 = COPY %1(<2 x s32>)
122 RET_ReallyLR implicit $d0
127 tracksRegLiveness: true
132 ; CHECK-LABEL: name: abs_v4s32
133 ; CHECK: liveins: $q0
135 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
136 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<4 x s32>) = G_ABS [[COPY]]
137 ; CHECK-NEXT: $q0 = COPY [[ABS]](<4 x s32>)
138 ; CHECK-NEXT: RET_ReallyLR implicit $q0
139 ; CHECK-CSSC-LABEL: name: abs_v4s32
140 ; CHECK-CSSC: liveins: $q0
141 ; CHECK-CSSC-NEXT: {{ $}}
142 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
143 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<4 x s32>) = G_ABS [[COPY]]
144 ; CHECK-CSSC-NEXT: $q0 = COPY [[ABS]](<4 x s32>)
145 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $q0
146 %0:_(<4 x s32>) = COPY $q0
147 %1:_(<4 x s32>) = G_ABS %0
148 $q0 = COPY %1(<4 x s32>)
149 RET_ReallyLR implicit $q0
154 tracksRegLiveness: true
159 ; CHECK-LABEL: name: abs_v4s8
160 ; CHECK: liveins: $d0
162 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
163 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<8 x s8>) = G_ABS [[COPY]]
164 ; CHECK-NEXT: $d0 = COPY [[ABS]](<8 x s8>)
165 ; CHECK-NEXT: RET_ReallyLR implicit $d0
166 ; CHECK-CSSC-LABEL: name: abs_v4s8
167 ; CHECK-CSSC: liveins: $d0
168 ; CHECK-CSSC-NEXT: {{ $}}
169 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
170 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<8 x s8>) = G_ABS [[COPY]]
171 ; CHECK-CSSC-NEXT: $d0 = COPY [[ABS]](<8 x s8>)
172 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $d0
173 %0:_(<8 x s8>) = COPY $d0
174 %1:_(<8 x s8>) = G_ABS %0
175 $d0 = COPY %1(<8 x s8>)
176 RET_ReallyLR implicit $d0
181 tracksRegLiveness: true
186 ; CHECK-LABEL: name: abs_v16s8
187 ; CHECK: liveins: $q0
189 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
190 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(<16 x s8>) = G_ABS [[COPY]]
191 ; CHECK-NEXT: $q0 = COPY [[ABS]](<16 x s8>)
192 ; CHECK-NEXT: RET_ReallyLR implicit $q0
193 ; CHECK-CSSC-LABEL: name: abs_v16s8
194 ; CHECK-CSSC: liveins: $q0
195 ; CHECK-CSSC-NEXT: {{ $}}
196 ; CHECK-CSSC-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
197 ; CHECK-CSSC-NEXT: [[ABS:%[0-9]+]]:_(<16 x s8>) = G_ABS [[COPY]]
198 ; CHECK-CSSC-NEXT: $q0 = COPY [[ABS]](<16 x s8>)
199 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $q0
200 %0:_(<16 x s8>) = COPY $q0
201 %1:_(<16 x s8>) = G_ABS %0
202 $q0 = COPY %1(<16 x s8>)
203 RET_ReallyLR implicit $q0