1 |
|
---|
2 | #=============================================================================
|
---|
3 | #
|
---|
4 | # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic
|
---|
5 | # Package, Release 3e, by John R. Hauser.
|
---|
6 | #
|
---|
7 | # Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
---|
8 | # University of California. All rights reserved.
|
---|
9 | #
|
---|
10 | # Redistribution and use in source and binary forms, with or without
|
---|
11 | # modification, are permitted provided that the following conditions are met:
|
---|
12 | #
|
---|
13 | # 1. Redistributions of source code must retain the above copyright notice,
|
---|
14 | # this list of conditions, and the following disclaimer.
|
---|
15 | #
|
---|
16 | # 2. Redistributions in binary form must reproduce the above copyright
|
---|
17 | # notice, this list of conditions, and the following disclaimer in the
|
---|
18 | # documentation and/or other materials provided with the distribution.
|
---|
19 | #
|
---|
20 | # 3. Neither the name of the University nor the names of its contributors
|
---|
21 | # may be used to endorse or promote products derived from this software
|
---|
22 | # without specific prior written permission.
|
---|
23 | #
|
---|
24 | # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
---|
25 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
26 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
---|
27 | # DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
---|
28 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
29 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
30 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
31 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
33 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
34 | #
|
---|
35 | #=============================================================================
|
---|
36 |
|
---|
37 | SOURCE_DIR ?= ../../source
|
---|
38 | SPECIALIZE_TYPE ?= 8086
|
---|
39 |
|
---|
40 | SOFTFLOAT_OPTS ?= \
|
---|
41 | -DSOFTFLOAT_ROUND_ODD -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 \
|
---|
42 | -DSOFTFLOAT_FAST_DIV64TO32
|
---|
43 |
|
---|
44 | DELETE = rm -f
|
---|
45 | C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
|
---|
46 | COMPILE_C = \
|
---|
47 | gcc -c -Werror-implicit-function-declaration $(SOFTFLOAT_OPTS) \
|
---|
48 | $(C_INCLUDES) -O2 -o $@
|
---|
49 | MAKELIB = ar crs $@
|
---|
50 |
|
---|
51 | OBJ = .o
|
---|
52 | LIB = .a
|
---|
53 |
|
---|
54 | OTHER_HEADERS =
|
---|
55 |
|
---|
56 | .PHONY: all
|
---|
57 | all: softfloat$(LIB)
|
---|
58 |
|
---|
59 | OBJS_PRIMITIVES = \
|
---|
60 | s_compare96M$(OBJ) \
|
---|
61 | s_compare128M$(OBJ) \
|
---|
62 | s_shortShiftLeft64To96M$(OBJ) \
|
---|
63 | s_shortShiftLeftM$(OBJ) \
|
---|
64 | s_shiftLeftM$(OBJ) \
|
---|
65 | s_shortShiftRightM$(OBJ) \
|
---|
66 | s_shortShiftRightJam64$(OBJ) \
|
---|
67 | s_shortShiftRightJamM$(OBJ) \
|
---|
68 | s_shiftRightJam32$(OBJ) \
|
---|
69 | s_shiftRightJam64$(OBJ) \
|
---|
70 | s_shiftRightJamM$(OBJ) \
|
---|
71 | s_shiftRightM$(OBJ) \
|
---|
72 | s_countLeadingZeros8$(OBJ) \
|
---|
73 | s_countLeadingZeros16$(OBJ) \
|
---|
74 | s_countLeadingZeros32$(OBJ) \
|
---|
75 | s_countLeadingZeros64$(OBJ) \
|
---|
76 | s_addM$(OBJ) \
|
---|
77 | s_addCarryM$(OBJ) \
|
---|
78 | s_addComplCarryM$(OBJ) \
|
---|
79 | s_negXM$(OBJ) \
|
---|
80 | s_sub1XM$(OBJ) \
|
---|
81 | s_subM$(OBJ) \
|
---|
82 | s_mul64To128M$(OBJ) \
|
---|
83 | s_mul128MTo256M$(OBJ) \
|
---|
84 | s_approxRecip_1Ks$(OBJ) \
|
---|
85 | s_approxRecip32_1$(OBJ) \
|
---|
86 | s_approxRecipSqrt_1Ks$(OBJ) \
|
---|
87 | s_approxRecipSqrt32_1$(OBJ) \
|
---|
88 | s_remStepMBy32$(OBJ) \
|
---|
89 |
|
---|
90 | OBJS_SPECIALIZE = \
|
---|
91 | softfloat_raiseFlags$(OBJ) \
|
---|
92 | s_f16UIToCommonNaN$(OBJ) \
|
---|
93 | s_commonNaNToF16UI$(OBJ) \
|
---|
94 | s_propagateNaNF16UI$(OBJ) \
|
---|
95 | s_f32UIToCommonNaN$(OBJ) \
|
---|
96 | s_commonNaNToF32UI$(OBJ) \
|
---|
97 | s_propagateNaNF32UI$(OBJ) \
|
---|
98 | s_f64UIToCommonNaN$(OBJ) \
|
---|
99 | s_commonNaNToF64UI$(OBJ) \
|
---|
100 | s_propagateNaNF64UI$(OBJ) \
|
---|
101 | extF80M_isSignalingNaN$(OBJ) \
|
---|
102 | s_extF80MToCommonNaN$(OBJ) \
|
---|
103 | s_commonNaNToExtF80M$(OBJ) \
|
---|
104 | s_propagateNaNExtF80M$(OBJ) \
|
---|
105 | f128M_isSignalingNaN$(OBJ) \
|
---|
106 | s_f128MToCommonNaN$(OBJ) \
|
---|
107 | s_commonNaNToF128M$(OBJ) \
|
---|
108 | s_propagateNaNF128M$(OBJ) \
|
---|
109 |
|
---|
110 | OBJS_OTHERS = \
|
---|
111 | s_roundToUI32$(OBJ) \
|
---|
112 | s_roundMToUI64$(OBJ) \
|
---|
113 | s_roundToI32$(OBJ) \
|
---|
114 | s_roundMToI64$(OBJ) \
|
---|
115 | s_normSubnormalF16Sig$(OBJ) \
|
---|
116 | s_roundPackToF16$(OBJ) \
|
---|
117 | s_normRoundPackToF16$(OBJ) \
|
---|
118 | s_addMagsF16$(OBJ) \
|
---|
119 | s_subMagsF16$(OBJ) \
|
---|
120 | s_mulAddF16$(OBJ) \
|
---|
121 | s_normSubnormalF32Sig$(OBJ) \
|
---|
122 | s_roundPackToF32$(OBJ) \
|
---|
123 | s_normRoundPackToF32$(OBJ) \
|
---|
124 | s_addMagsF32$(OBJ) \
|
---|
125 | s_subMagsF32$(OBJ) \
|
---|
126 | s_mulAddF32$(OBJ) \
|
---|
127 | s_normSubnormalF64Sig$(OBJ) \
|
---|
128 | s_roundPackToF64$(OBJ) \
|
---|
129 | s_normRoundPackToF64$(OBJ) \
|
---|
130 | s_addMagsF64$(OBJ) \
|
---|
131 | s_subMagsF64$(OBJ) \
|
---|
132 | s_mulAddF64$(OBJ) \
|
---|
133 | s_tryPropagateNaNExtF80M$(OBJ) \
|
---|
134 | s_invalidExtF80M$(OBJ) \
|
---|
135 | s_normExtF80SigM$(OBJ) \
|
---|
136 | s_roundPackMToExtF80M$(OBJ) \
|
---|
137 | s_normRoundPackMToExtF80M$(OBJ) \
|
---|
138 | s_addExtF80M$(OBJ) \
|
---|
139 | s_compareNonnormExtF80M$(OBJ) \
|
---|
140 | s_isNaNF128M$(OBJ) \
|
---|
141 | s_tryPropagateNaNF128M$(OBJ) \
|
---|
142 | s_invalidF128M$(OBJ) \
|
---|
143 | s_shiftNormSigF128M$(OBJ) \
|
---|
144 | s_roundPackMToF128M$(OBJ) \
|
---|
145 | s_normRoundPackMToF128M$(OBJ) \
|
---|
146 | s_addF128M$(OBJ) \
|
---|
147 | s_mulAddF128M$(OBJ) \
|
---|
148 | softfloat_state$(OBJ) \
|
---|
149 | ui32_to_f16$(OBJ) \
|
---|
150 | ui32_to_f32$(OBJ) \
|
---|
151 | ui32_to_f64$(OBJ) \
|
---|
152 | ui32_to_extF80M$(OBJ) \
|
---|
153 | ui32_to_f128M$(OBJ) \
|
---|
154 | ui64_to_f16$(OBJ) \
|
---|
155 | ui64_to_f32$(OBJ) \
|
---|
156 | ui64_to_f64$(OBJ) \
|
---|
157 | ui64_to_extF80M$(OBJ) \
|
---|
158 | ui64_to_f128M$(OBJ) \
|
---|
159 | i32_to_f16$(OBJ) \
|
---|
160 | i32_to_f32$(OBJ) \
|
---|
161 | i32_to_f64$(OBJ) \
|
---|
162 | i32_to_extF80M$(OBJ) \
|
---|
163 | i32_to_f128M$(OBJ) \
|
---|
164 | i64_to_f16$(OBJ) \
|
---|
165 | i64_to_f32$(OBJ) \
|
---|
166 | i64_to_f64$(OBJ) \
|
---|
167 | i64_to_extF80M$(OBJ) \
|
---|
168 | i64_to_f128M$(OBJ) \
|
---|
169 | f16_to_ui32$(OBJ) \
|
---|
170 | f16_to_ui64$(OBJ) \
|
---|
171 | f16_to_i32$(OBJ) \
|
---|
172 | f16_to_i64$(OBJ) \
|
---|
173 | f16_to_ui32_r_minMag$(OBJ) \
|
---|
174 | f16_to_ui64_r_minMag$(OBJ) \
|
---|
175 | f16_to_i32_r_minMag$(OBJ) \
|
---|
176 | f16_to_i64_r_minMag$(OBJ) \
|
---|
177 | f16_to_f32$(OBJ) \
|
---|
178 | f16_to_f64$(OBJ) \
|
---|
179 | f16_to_extF80M$(OBJ) \
|
---|
180 | f16_to_f128M$(OBJ) \
|
---|
181 | f16_roundToInt$(OBJ) \
|
---|
182 | f16_add$(OBJ) \
|
---|
183 | f16_sub$(OBJ) \
|
---|
184 | f16_mul$(OBJ) \
|
---|
185 | f16_mulAdd$(OBJ) \
|
---|
186 | f16_div$(OBJ) \
|
---|
187 | f16_rem$(OBJ) \
|
---|
188 | f16_sqrt$(OBJ) \
|
---|
189 | f16_eq$(OBJ) \
|
---|
190 | f16_le$(OBJ) \
|
---|
191 | f16_lt$(OBJ) \
|
---|
192 | f16_eq_signaling$(OBJ) \
|
---|
193 | f16_le_quiet$(OBJ) \
|
---|
194 | f16_lt_quiet$(OBJ) \
|
---|
195 | f16_isSignalingNaN$(OBJ) \
|
---|
196 | f32_to_ui32$(OBJ) \
|
---|
197 | f32_to_ui64$(OBJ) \
|
---|
198 | f32_to_i32$(OBJ) \
|
---|
199 | f32_to_i64$(OBJ) \
|
---|
200 | f32_to_ui32_r_minMag$(OBJ) \
|
---|
201 | f32_to_ui64_r_minMag$(OBJ) \
|
---|
202 | f32_to_i32_r_minMag$(OBJ) \
|
---|
203 | f32_to_i64_r_minMag$(OBJ) \
|
---|
204 | f32_to_f16$(OBJ) \
|
---|
205 | f32_to_f64$(OBJ) \
|
---|
206 | f32_to_extF80M$(OBJ) \
|
---|
207 | f32_to_f128M$(OBJ) \
|
---|
208 | f32_roundToInt$(OBJ) \
|
---|
209 | f32_add$(OBJ) \
|
---|
210 | f32_sub$(OBJ) \
|
---|
211 | f32_mul$(OBJ) \
|
---|
212 | f32_mulAdd$(OBJ) \
|
---|
213 | f32_div$(OBJ) \
|
---|
214 | f32_rem$(OBJ) \
|
---|
215 | f32_sqrt$(OBJ) \
|
---|
216 | f32_eq$(OBJ) \
|
---|
217 | f32_le$(OBJ) \
|
---|
218 | f32_lt$(OBJ) \
|
---|
219 | f32_eq_signaling$(OBJ) \
|
---|
220 | f32_le_quiet$(OBJ) \
|
---|
221 | f32_lt_quiet$(OBJ) \
|
---|
222 | f32_isSignalingNaN$(OBJ) \
|
---|
223 | f64_to_ui32$(OBJ) \
|
---|
224 | f64_to_ui64$(OBJ) \
|
---|
225 | f64_to_i32$(OBJ) \
|
---|
226 | f64_to_i64$(OBJ) \
|
---|
227 | f64_to_ui32_r_minMag$(OBJ) \
|
---|
228 | f64_to_ui64_r_minMag$(OBJ) \
|
---|
229 | f64_to_i32_r_minMag$(OBJ) \
|
---|
230 | f64_to_i64_r_minMag$(OBJ) \
|
---|
231 | f64_to_f16$(OBJ) \
|
---|
232 | f64_to_f32$(OBJ) \
|
---|
233 | f64_to_extF80M$(OBJ) \
|
---|
234 | f64_to_f128M$(OBJ) \
|
---|
235 | f64_roundToInt$(OBJ) \
|
---|
236 | f64_add$(OBJ) \
|
---|
237 | f64_sub$(OBJ) \
|
---|
238 | f64_mul$(OBJ) \
|
---|
239 | f64_mulAdd$(OBJ) \
|
---|
240 | f64_div$(OBJ) \
|
---|
241 | f64_rem$(OBJ) \
|
---|
242 | f64_sqrt$(OBJ) \
|
---|
243 | f64_eq$(OBJ) \
|
---|
244 | f64_le$(OBJ) \
|
---|
245 | f64_lt$(OBJ) \
|
---|
246 | f64_eq_signaling$(OBJ) \
|
---|
247 | f64_le_quiet$(OBJ) \
|
---|
248 | f64_lt_quiet$(OBJ) \
|
---|
249 | f64_isSignalingNaN$(OBJ) \
|
---|
250 | extF80M_to_ui32$(OBJ) \
|
---|
251 | extF80M_to_ui64$(OBJ) \
|
---|
252 | extF80M_to_i32$(OBJ) \
|
---|
253 | extF80M_to_i64$(OBJ) \
|
---|
254 | extF80M_to_ui32_r_minMag$(OBJ) \
|
---|
255 | extF80M_to_ui64_r_minMag$(OBJ) \
|
---|
256 | extF80M_to_i32_r_minMag$(OBJ) \
|
---|
257 | extF80M_to_i64_r_minMag$(OBJ) \
|
---|
258 | extF80M_to_f16$(OBJ) \
|
---|
259 | extF80M_to_f32$(OBJ) \
|
---|
260 | extF80M_to_f64$(OBJ) \
|
---|
261 | extF80M_to_f128M$(OBJ) \
|
---|
262 | extF80M_roundToInt$(OBJ) \
|
---|
263 | extF80M_add$(OBJ) \
|
---|
264 | extF80M_sub$(OBJ) \
|
---|
265 | extF80M_mul$(OBJ) \
|
---|
266 | extF80M_div$(OBJ) \
|
---|
267 | extF80M_rem$(OBJ) \
|
---|
268 | extF80M_sqrt$(OBJ) \
|
---|
269 | extF80M_eq$(OBJ) \
|
---|
270 | extF80M_le$(OBJ) \
|
---|
271 | extF80M_lt$(OBJ) \
|
---|
272 | extF80M_eq_signaling$(OBJ) \
|
---|
273 | extF80M_le_quiet$(OBJ) \
|
---|
274 | extF80M_lt_quiet$(OBJ) \
|
---|
275 | f128M_to_ui32$(OBJ) \
|
---|
276 | f128M_to_ui64$(OBJ) \
|
---|
277 | f128M_to_i32$(OBJ) \
|
---|
278 | f128M_to_i64$(OBJ) \
|
---|
279 | f128M_to_ui32_r_minMag$(OBJ) \
|
---|
280 | f128M_to_ui64_r_minMag$(OBJ) \
|
---|
281 | f128M_to_i32_r_minMag$(OBJ) \
|
---|
282 | f128M_to_i64_r_minMag$(OBJ) \
|
---|
283 | f128M_to_f16$(OBJ) \
|
---|
284 | f128M_to_f32$(OBJ) \
|
---|
285 | f128M_to_f64$(OBJ) \
|
---|
286 | f128M_to_extF80M$(OBJ) \
|
---|
287 | f128M_roundToInt$(OBJ) \
|
---|
288 | f128M_add$(OBJ) \
|
---|
289 | f128M_sub$(OBJ) \
|
---|
290 | f128M_mul$(OBJ) \
|
---|
291 | f128M_mulAdd$(OBJ) \
|
---|
292 | f128M_div$(OBJ) \
|
---|
293 | f128M_rem$(OBJ) \
|
---|
294 | f128M_sqrt$(OBJ) \
|
---|
295 | f128M_eq$(OBJ) \
|
---|
296 | f128M_le$(OBJ) \
|
---|
297 | f128M_lt$(OBJ) \
|
---|
298 | f128M_eq_signaling$(OBJ) \
|
---|
299 | f128M_le_quiet$(OBJ) \
|
---|
300 | f128M_lt_quiet$(OBJ) \
|
---|
301 |
|
---|
302 | OBJS_ALL = $(OBJS_PRIMITIVES) $(OBJS_SPECIALIZE) $(OBJS_OTHERS)
|
---|
303 |
|
---|
304 | $(OBJS_ALL): \
|
---|
305 | $(OTHER_HEADERS) platform.h $(SOURCE_DIR)/include/primitiveTypes.h \
|
---|
306 | $(SOURCE_DIR)/include/primitives.h
|
---|
307 | $(OBJS_SPECIALIZE) $(OBJS_OTHERS): \
|
---|
308 | $(SOURCE_DIR)/include/softfloat_types.h $(SOURCE_DIR)/include/internals.h \
|
---|
309 | $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/specialize.h \
|
---|
310 | $(SOURCE_DIR)/include/softfloat.h
|
---|
311 |
|
---|
312 | $(OBJS_PRIMITIVES) $(OBJS_OTHERS): %$(OBJ): $(SOURCE_DIR)/%.c
|
---|
313 | $(COMPILE_C) $(SOURCE_DIR)/$*.c
|
---|
314 |
|
---|
315 | $(OBJS_SPECIALIZE): %$(OBJ): $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/%.c
|
---|
316 | $(COMPILE_C) $(SOURCE_DIR)/$(SPECIALIZE_TYPE)/$*.c
|
---|
317 |
|
---|
318 | softfloat$(LIB): $(OBJS_ALL)
|
---|
319 | $(DELETE) $@
|
---|
320 | $(MAKELIB) $^
|
---|
321 |
|
---|
322 | .PHONY: clean
|
---|
323 | clean:
|
---|
324 | $(DELETE) $(OBJS_ALL) softfloat$(LIB)
|
---|
325 |
|
---|