fparith.ll
11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -cost-model -analyze -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve < %s | FileCheck %s --check-prefix=CHECK-MVE
; RUN: opt -cost-model -analyze -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve.fp < %s | FileCheck %s --check-prefix=CHECK-MVEFP
define void @f32() {
; CHECK-MVE-LABEL: 'f32'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd float undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub float undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul float undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'f32'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd float undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub float undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul float undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c = fadd float undef, undef
%d = fsub float undef, undef
%e = fmul float undef, undef
ret void
}
define void @f16() {
; CHECK-MVE-LABEL: 'f16'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd half undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub half undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul half undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'f16'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd half undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub half undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul half undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c = fadd half undef, undef
%d = fsub half undef, undef
%e = fmul half undef, undef
ret void
}
define void @f64() {
; CHECK-MVE-LABEL: 'f64'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd double undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub double undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul double undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'f64'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = fadd double undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = fsub double undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = fmul double undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c = fadd double undef, undef
%d = fsub double undef, undef
%e = fmul double undef, undef
ret void
}
define void @vf32() {
; CHECK-MVE-LABEL: 'vf32'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %c2 = fadd <2 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %d2 = fsub <2 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %e2 = fmul <2 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %c4 = fadd <4 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %d4 = fsub <4 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %e4 = fmul <4 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %c8 = fadd <8 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %d8 = fsub <8 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %e8 = fmul <8 x float> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'vf32'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %c2 = fadd <2 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %d2 = fsub <2 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e2 = fmul <2 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %c4 = fadd <4 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %d4 = fsub <4 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e4 = fmul <4 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %c8 = fadd <8 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %d8 = fsub <8 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %e8 = fmul <8 x float> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c2 = fadd <2 x float> undef, undef
%d2 = fsub <2 x float> undef, undef
%e2 = fmul <2 x float> undef, undef
%c4 = fadd <4 x float> undef, undef
%d4 = fsub <4 x float> undef, undef
%e4 = fmul <4 x float> undef, undef
%c8 = fadd <8 x float> undef, undef
%d8 = fsub <8 x float> undef, undef
%e8 = fmul <8 x float> undef, undef
ret void
}
define void @vf16() {
; CHECK-MVE-LABEL: 'vf16'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %c2 = fadd <2 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %d2 = fsub <2 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %e2 = fmul <2 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %c4 = fadd <4 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %d4 = fsub <4 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %e4 = fmul <4 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %c8 = fadd <8 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %d8 = fsub <8 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %e8 = fmul <8 x half> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'vf16'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %c2 = fadd <2 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %d2 = fsub <2 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e2 = fmul <2 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %c4 = fadd <4 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %d4 = fsub <4 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e4 = fmul <4 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %c8 = fadd <8 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %d8 = fsub <8 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e8 = fmul <8 x half> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c2 = fadd <2 x half> undef, undef
%d2 = fsub <2 x half> undef, undef
%e2 = fmul <2 x half> undef, undef
%c4 = fadd <4 x half> undef, undef
%d4 = fsub <4 x half> undef, undef
%e4 = fmul <4 x half> undef, undef
%c8 = fadd <8 x half> undef, undef
%d8 = fsub <8 x half> undef, undef
%e8 = fmul <8 x half> undef, undef
ret void
}
define void @vf64() {
; CHECK-MVE-LABEL: 'vf64'
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %c2 = fadd <2 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %d2 = fsub <2 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %e2 = fmul <2 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %c4 = fadd <4 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %d4 = fsub <4 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %e4 = fmul <4 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %c8 = fadd <8 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %d8 = fsub <8 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %e8 = fmul <8 x double> undef, undef
; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-MVEFP-LABEL: 'vf64'
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %c2 = fadd <2 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %d2 = fsub <2 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %e2 = fmul <2 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %c4 = fadd <4 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %d4 = fsub <4 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %e4 = fmul <4 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %c8 = fadd <8 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %d8 = fsub <8 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %e8 = fmul <8 x double> undef, undef
; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%c2 = fadd <2 x double> undef, undef
%d2 = fsub <2 x double> undef, undef
%e2 = fmul <2 x double> undef, undef
%c4 = fadd <4 x double> undef, undef
%d4 = fsub <4 x double> undef, undef
%e4 = fmul <4 x double> undef, undef
%c8 = fadd <8 x double> undef, undef
%d8 = fsub <8 x double> undef, undef
%e8 = fmul <8 x double> undef, undef
ret void
}