Skip to content

Commit 13865b0

Browse files
committed
[AArch64] Add fneg(fmul) and fmul(fneg) tests. NFC
1 parent 3e999bb commit 13865b0

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

llvm/test/Analysis/CostModel/AArch64/arith-fp.ll

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,122 @@ define i32 @fneg(i32 %arg) {
131131
ret i32 undef
132132
}
133133

134+
define i32 @fmulfneg(i32 %arg) {
135+
; CHECK-LABEL: 'fmulfneg'
136+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F16 = fneg half undef
137+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F16M = fmul half %F16, undef
138+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F16 = fneg <2 x half> undef
139+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F16M = fmul <2 x half> %V2F16, undef
140+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V4F16 = fneg <4 x half> undef
141+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F16M = fmul <4 x half> %V4F16, undef
142+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V8F16 = fneg <8 x half> undef
143+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8F16M = fmul <8 x half> %V8F16, undef
144+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16F16 = fneg <16 x half> undef
145+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16F16M = fmul <16 x half> %V16F16, undef
146+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F32 = fneg float undef
147+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F32M = fmul float %F32, undef
148+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F32 = fneg <2 x float> undef
149+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F32M = fmul <2 x float> %V2F32, undef
150+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V4F32 = fneg <4 x float> undef
151+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F32M = fmul <4 x float> %V4F32, undef
152+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8F32 = fneg <8 x float> undef
153+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8F32M = fmul <8 x float> %V8F32, undef
154+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F64 = fneg double undef
155+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F64M = fmul double %F64, undef
156+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F64 = fneg <2 x double> undef
157+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F64M = fmul <2 x double> %V2F64, undef
158+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F64 = fneg <4 x double> undef
159+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4F64M = fmul <4 x double> %V4F64, undef
160+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
161+
;
162+
%F16 = fneg half undef
163+
%F16M = fmul half %F16, undef
164+
%V2F16 = fneg <2 x half> undef
165+
%V2F16M = fmul <2 x half> %V2F16, undef
166+
%V4F16 = fneg <4 x half> undef
167+
%V4F16M = fmul <4 x half> %V4F16, undef
168+
%V8F16 = fneg <8 x half> undef
169+
%V8F16M = fmul <8 x half> %V8F16, undef
170+
%V16F16 = fneg <16 x half> undef
171+
%V16F16M = fmul <16 x half> %V16F16, undef
172+
173+
%F32 = fneg float undef
174+
%F32M = fmul float %F32, undef
175+
%V2F32 = fneg <2 x float> undef
176+
%V2F32M = fmul <2 x float> %V2F32, undef
177+
%V4F32 = fneg <4 x float> undef
178+
%V4F32M = fmul <4 x float> %V4F32, undef
179+
%V8F32 = fneg <8 x float> undef
180+
%V8F32M = fmul <8 x float> %V8F32, undef
181+
182+
%F64 = fneg double undef
183+
%F64M = fmul double %F64, undef
184+
%V2F64 = fneg <2 x double> undef
185+
%V2F64M = fmul <2 x double> %V2F64, undef
186+
%V4F64 = fneg <4 x double> undef
187+
%V4F64M = fmul <4 x double> %V4F64, undef
188+
189+
ret i32 undef
190+
}
191+
192+
define i32 @fnegfmul(i32 %arg) {
193+
; CHECK-LABEL: 'fnegfmul'
194+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F16M = fmul half undef, undef
195+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F16 = fneg half %F16M
196+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F16M = fmul <2 x half> undef, undef
197+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F16 = fneg <2 x half> %V2F16M
198+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F16M = fmul <4 x half> undef, undef
199+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V4F16 = fneg <4 x half> %V4F16M
200+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8F16M = fmul <8 x half> undef, undef
201+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V8F16 = fneg <8 x half> %V8F16M
202+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16F16M = fmul <16 x half> undef, undef
203+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16F16 = fneg <16 x half> %V16F16M
204+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F32M = fmul float undef, undef
205+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F32 = fneg float %F32M
206+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F32M = fmul <2 x float> undef, undef
207+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F32 = fneg <2 x float> %V2F32M
208+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F32M = fmul <4 x float> undef, undef
209+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V4F32 = fneg <4 x float> %V4F32M
210+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8F32M = fmul <8 x float> undef, undef
211+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8F32 = fneg <8 x float> %V8F32M
212+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F64M = fmul double undef, undef
213+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %F64 = fneg double %F64M
214+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F64M = fmul <2 x double> undef, undef
215+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V2F64 = fneg <2 x double> %V2F64M
216+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4F64M = fmul <4 x double> undef, undef
217+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F64 = fneg <4 x double> %V4F64M
218+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
219+
;
220+
%F16M = fmul half undef, undef
221+
%F16 = fneg half %F16M
222+
%V2F16M = fmul <2 x half> undef, undef
223+
%V2F16 = fneg <2 x half> %V2F16M
224+
%V4F16M = fmul <4 x half> undef, undef
225+
%V4F16 = fneg <4 x half> %V4F16M
226+
%V8F16M = fmul <8 x half> undef, undef
227+
%V8F16 = fneg <8 x half> %V8F16M
228+
%V16F16M = fmul <16 x half> undef, undef
229+
%V16F16 = fneg <16 x half> %V16F16M
230+
231+
%F32M = fmul float undef, undef
232+
%F32 = fneg float %F32M
233+
%V2F32M = fmul <2 x float> undef, undef
234+
%V2F32 = fneg <2 x float> %V2F32M
235+
%V4F32M = fmul <4 x float> undef, undef
236+
%V4F32 = fneg <4 x float> %V4F32M
237+
%V8F32M = fmul <8 x float> undef, undef
238+
%V8F32 = fneg <8 x float> %V8F32M
239+
240+
%F64M = fmul double undef, undef
241+
%F64 = fneg double %F64M
242+
%V2F64M = fmul <2 x double> undef, undef
243+
%V2F64 = fneg <2 x double> %V2F64M
244+
%V4F64M = fmul <4 x double> undef, undef
245+
%V4F64 = fneg <4 x double> %V4F64M
246+
247+
ret i32 undef
248+
}
249+
134250
define i32 @fmul(i32 %arg) {
135251
; CHECK-LABEL: 'fmul'
136252
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F16 = fmul half undef, undef

0 commit comments

Comments
 (0)