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