xref: /llvm-project/llvm/test/Analysis/CostModel/AArch64/arith-fp-sve.ll (revision 0b745a10843fc85e579bbf459f78b3f43e7ab309)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt < %s -enable-no-nans-fp-math -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64 -mattr=+fullfp16 -mattr=+sve | FileCheck %s
3
4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5
6define void @fadd() {
7; CHECK-LABEL: 'fadd'
8; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F16 = fadd <vscale x 4 x half> undef, undef
9; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8F16 = fadd <vscale x 8 x half> undef, undef
10; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16F16 = fadd <vscale x 16 x half> undef, undef
11; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V1F32 = fadd <vscale x 1 x float> undef, undef
12; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F32 = fadd <vscale x 2 x float> undef, undef
13; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F32 = fadd <vscale x 4 x float> undef, undef
14; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8F32 = fadd <vscale x 8 x float> undef, undef
15; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F64 = fadd <vscale x 2 x double> undef, undef
16; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F64 = fadd <vscale x 4 x double> undef, undef
17; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
18;
19  %V4F16 = fadd <vscale x 4 x half> undef, undef
20  %V8F16 = fadd <vscale x 8 x half> undef, undef
21  %V16F16 = fadd <vscale x 16 x half> undef, undef
22
23  %V1F32 = fadd <vscale x 1 x float> undef, undef
24  %V2F32 = fadd <vscale x 2 x float> undef, undef
25  %V4F32 = fadd <vscale x 4 x float> undef, undef
26  %V8F32 = fadd <vscale x 8 x float> undef, undef
27
28  %V2F64 = fadd <vscale x 2 x double> undef, undef
29  %V4F64 = fadd <vscale x 4 x double> undef, undef
30
31  ret void
32}
33
34define void @fsub() {
35; CHECK-LABEL: 'fsub'
36; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F16 = fsub <vscale x 4 x half> undef, undef
37; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8F16 = fsub <vscale x 8 x half> undef, undef
38; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16F16 = fsub <vscale x 16 x half> undef, undef
39; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V1F32 = fsub <vscale x 1 x float> undef, undef
40; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F32 = fsub <vscale x 2 x float> undef, undef
41; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F32 = fsub <vscale x 4 x float> undef, undef
42; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8F32 = fsub <vscale x 8 x float> undef, undef
43; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F64 = fsub <vscale x 2 x double> undef, undef
44; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F64 = fsub <vscale x 4 x double> undef, undef
45; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
46;
47  %V4F16 = fsub <vscale x 4 x half> undef, undef
48  %V8F16 = fsub <vscale x 8 x half> undef, undef
49  %V16F16 = fsub <vscale x 16 x half> undef, undef
50
51  %V1F32 = fsub <vscale x 1 x float> undef, undef
52  %V2F32 = fsub <vscale x 2 x float> undef, undef
53  %V4F32 = fsub <vscale x 4 x float> undef, undef
54  %V8F32 = fsub <vscale x 8 x float> undef, undef
55
56  %V2F64 = fsub <vscale x 2 x double> undef, undef
57  %V4F64 = fsub <vscale x 4 x double> undef, undef
58
59  ret void
60}
61
62define void @fneg() {
63; CHECK-LABEL: 'fneg'
64; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F16 = fneg <vscale x 2 x half> undef
65; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F16 = fneg <vscale x 4 x half> undef
66; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8F16 = fneg <vscale x 8 x half> undef
67; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16F16 = fneg <vscale x 16 x half> undef
68; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F32 = fneg <vscale x 2 x float> undef
69; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4F32 = fneg <vscale x 4 x float> undef
70; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8F32 = fneg <vscale x 8 x float> undef
71; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2F64 = fneg <vscale x 2 x double> undef
72; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F64 = fneg <vscale x 4 x double> undef
73; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
74;
75  %V2F16 = fneg <vscale x 2 x half> undef
76  %V4F16 = fneg <vscale x 4 x half> undef
77  %V8F16 = fneg <vscale x 8 x half> undef
78  %V16F16 = fneg <vscale x 16 x half> undef
79
80  %V2F32 = fneg <vscale x 2 x float> undef
81  %V4F32 = fneg <vscale x 4 x float> undef
82  %V8F32 = fneg <vscale x 8 x float> undef
83
84  %V2F64 = fneg <vscale x 2 x double> undef
85  %V4F64 = fneg <vscale x 4 x double> undef
86
87  ret void
88}
89
90define void @fmul() {
91; CHECK-LABEL: 'fmul'
92; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F16 = fmul <vscale x 4 x half> undef, undef
93; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8F16 = fmul <vscale x 8 x half> undef, undef
94; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16F16 = fmul <vscale x 16 x half> undef, undef
95; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2F32 = fmul <vscale x 2 x float> undef, undef
96; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F32 = fmul <vscale x 4 x float> undef, undef
97; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8F32 = fmul <vscale x 8 x float> undef, undef
98; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2F64 = fmul <vscale x 2 x double> undef, undef
99; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4F64 = fmul <vscale x 4 x double> undef, undef
100; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
101;
102  %V4F16 = fmul <vscale x 4 x half> undef, undef
103  %V8F16 = fmul <vscale x 8 x half> undef, undef
104  %V16F16 = fmul <vscale x 16 x half> undef, undef
105
106  %V2F32 = fmul <vscale x 2 x float> undef, undef
107  %V4F32 = fmul <vscale x 4 x float> undef, undef
108  %V8F32 = fmul <vscale x 8 x float> undef, undef
109
110  %V2F64 = fmul <vscale x 2 x double> undef, undef
111  %V4F64 = fmul <vscale x 4 x double> undef, undef
112
113  ret void
114}
115
116define void @fdiv() {
117; CHECK-LABEL: 'fdiv'
118; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F16 = fdiv <vscale x 4 x half> undef, undef
119; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8F16 = fdiv <vscale x 8 x half> undef, undef
120; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16F16 = fdiv <vscale x 16 x half> undef, undef
121; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2F32 = fdiv <vscale x 2 x float> undef, undef
122; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4F32 = fdiv <vscale x 4 x float> undef, undef
123; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8F32 = fdiv <vscale x 8 x float> undef, undef
124; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2F64 = fdiv <vscale x 2 x double> undef, undef
125; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4F64 = fdiv <vscale x 4 x double> undef, undef
126; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
127;
128  %V4F16 = fdiv <vscale x 4 x half> undef, undef
129  %V8F16 = fdiv <vscale x 8 x half> undef, undef
130  %V16F16 = fdiv <vscale x 16 x half> undef, undef
131
132  %V2F32 = fdiv <vscale x 2 x float> undef, undef
133  %V4F32 = fdiv <vscale x 4 x float> undef, undef
134  %V8F32 = fdiv <vscale x 8 x float> undef, undef
135
136  %V2F64 = fdiv <vscale x 2 x double> undef, undef
137  %V4F64 = fdiv <vscale x 4 x double> undef, undef
138
139  ret void
140}
141
142define void @frem() {
143; CHECK-LABEL: 'frem'
144; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V4F16 = frem <vscale x 4 x half> undef, undef
145; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V8F16 = frem <vscale x 8 x half> undef, undef
146; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V16F16 = frem <vscale x 16 x half> undef, undef
147; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V2F32 = frem <vscale x 2 x float> undef, undef
148; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V4F32 = frem <vscale x 4 x float> undef, undef
149; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V8F32 = frem <vscale x 8 x float> undef, undef
150; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V2F64 = frem <vscale x 2 x double> undef, undef
151; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %V4F64 = frem <vscale x 4 x double> undef, undef
152; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
153;
154  %V4F16 = frem <vscale x 4 x half> undef, undef
155  %V8F16 = frem <vscale x 8 x half> undef, undef
156  %V16F16 = frem <vscale x 16 x half> undef, undef
157
158  %V2F32 = frem <vscale x 2 x float> undef, undef
159  %V4F32 = frem <vscale x 4 x float> undef, undef
160  %V8F32 = frem <vscale x 8 x float> undef, undef
161
162  %V2F64 = frem <vscale x 2 x double> undef, undef
163  %V4F64 = frem <vscale x 4 x double> undef, undef
164
165  ret void
166}
167