From cb5087cd7403acf31ac24ac4be8e019a51904895 Mon Sep 17 00:00:00 2001 From: John Hauser Date: Fri, 22 Jul 2016 18:03:04 -0700 Subject: [PATCH] Release 3b. See "doc/SoftFloat-history.html". --- COPYING.txt | 10 +- README.html | 10 +- README.md | 14 +- README.txt | 4 +- build/Linux-386-GCC/Makefile | 60 ++++- build/Linux-386-GCC/platform.h | 10 +- build/Linux-386-SSE2-GCC/Makefile | 60 ++++- build/Linux-386-SSE2-GCC/platform.h | 10 +- build/Linux-x86_64-GCC/Makefile | 64 ++++- build/Linux-x86_64-GCC/platform.h | 10 +- build/Win32-MinGW/Makefile | 60 ++++- build/Win32-MinGW/platform.h | 10 +- build/Win32-SSE2-MinGW/Makefile | 60 ++++- build/Win32-SSE2-MinGW/platform.h | 10 +- build/Win64-MinGW-w64/Makefile | 64 ++++- build/Win64-MinGW-w64/platform.h | 10 +- build/template-FAST_INT64/Makefile | 64 ++++- build/template-FAST_INT64/platform.h | 10 +- build/template-not-FAST_INT64/Makefile | 60 ++++- build/template-not-FAST_INT64/platform.h | 10 +- doc/SoftFloat-history.html | 31 ++- doc/SoftFloat-source.html | 99 +++++--- doc/SoftFloat.html | 145 ++++++----- source/8086-SSE/extF80M_isSignalingNaN.c | 2 +- source/8086-SSE/f128M_isSignalingNaN.c | 2 +- source/8086-SSE/s_commonNaNToExtF80M.c | 2 +- source/8086-SSE/s_commonNaNToExtF80UI.c | 2 +- source/8086-SSE/s_commonNaNToF128M.c | 2 +- source/8086-SSE/s_commonNaNToF128UI.c | 2 +- source/8086-SSE/s_commonNaNToF16UI.c | 51 ++++ source/8086-SSE/s_commonNaNToF32UI.c | 2 +- source/8086-SSE/s_commonNaNToF64UI.c | 2 +- source/8086-SSE/s_extF80MToCommonNaN.c | 2 +- source/8086-SSE/s_extF80UIToCommonNaN.c | 2 +- source/8086-SSE/s_f128MToCommonNaN.c | 2 +- source/8086-SSE/s_f128UIToCommonNaN.c | 2 +- source/8086-SSE/s_f16UIToCommonNaN.c | 59 +++++ source/8086-SSE/s_f32UIToCommonNaN.c | 2 +- source/8086-SSE/s_f64UIToCommonNaN.c | 2 +- source/8086-SSE/s_propagateNaNExtF80M.c | 2 +- source/8086-SSE/s_propagateNaNExtF80UI.c | 2 +- source/8086-SSE/s_propagateNaNF128M.c | 2 +- source/8086-SSE/s_propagateNaNF128UI.c | 2 +- source/8086-SSE/s_propagateNaNF16UI.c | 63 +++++ source/8086-SSE/s_propagateNaNF32UI.c | 2 +- source/8086-SSE/s_propagateNaNF64UI.c | 2 +- source/8086-SSE/softfloat_raiseFlags.c | 2 +- source/8086-SSE/specialize.h | 41 +++- source/8086/extF80M_isSignalingNaN.c | 2 +- source/8086/f128M_isSignalingNaN.c | 2 +- source/8086/s_commonNaNToExtF80M.c | 2 +- source/8086/s_commonNaNToExtF80UI.c | 2 +- source/8086/s_commonNaNToF128M.c | 2 +- source/8086/s_commonNaNToF128UI.c | 2 +- source/8086/s_commonNaNToF16UI.c | 51 ++++ source/8086/s_commonNaNToF32UI.c | 2 +- source/8086/s_commonNaNToF64UI.c | 2 +- source/8086/s_extF80MToCommonNaN.c | 2 +- source/8086/s_extF80UIToCommonNaN.c | 2 +- source/8086/s_f128MToCommonNaN.c | 2 +- source/8086/s_f128UIToCommonNaN.c | 2 +- source/8086/s_f16UIToCommonNaN.c | 59 +++++ source/8086/s_f32UIToCommonNaN.c | 2 +- source/8086/s_f64UIToCommonNaN.c | 2 +- source/8086/s_propagateNaNExtF80M.c | 2 +- source/8086/s_propagateNaNExtF80UI.c | 2 +- source/8086/s_propagateNaNF128M.c | 2 +- source/8086/s_propagateNaNF128UI.c | 2 +- source/8086/s_propagateNaNF16UI.c | 84 +++++++ source/8086/s_propagateNaNF32UI.c | 2 +- source/8086/s_propagateNaNF64UI.c | 2 +- source/8086/softfloat_raiseFlags.c | 2 +- source/8086/specialize.h | 41 +++- source/RISCV/extF80M_isSignalingNaN.c | 2 +- source/RISCV/f128M_isSignalingNaN.c | 2 +- source/RISCV/s_commonNaNToExtF80M.c | 2 +- source/RISCV/s_commonNaNToExtF80UI.c | 2 +- source/RISCV/s_commonNaNToF128M.c | 2 +- source/RISCV/s_commonNaNToF128UI.c | 2 +- source/RISCV/s_commonNaNToF16UI.c | 1 + source/RISCV/s_f16UIToCommonNaN.c | 1 + source/RISCV/s_propagateNaNExtF80M.c | 2 +- source/RISCV/s_propagateNaNExtF80UI.c | 2 +- source/RISCV/s_propagateNaNF128M.c | 2 +- source/RISCV/s_propagateNaNF128UI.c | 2 +- source/RISCV/s_propagateNaNF16UI.c | 58 +++++ source/RISCV/s_propagateNaNF32UI.c | 2 +- source/RISCV/s_propagateNaNF64UI.c | 2 +- source/RISCV/softfloat_raiseFlags.c | 2 +- source/RISCV/specialize.h | 63 +++-- source/extF80M_add.c | 2 +- source/extF80M_div.c | 14 +- source/extF80M_eq.c | 2 +- source/extF80M_eq_signaling.c | 2 +- source/extF80M_le.c | 2 +- source/extF80M_le_quiet.c | 2 +- source/extF80M_lt.c | 2 +- source/extF80M_lt_quiet.c | 2 +- source/extF80M_mul.c | 2 +- source/extF80M_rem.c | 2 +- source/extF80M_roundToInt.c | 2 +- source/extF80M_sqrt.c | 2 +- source/extF80M_sub.c | 2 +- source/extF80M_to_f128M.c | 2 +- source/extF80M_to_f16.c | 112 +++++++++ source/extF80M_to_f32.c | 10 +- source/extF80M_to_f64.c | 12 +- source/extF80M_to_i32.c | 4 +- source/extF80M_to_i32_r_minMag.c | 2 +- source/extF80M_to_i64.c | 2 +- source/extF80M_to_i64_r_minMag.c | 2 +- source/extF80M_to_ui32.c | 4 +- source/extF80M_to_ui32_r_minMag.c | 2 +- source/extF80M_to_ui64.c | 2 +- source/extF80M_to_ui64_r_minMag.c | 2 +- source/extF80_add.c | 2 +- source/extF80_div.c | 2 +- source/extF80_eq.c | 2 +- source/extF80_eq_signaling.c | 2 +- source/extF80_isSignalingNaN.c | 2 +- source/extF80_le.c | 2 +- source/extF80_le_quiet.c | 2 +- source/extF80_lt.c | 2 +- source/extF80_lt_quiet.c | 2 +- source/extF80_mul.c | 2 +- source/extF80_rem.c | 8 +- source/extF80_roundToInt.c | 2 +- source/extF80_sqrt.c | 10 +- source/extF80_sub.c | 2 +- source/extF80_to_f128.c | 16 +- source/extF80_to_f16.c | 96 ++++++++ source/extF80_to_f32.c | 16 +- source/extF80_to_f64.c | 16 +- source/extF80_to_i32.c | 4 +- source/extF80_to_i32_r_minMag.c | 2 +- source/extF80_to_i64.c | 2 +- source/extF80_to_i64_r_minMag.c | 2 +- source/extF80_to_ui32.c | 4 +- source/extF80_to_ui32_r_minMag.c | 2 +- source/extF80_to_ui64.c | 2 +- source/extF80_to_ui64_r_minMag.c | 2 +- source/f128M_add.c | 2 +- source/f128M_div.c | 2 +- source/f128M_eq.c | 2 +- source/f128M_eq_signaling.c | 2 +- source/f128M_le.c | 2 +- source/f128M_le_quiet.c | 2 +- source/f128M_lt.c | 2 +- source/f128M_lt_quiet.c | 2 +- source/f128M_mul.c | 14 +- source/f128M_mulAdd.c | 2 +- source/f128M_rem.c | 2 +- source/f128M_roundToInt.c | 2 +- source/f128M_sqrt.c | 2 +- source/f128M_sub.c | 2 +- source/f128M_to_extF80M.c | 2 +- source/f128M_to_f16.c | 113 +++++++++ source/f128M_to_f32.c | 30 ++- source/f128M_to_f64.c | 34 ++- source/f128M_to_i32.c | 4 +- source/f128M_to_i32_r_minMag.c | 2 +- source/f128M_to_i64.c | 2 +- source/f128M_to_i64_r_minMag.c | 2 +- source/f128M_to_ui32.c | 4 +- source/f128M_to_ui32_r_minMag.c | 2 +- source/f128M_to_ui64.c | 2 +- source/f128M_to_ui64_r_minMag.c | 2 +- source/f128_add.c | 2 +- source/f128_div.c | 2 +- source/f128_eq.c | 2 +- source/f128_eq_signaling.c | 2 +- source/f128_isSignalingNaN.c | 2 +- source/f128_le.c | 2 +- source/f128_le_quiet.c | 2 +- source/f128_lt.c | 2 +- source/f128_lt_quiet.c | 2 +- source/f128_mul.c | 2 +- source/f128_mulAdd.c | 2 +- source/f128_rem.c | 8 +- source/f128_roundToInt.c | 2 +- source/f128_sqrt.c | 12 +- source/f128_sub.c | 2 +- source/f128_to_extF80.c | 42 ++-- source/f128_to_f16.c | 95 ++++++++ source/f128_to_f32.c | 30 ++- source/f128_to_f64.c | 34 ++- source/f128_to_i32.c | 4 +- source/f128_to_i32_r_minMag.c | 2 +- source/f128_to_i64.c | 2 +- source/f128_to_i64_r_minMag.c | 2 +- source/f128_to_ui32.c | 4 +- source/f128_to_ui32_r_minMag.c | 2 +- source/f128_to_ui64.c | 2 +- source/f128_to_ui64_r_minMag.c | 2 +- source/f16_add.c | 70 ++++++ source/f16_div.c | 186 +++++++++++++++ source/f16_eq.c | 66 +++++ source/f16_eq_signaling.c | 61 +++++ source/f16_isSignalingNaN.c | 51 ++++ source/f16_le.c | 66 +++++ source/f16_le_quiet.c | 71 ++++++ source/f16_lt.c | 66 +++++ source/f16_lt_quiet.c | 71 ++++++ source/f16_mul.c | 140 +++++++++++ source/f16_mulAdd.c | 60 +++++ source/f16_rem.c | 171 +++++++++++++ source/f16_roundToInt.c | 111 +++++++++ source/f16_sqrt.c | 136 +++++++++++ source/f16_sub.c | 70 ++++++ source/f16_to_extF80.c | 101 ++++++++ source/f16_to_extF80M.c | 111 +++++++++ source/f16_to_f128.c | 96 ++++++++ source/f16_to_f128M.c | 112 +++++++++ source/f16_to_f32.c | 93 ++++++++ source/f16_to_f64.c | 93 ++++++++ source/f16_to_i32.c | 87 +++++++ source/f16_to_i32_r_minMag.c | 88 +++++++ source/f16_to_i64.c | 87 +++++++ source/f16_to_i64_r_minMag.c | 88 +++++++ source/f16_to_ui32.c | 84 +++++++ source/f16_to_ui32_r_minMag.c | 87 +++++++ source/f16_to_ui64.c | 84 +++++++ source/f16_to_ui64_r_minMag.c | 87 +++++++ source/f32_add.c | 22 +- source/f32_div.c | 2 +- source/f32_eq.c | 2 +- source/f32_eq_signaling.c | 2 +- source/f32_isSignalingNaN.c | 2 +- source/f32_le.c | 2 +- source/f32_le_quiet.c | 2 +- source/f32_lt.c | 2 +- source/f32_lt_quiet.c | 2 +- source/f32_mul.c | 20 +- source/f32_mulAdd.c | 2 +- source/f32_rem.c | 2 +- source/f32_roundToInt.c | 2 +- source/f32_sqrt.c | 10 +- source/f32_sub.c | 22 +- source/f32_to_extF80.c | 28 ++- source/f32_to_extF80M.c | 36 +-- source/f32_to_f128.c | 28 ++- source/f32_to_f128M.c | 36 ++- source/f32_to_f16.c | 88 +++++++ source/f32_to_f64.c | 28 ++- source/f32_to_i32.c | 4 +- source/f32_to_i32_r_minMag.c | 2 +- source/f32_to_i64.c | 2 +- source/f32_to_i64_r_minMag.c | 2 +- source/f32_to_ui32.c | 4 +- source/f32_to_ui32_r_minMag.c | 2 +- source/f32_to_ui64.c | 2 +- source/f32_to_ui64_r_minMag.c | 2 +- source/f64_add.c | 2 +- source/f64_div.c | 2 +- source/f64_eq.c | 2 +- source/f64_eq_signaling.c | 2 +- source/f64_isSignalingNaN.c | 2 +- source/f64_le.c | 2 +- source/f64_le_quiet.c | 2 +- source/f64_lt.c | 2 +- source/f64_lt_quiet.c | 2 +- source/f64_mul.c | 2 +- source/f64_mulAdd.c | 2 +- source/f64_rem.c | 2 +- source/f64_roundToInt.c | 2 +- source/f64_sqrt.c | 2 +- source/f64_sub.c | 2 +- source/f64_to_extF80.c | 28 ++- source/f64_to_extF80M.c | 28 ++- source/f64_to_f128.c | 34 ++- source/f64_to_f128M.c | 22 +- source/f64_to_f16.c | 88 +++++++ source/f64_to_f32.c | 28 ++- source/f64_to_i32.c | 4 +- source/f64_to_i32_r_minMag.c | 2 +- source/f64_to_i64.c | 2 +- source/f64_to_i64_r_minMag.c | 2 +- source/f64_to_ui32.c | 4 +- source/f64_to_ui32_r_minMag.c | 2 +- source/f64_to_ui64.c | 2 +- source/f64_to_ui64_r_minMag.c | 2 +- source/i32_to_extF80.c | 14 +- source/i32_to_extF80M.c | 14 +- source/i32_to_f128.c | 12 +- source/i32_to_f128M.c | 14 +- source/i32_to_f16.c | 71 ++++++ source/i32_to_f32.c | 2 +- source/i32_to_f64.c | 12 +- source/i64_to_extF80.c | 14 +- source/i64_to_extF80M.c | 14 +- source/i64_to_f128.c | 18 +- source/i64_to_f128M.c | 20 +- source/i64_to_f16.c | 70 ++++++ source/i64_to_f32.c | 24 +- source/i64_to_f64.c | 2 +- source/include/internals.h | 38 ++- source/include/primitiveTypes.h | 2 +- source/include/primitives.h | 291 ++++++++++++----------- source/include/softfloat.h | 64 ++++- source/include/softfloat_types.h | 19 +- source/s_add128.c | 2 +- source/s_add256M.c | 6 +- source/s_addCarryM.c | 6 +- source/s_addComplCarryM.c | 6 +- source/s_addExtF80M.c | 2 +- source/s_addF128M.c | 2 +- source/s_addM.c | 6 +- source/s_addMagsExtF80.c | 2 +- source/s_addMagsF128.c | 2 +- source/s_addMagsF16.c | 178 ++++++++++++++ source/s_addMagsF32.c | 39 ++- source/s_addMagsF64.c | 45 ++-- source/s_approxRecip32_1.c | 33 ++- source/s_approxRecipSqrt32_1.c | 34 ++- source/s_approxRecipSqrt_1Ks.c | 49 ++++ source/s_approxRecip_1Ks.c | 49 ++++ source/s_compare128M.c | 2 +- source/s_compare96M.c | 2 +- source/s_compareNonnormExtF80M.c | 2 +- source/s_countLeadingZeros16.c | 60 +++++ source/s_countLeadingZeros32.c | 2 +- source/s_countLeadingZeros64.c | 2 +- source/s_countLeadingZeros8.c | 2 +- source/s_eq128.c | 2 +- source/s_invalidExtF80M.c | 2 +- source/s_invalidF128M.c | 2 +- source/s_isNaNF128M.c | 8 +- source/s_le128.c | 2 +- source/s_lt128.c | 2 +- source/s_mul128By32.c | 2 +- source/s_mul128MTo256M.c | 22 +- source/s_mul128To256M.c | 2 +- source/s_mul64ByShifted32To128.c | 2 +- source/s_mul64To128.c | 2 +- source/s_mul64To128M.c | 2 +- source/s_mulAddF128.c | 59 +++-- source/s_mulAddF128M.c | 12 +- source/s_mulAddF16.c | 226 ++++++++++++++++++ source/s_mulAddF32.c | 46 +++- source/s_mulAddF64.c | 60 ++--- source/s_negXM.c | 2 +- source/s_normExtF80SigM.c | 14 +- source/s_normRoundPackMToExtF80M.c | 22 +- source/s_normRoundPackMToF128M.c | 22 +- source/s_normRoundPackToExtF80.c | 16 +- source/s_normRoundPackToF128.c | 21 +- source/s_normRoundPackToF16.c | 58 +++++ source/s_normRoundPackToF32.c | 18 +- source/s_normRoundPackToF64.c | 18 +- source/s_normSubnormalExtF80Sig.c | 14 +- source/s_normSubnormalF128Sig.c | 26 +- source/s_normSubnormalF128SigM.c | 20 +- source/s_normSubnormalF16Sig.c | 52 ++++ source/s_normSubnormalF32Sig.c | 14 +- source/s_normSubnormalF64Sig.c | 14 +- source/s_remStepMBy32.c | 17 +- source/s_roundPackMToExtF80M.c | 2 +- source/s_roundPackMToF128M.c | 2 +- source/s_roundPackMToI64.c | 2 +- source/s_roundPackMToUI64.c | 2 +- source/s_roundPackToExtF80.c | 2 +- source/s_roundPackToF128.c | 2 +- source/s_roundPackToF16.c | 91 +++++++ source/s_roundPackToF32.c | 10 +- source/s_roundPackToF64.c | 9 +- source/s_roundPackToI32.c | 16 +- source/s_roundPackToI64.c | 2 +- source/s_roundPackToUI32.c | 16 +- source/s_roundPackToUI64.c | 2 +- source/s_shiftLeftM.c | 40 ++-- source/s_shiftNormSigF128M.c | 14 +- source/s_shiftRightJam128.c | 24 +- source/s_shiftRightJam128Extra.c | 28 +-- source/s_shiftRightJam256M.c | 60 ++--- source/s_shiftRightJam32.c | 9 +- source/s_shiftRightJam64.c | 9 +- source/s_shiftRightJam64Extra.c | 14 +- source/s_shiftRightJamM.c | 46 ++-- source/s_shiftRightM.c | 40 ++-- source/s_shortShiftLeft128.c | 10 +- source/s_shortShiftLeft64To96M.c | 10 +- source/s_shortShiftLeftM.c | 16 +- source/s_shortShiftRight128.c | 10 +- source/s_shortShiftRightExtendM.c | 14 +- source/s_shortShiftRightJam128.c | 16 +- source/s_shortShiftRightJam128Extra.c | 16 +- source/s_shortShiftRightJam64.c | 8 +- source/s_shortShiftRightJam64Extra.c | 10 +- source/s_shortShiftRightJamM.c | 18 +- source/s_shortShiftRightM.c | 16 +- source/s_sub128.c | 2 +- source/s_sub1XM.c | 2 +- source/s_sub256M.c | 2 +- source/s_subM.c | 2 +- source/s_subMagsExtF80.c | 8 +- source/s_subMagsF128.c | 8 +- source/s_subMagsF16.c | 182 ++++++++++++++ source/s_subMagsF32.c | 128 ++++++---- source/s_subMagsF64.c | 120 ++++++---- source/s_tryPropagateNaNExtF80M.c | 2 +- source/s_tryPropagateNaNF128M.c | 2 +- source/softfloat_state.c | 18 +- source/ui32_to_extF80.c | 14 +- source/ui32_to_extF80M.c | 14 +- source/ui32_to_f128.c | 12 +- source/ui32_to_f128M.c | 14 +- source/ui32_to_f16.c | 65 +++++ source/ui32_to_f32.c | 2 +- source/ui32_to_f64.c | 13 +- source/ui64_to_extF80.c | 14 +- source/ui64_to_extF80M.c | 14 +- source/ui64_to_f128.c | 18 +- source/ui64_to_f128M.c | 21 +- source/ui64_to_f16.c | 64 +++++ source/ui64_to_f32.c | 22 +- source/ui64_to_f64.c | 2 +- 416 files changed, 7535 insertions(+), 1670 deletions(-) create mode 100644 source/8086-SSE/s_commonNaNToF16UI.c create mode 100644 source/8086-SSE/s_f16UIToCommonNaN.c create mode 100644 source/8086-SSE/s_propagateNaNF16UI.c create mode 100644 source/8086/s_commonNaNToF16UI.c create mode 100644 source/8086/s_f16UIToCommonNaN.c create mode 100644 source/8086/s_propagateNaNF16UI.c create mode 100644 source/RISCV/s_commonNaNToF16UI.c create mode 100644 source/RISCV/s_f16UIToCommonNaN.c create mode 100644 source/RISCV/s_propagateNaNF16UI.c create mode 100644 source/extF80M_to_f16.c create mode 100644 source/extF80_to_f16.c create mode 100644 source/f128M_to_f16.c create mode 100644 source/f128_to_f16.c create mode 100644 source/f16_add.c create mode 100644 source/f16_div.c create mode 100644 source/f16_eq.c create mode 100644 source/f16_eq_signaling.c create mode 100644 source/f16_isSignalingNaN.c create mode 100644 source/f16_le.c create mode 100644 source/f16_le_quiet.c create mode 100644 source/f16_lt.c create mode 100644 source/f16_lt_quiet.c create mode 100644 source/f16_mul.c create mode 100644 source/f16_mulAdd.c create mode 100644 source/f16_rem.c create mode 100644 source/f16_roundToInt.c create mode 100644 source/f16_sqrt.c create mode 100644 source/f16_sub.c create mode 100644 source/f16_to_extF80.c create mode 100644 source/f16_to_extF80M.c create mode 100644 source/f16_to_f128.c create mode 100644 source/f16_to_f128M.c create mode 100644 source/f16_to_f32.c create mode 100644 source/f16_to_f64.c create mode 100644 source/f16_to_i32.c create mode 100644 source/f16_to_i32_r_minMag.c create mode 100644 source/f16_to_i64.c create mode 100644 source/f16_to_i64_r_minMag.c create mode 100644 source/f16_to_ui32.c create mode 100644 source/f16_to_ui32_r_minMag.c create mode 100644 source/f16_to_ui64.c create mode 100644 source/f16_to_ui64_r_minMag.c create mode 100644 source/f32_to_f16.c create mode 100644 source/f64_to_f16.c create mode 100644 source/i32_to_f16.c create mode 100644 source/i64_to_f16.c create mode 100644 source/s_addMagsF16.c create mode 100644 source/s_approxRecipSqrt_1Ks.c create mode 100644 source/s_approxRecip_1Ks.c create mode 100644 source/s_countLeadingZeros16.c create mode 100644 source/s_mulAddF16.c create mode 100644 source/s_normRoundPackToF16.c create mode 100644 source/s_normSubnormalF16Sig.c create mode 100644 source/s_roundPackToF16.c create mode 100644 source/s_subMagsF16.c create mode 100644 source/ui32_to_f16.c create mode 100644 source/ui64_to_f16.c diff --git a/COPYING.txt b/COPYING.txt index 869e6da..d718ab6 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -1,14 +1,14 @@ -License for Berkeley SoftFloat Release 3a +License for Berkeley SoftFloat Release 3b John R. Hauser -2015 October 23 +2016 July 22 -The following applies to the whole of SoftFloat Release 3a as well as to +The following applies to the whole of SoftFloat Release 3b as well as to each source file individually. -Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of -California. All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.html b/README.html index ec64db7..ea7bbd3 100644 --- a/README.html +++ b/README.html @@ -7,11 +7,11 @@ -

Package Overview for Berkeley SoftFloat Release 3a

+

Package Overview for Berkeley SoftFloat Release 3b

John R. Hauser
-2015 October 23
+2016 July 22

@@ -29,15 +29,15 @@ The SoftFloat package is documented in the following files in the

- + - + - +
SoftFloat.htmlSoftFloat.html Documentation for using the SoftFloat functions.
SoftFloat-source.htmlSoftFloat-source.html Documentation for building SoftFloat.
SoftFloat-history.html   SoftFloat-history.html    History of the major changes to SoftFloat.
diff --git a/README.md b/README.md index 3a28440..246a6e7 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -Package Overview for Berkeley SoftFloat Release 3a +Package Overview for Berkeley SoftFloat Release 3b ================================================== John R. Hauser
-2015 October 23 +2016 July 22 Berkeley SoftFloat is a software implementation of binary floating-point -that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat -is distributed in the form of C source code. Building the SoftFloat sources +that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat +is distributed in the form of C source code. Building the SoftFloat sources generates a library file (typically `softfloat.a` or `libsoftfloat.a`) containing the floating-point subroutines. @@ -16,9 +16,9 @@ containing the floating-point subroutines. The SoftFloat package is documented in the following files in the `doc` subdirectory: -* [SoftFloat.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat.html) Documentation for using the SoftFloat functions. -* [SoftFloat-source.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat-source.html) Documentation for building SoftFloat. -* [SoftFloat-history.html](http://www.jhauser.us/arithmetic/SoftFloat-3a/doc/SoftFloat-history.html) History of the major changes to SoftFloat. +* [SoftFloat.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat.html) Documentation for using the SoftFloat functions. +* [SoftFloat-source.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat-source.html) Documentation for building SoftFloat. +* [SoftFloat-history.html](http://www.jhauser.us/arithmetic/SoftFloat-3b/doc/SoftFloat-history.html) History of the major changes to SoftFloat. Other files in the package comprise the source code for SoftFloat. diff --git a/README.txt b/README.txt index 0011b11..25fd181 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ -Package Overview for Berkeley SoftFloat Release 3a +Package Overview for Berkeley SoftFloat Release 3b John R. Hauser -2015 October 23 +2016 July 22 Berkeley SoftFloat is a software implementation of binary floating-point that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat diff --git a/build/Linux-386-GCC/Makefile b/build/Linux-386-GCC/Makefile index e21067e..a1be83e 100644 --- a/build/Linux-386-GCC/Makefile +++ b/build/Linux-386-GCC/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086 +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086 -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJamM$(OBJ) \ s_shiftRightM$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_addM$(OBJ) \ @@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \ s_subM$(OBJ) \ s_mul64To128M$(OBJ) \ s_mul128MTo256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ s_remStepMBy32$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -102,6 +109,12 @@ OBJS_OTHERS = \ s_roundPackMToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackMToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -130,22 +143,53 @@ OBJS_OTHERS = \ s_addF128M$(OBJ) \ s_mulAddF128M$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -154,6 +198,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80M$(OBJ) \ f32_to_f128M$(OBJ) \ @@ -180,6 +225,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80M$(OBJ) \ f64_to_f128M$(OBJ) \ @@ -206,6 +252,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -230,6 +277,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_f64$(OBJ) \ f128M_to_extF80M$(OBJ) \ diff --git a/build/Linux-386-GCC/platform.h b/build/Linux-386-GCC/platform.h index b3e4720..fadcc25 100644 --- a/build/Linux-386-GCC/platform.h +++ b/build/Linux-386-GCC/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/Linux-386-SSE2-GCC/Makefile b/build/Linux-386-SSE2-GCC/Makefile index b0435c5..0b9a0aa 100644 --- a/build/Linux-386-SSE2-GCC/Makefile +++ b/build/Linux-386-SSE2-GCC/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086-SSE +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086-SSE -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJamM$(OBJ) \ s_shiftRightM$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_addM$(OBJ) \ @@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \ s_subM$(OBJ) \ s_mul64To128M$(OBJ) \ s_mul128MTo256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ s_remStepMBy32$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -102,6 +109,12 @@ OBJS_OTHERS = \ s_roundPackMToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackMToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -130,22 +143,53 @@ OBJS_OTHERS = \ s_addF128M$(OBJ) \ s_mulAddF128M$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -154,6 +198,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80M$(OBJ) \ f32_to_f128M$(OBJ) \ @@ -180,6 +225,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80M$(OBJ) \ f64_to_f128M$(OBJ) \ @@ -206,6 +252,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -230,6 +277,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_f64$(OBJ) \ f128M_to_extF80M$(OBJ) \ diff --git a/build/Linux-386-SSE2-GCC/platform.h b/build/Linux-386-SSE2-GCC/platform.h index b3e4720..fadcc25 100644 --- a/build/Linux-386-SSE2-GCC/platform.h +++ b/build/Linux-386-SSE2-GCC/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/Linux-x86_64-GCC/Makefile b/build/Linux-x86_64-GCC/Makefile index 9996139..9c9fd7b 100644 --- a/build/Linux-x86_64-GCC/Makefile +++ b/build/Linux-x86_64-GCC/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086-SSE +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086-SSE -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -69,6 +70,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJam128Extra$(OBJ) \ s_shiftRightJam256M$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_add128$(OBJ) \ @@ -79,11 +81,16 @@ OBJS_PRIMITIVES = \ s_mul64To128$(OBJ) \ s_mul128By32$(OBJ) \ s_mul128To256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -104,6 +111,12 @@ OBJS_OTHERS = \ s_roundPackToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -128,30 +141,63 @@ OBJS_OTHERS = \ s_subMagsF128$(OBJ) \ s_mulAddF128$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -160,6 +206,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80$(OBJ) \ f32_to_extF80M$(OBJ) \ @@ -188,6 +235,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80$(OBJ) \ f64_to_extF80M$(OBJ) \ @@ -216,6 +264,7 @@ OBJS_OTHERS = \ extF80_to_ui64_r_minMag$(OBJ) \ extF80_to_i32_r_minMag$(OBJ) \ extF80_to_i64_r_minMag$(OBJ) \ + extF80_to_f16$(OBJ) \ extF80_to_f32$(OBJ) \ extF80_to_f64$(OBJ) \ extF80_to_f128$(OBJ) \ @@ -241,6 +290,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -265,6 +315,7 @@ OBJS_OTHERS = \ f128_to_ui64_r_minMag$(OBJ) \ f128_to_i32_r_minMag$(OBJ) \ f128_to_i64_r_minMag$(OBJ) \ + f128_to_f16$(OBJ) \ f128_to_f32$(OBJ) \ f128_to_extF80$(OBJ) \ f128_to_f64$(OBJ) \ @@ -291,6 +342,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_extF80M$(OBJ) \ f128M_to_f64$(OBJ) \ diff --git a/build/Linux-x86_64-GCC/platform.h b/build/Linux-x86_64-GCC/platform.h index b3e4720..fadcc25 100644 --- a/build/Linux-x86_64-GCC/platform.h +++ b/build/Linux-x86_64-GCC/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/Win32-MinGW/Makefile b/build/Win32-MinGW/Makefile index e21067e..a1be83e 100644 --- a/build/Win32-MinGW/Makefile +++ b/build/Win32-MinGW/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086 +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086 -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJamM$(OBJ) \ s_shiftRightM$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_addM$(OBJ) \ @@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \ s_subM$(OBJ) \ s_mul64To128M$(OBJ) \ s_mul128MTo256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ s_remStepMBy32$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -102,6 +109,12 @@ OBJS_OTHERS = \ s_roundPackMToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackMToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -130,22 +143,53 @@ OBJS_OTHERS = \ s_addF128M$(OBJ) \ s_mulAddF128M$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -154,6 +198,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80M$(OBJ) \ f32_to_f128M$(OBJ) \ @@ -180,6 +225,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80M$(OBJ) \ f64_to_f128M$(OBJ) \ @@ -206,6 +252,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -230,6 +277,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_f64$(OBJ) \ f128M_to_extF80M$(OBJ) \ diff --git a/build/Win32-MinGW/platform.h b/build/Win32-MinGW/platform.h index b3e4720..fadcc25 100644 --- a/build/Win32-MinGW/platform.h +++ b/build/Win32-MinGW/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/Win32-SSE2-MinGW/Makefile b/build/Win32-SSE2-MinGW/Makefile index b0435c5..0b9a0aa 100644 --- a/build/Win32-SSE2-MinGW/Makefile +++ b/build/Win32-SSE2-MinGW/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086-SSE +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086-SSE -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJamM$(OBJ) \ s_shiftRightM$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_addM$(OBJ) \ @@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \ s_subM$(OBJ) \ s_mul64To128M$(OBJ) \ s_mul128MTo256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ s_remStepMBy32$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -102,6 +109,12 @@ OBJS_OTHERS = \ s_roundPackMToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackMToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -130,22 +143,53 @@ OBJS_OTHERS = \ s_addF128M$(OBJ) \ s_mulAddF128M$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -154,6 +198,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80M$(OBJ) \ f32_to_f128M$(OBJ) \ @@ -180,6 +225,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80M$(OBJ) \ f64_to_f128M$(OBJ) \ @@ -206,6 +252,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -230,6 +277,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_f64$(OBJ) \ f128M_to_extF80M$(OBJ) \ diff --git a/build/Win32-SSE2-MinGW/platform.h b/build/Win32-SSE2-MinGW/platform.h index b3e4720..fadcc25 100644 --- a/build/Win32-SSE2-MinGW/platform.h +++ b/build/Win32-SSE2-MinGW/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/Win64-MinGW-w64/Makefile b/build/Win64-MinGW-w64/Makefile index 1ca74af..145c03f 100644 --- a/build/Win64-MinGW-w64/Makefile +++ b/build/Win64-MinGW-w64/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile is part of the SoftFloat IEEE Floating-Point Arithmetic -# Package, Release 3a, by John R. Hauser. +# Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -34,10 +34,11 @@ # #============================================================================= -SOURCE_DIR = ../../source -SPECIALIZE_TYPE = 8086-SSE +SOURCE_DIR ?= ../../source +SPECIALIZE_TYPE ?= 8086-SSE -SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +SOFTFLOAT_OPTS ?= \ + -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -69,6 +70,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJam128Extra$(OBJ) \ s_shiftRightJam256M$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_add128$(OBJ) \ @@ -79,11 +81,16 @@ OBJS_PRIMITIVES = \ s_mul64To128$(OBJ) \ s_mul128By32$(OBJ) \ s_mul128To256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -104,6 +111,12 @@ OBJS_OTHERS = \ s_roundPackToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -128,30 +141,63 @@ OBJS_OTHERS = \ s_subMagsF128$(OBJ) \ s_mulAddF128$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -160,6 +206,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80$(OBJ) \ f32_to_extF80M$(OBJ) \ @@ -188,6 +235,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80$(OBJ) \ f64_to_extF80M$(OBJ) \ @@ -216,6 +264,7 @@ OBJS_OTHERS = \ extF80_to_ui64_r_minMag$(OBJ) \ extF80_to_i32_r_minMag$(OBJ) \ extF80_to_i64_r_minMag$(OBJ) \ + extF80_to_f16$(OBJ) \ extF80_to_f32$(OBJ) \ extF80_to_f64$(OBJ) \ extF80_to_f128$(OBJ) \ @@ -241,6 +290,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -265,6 +315,7 @@ OBJS_OTHERS = \ f128_to_ui64_r_minMag$(OBJ) \ f128_to_i32_r_minMag$(OBJ) \ f128_to_i64_r_minMag$(OBJ) \ + f128_to_f16$(OBJ) \ f128_to_f32$(OBJ) \ f128_to_extF80$(OBJ) \ f128_to_f64$(OBJ) \ @@ -291,6 +342,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_extF80M$(OBJ) \ f128M_to_f64$(OBJ) \ diff --git a/build/Win64-MinGW-w64/platform.h b/build/Win64-MinGW-w64/platform.h index b3e4720..fadcc25 100644 --- a/build/Win64-MinGW-w64/platform.h +++ b/build/Win64-MinGW-w64/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -40,5 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*---------------------------------------------------------------------------- *----------------------------------------------------------------------------*/ +#ifdef __GNUC_STDC_INLINE__ +#define INLINE inline +#else #define INLINE extern inline +#endif diff --git a/build/template-FAST_INT64/Makefile b/build/template-FAST_INT64/Makefile index 0f836f9..34673a3 100644 --- a/build/template-FAST_INT64/Makefile +++ b/build/template-FAST_INT64/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile template is part of the SoftFloat IEEE Floating-Point -# Arithmetic Package, Release 3a, by John R. Hauser. +# Arithmetic Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -36,10 +36,11 @@ # Edit lines marked with `==>'. See "SoftFloat-source.html". -==> SOURCE_DIR = ../../source -==> SPECIALIZE_TYPE = 8086 +==> SOURCE_DIR ?= ../../source +==> SPECIALIZE_TYPE ?= 8086 -==> SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +==> SOFTFLOAT_OPTS ?= \ +==> -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 ==> DELETE = rm -f ==> C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -70,6 +71,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJam128Extra$(OBJ) \ s_shiftRightJam256M$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_add128$(OBJ) \ @@ -80,11 +82,16 @@ OBJS_PRIMITIVES = \ s_mul64To128$(OBJ) \ s_mul128By32$(OBJ) \ s_mul128To256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -105,6 +112,12 @@ OBJS_OTHERS = \ s_roundPackToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -129,30 +142,63 @@ OBJS_OTHERS = \ s_subMagsF128$(OBJ) \ s_mulAddF128$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -161,6 +207,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80$(OBJ) \ f32_to_extF80M$(OBJ) \ @@ -189,6 +236,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80$(OBJ) \ f64_to_extF80M$(OBJ) \ @@ -217,6 +265,7 @@ OBJS_OTHERS = \ extF80_to_ui64_r_minMag$(OBJ) \ extF80_to_i32_r_minMag$(OBJ) \ extF80_to_i64_r_minMag$(OBJ) \ + extF80_to_f16$(OBJ) \ extF80_to_f32$(OBJ) \ extF80_to_f64$(OBJ) \ extF80_to_f128$(OBJ) \ @@ -242,6 +291,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -266,6 +316,7 @@ OBJS_OTHERS = \ f128_to_ui64_r_minMag$(OBJ) \ f128_to_i32_r_minMag$(OBJ) \ f128_to_i64_r_minMag$(OBJ) \ + f128_to_f16$(OBJ) \ f128_to_f32$(OBJ) \ f128_to_extF80$(OBJ) \ f128_to_f64$(OBJ) \ @@ -292,6 +343,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_extF80M$(OBJ) \ f128M_to_f64$(OBJ) \ diff --git a/build/template-FAST_INT64/platform.h b/build/template-FAST_INT64/platform.h index f4832d2..2aef589 100644 --- a/build/template-FAST_INT64/platform.h +++ b/build/template-FAST_INT64/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -44,3 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *----------------------------------------------------------------------------*/ ==> #define INLINE inline +/*---------------------------------------------------------------------------- +*----------------------------------------------------------------------------*/ +==> #define THREAD_LOCAL _Thread_local + diff --git a/build/template-not-FAST_INT64/Makefile b/build/template-not-FAST_INT64/Makefile index 3500fdb..2bdc946 100644 --- a/build/template-not-FAST_INT64/Makefile +++ b/build/template-not-FAST_INT64/Makefile @@ -2,10 +2,10 @@ #============================================================================= # # This Makefile template is part of the SoftFloat IEEE Floating-Point -# Arithmetic Package, Release 3a, by John R. Hauser. +# Arithmetic Package, Release 3b, by John R. Hauser. # -# Copyright 2011, 2012, 2013, 2014 The Regents of the University of -# California. All rights reserved. +# Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University +# of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -36,10 +36,11 @@ # Edit lines marked with `==>'. See "SoftFloat-source.html". -==> SOURCE_DIR = ../../source -==> SPECIALIZE_TYPE = 8086 +==> SOURCE_DIR ?= ../../source +==> SPECIALIZE_TYPE ?= 8086 -==> SOFTFLOAT_OPTS = -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV64TO32 +==> SOFTFLOAT_OPTS ?= \ +==> -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 ==> DELETE = rm -f ==> C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include @@ -66,6 +67,7 @@ OBJS_PRIMITIVES = \ s_shiftRightJamM$(OBJ) \ s_shiftRightM$(OBJ) \ s_countLeadingZeros8$(OBJ) \ + s_countLeadingZeros16$(OBJ) \ s_countLeadingZeros32$(OBJ) \ s_countLeadingZeros64$(OBJ) \ s_addM$(OBJ) \ @@ -76,12 +78,17 @@ OBJS_PRIMITIVES = \ s_subM$(OBJ) \ s_mul64To128M$(OBJ) \ s_mul128MTo256M$(OBJ) \ + s_approxRecip_1Ks$(OBJ) \ s_approxRecip32_1$(OBJ) \ + s_approxRecipSqrt_1Ks$(OBJ) \ s_approxRecipSqrt32_1$(OBJ) \ s_remStepMBy32$(OBJ) \ OBJS_SPECIALIZE = \ softfloat_raiseFlags$(OBJ) \ + s_f16UIToCommonNaN$(OBJ) \ + s_commonNaNToF16UI$(OBJ) \ + s_propagateNaNF16UI$(OBJ) \ s_f32UIToCommonNaN$(OBJ) \ s_commonNaNToF32UI$(OBJ) \ s_propagateNaNF32UI$(OBJ) \ @@ -102,6 +109,12 @@ OBJS_OTHERS = \ s_roundPackMToUI64$(OBJ) \ s_roundPackToI32$(OBJ) \ s_roundPackMToI64$(OBJ) \ + s_normSubnormalF16Sig$(OBJ) \ + s_roundPackToF16$(OBJ) \ + s_normRoundPackToF16$(OBJ) \ + s_addMagsF16$(OBJ) \ + s_subMagsF16$(OBJ) \ + s_mulAddF16$(OBJ) \ s_normSubnormalF32Sig$(OBJ) \ s_roundPackToF32$(OBJ) \ s_normRoundPackToF32$(OBJ) \ @@ -130,22 +143,53 @@ OBJS_OTHERS = \ s_addF128M$(OBJ) \ s_mulAddF128M$(OBJ) \ softfloat_state$(OBJ) \ + ui32_to_f16$(OBJ) \ ui32_to_f32$(OBJ) \ ui32_to_f64$(OBJ) \ ui32_to_extF80M$(OBJ) \ ui32_to_f128M$(OBJ) \ + ui64_to_f16$(OBJ) \ ui64_to_f32$(OBJ) \ ui64_to_f64$(OBJ) \ ui64_to_extF80M$(OBJ) \ ui64_to_f128M$(OBJ) \ + i32_to_f16$(OBJ) \ i32_to_f32$(OBJ) \ i32_to_f64$(OBJ) \ i32_to_extF80M$(OBJ) \ i32_to_f128M$(OBJ) \ + i64_to_f16$(OBJ) \ i64_to_f32$(OBJ) \ i64_to_f64$(OBJ) \ i64_to_extF80M$(OBJ) \ i64_to_f128M$(OBJ) \ + f16_to_ui32$(OBJ) \ + f16_to_ui64$(OBJ) \ + f16_to_i32$(OBJ) \ + f16_to_i64$(OBJ) \ + f16_to_ui32_r_minMag$(OBJ) \ + f16_to_ui64_r_minMag$(OBJ) \ + f16_to_i32_r_minMag$(OBJ) \ + f16_to_i64_r_minMag$(OBJ) \ + f16_to_f32$(OBJ) \ + f16_to_f64$(OBJ) \ + f16_to_extF80M$(OBJ) \ + f16_to_f128M$(OBJ) \ + f16_roundToInt$(OBJ) \ + f16_add$(OBJ) \ + f16_sub$(OBJ) \ + f16_mul$(OBJ) \ + f16_mulAdd$(OBJ) \ + f16_div$(OBJ) \ + f16_rem$(OBJ) \ + f16_sqrt$(OBJ) \ + f16_eq$(OBJ) \ + f16_le$(OBJ) \ + f16_lt$(OBJ) \ + f16_eq_signaling$(OBJ) \ + f16_le_quiet$(OBJ) \ + f16_lt_quiet$(OBJ) \ + f16_isSignalingNaN$(OBJ) \ f32_to_ui32$(OBJ) \ f32_to_ui64$(OBJ) \ f32_to_i32$(OBJ) \ @@ -154,6 +198,7 @@ OBJS_OTHERS = \ f32_to_ui64_r_minMag$(OBJ) \ f32_to_i32_r_minMag$(OBJ) \ f32_to_i64_r_minMag$(OBJ) \ + f32_to_f16$(OBJ) \ f32_to_f64$(OBJ) \ f32_to_extF80M$(OBJ) \ f32_to_f128M$(OBJ) \ @@ -180,6 +225,7 @@ OBJS_OTHERS = \ f64_to_ui64_r_minMag$(OBJ) \ f64_to_i32_r_minMag$(OBJ) \ f64_to_i64_r_minMag$(OBJ) \ + f64_to_f16$(OBJ) \ f64_to_f32$(OBJ) \ f64_to_extF80M$(OBJ) \ f64_to_f128M$(OBJ) \ @@ -206,6 +252,7 @@ OBJS_OTHERS = \ extF80M_to_ui64_r_minMag$(OBJ) \ extF80M_to_i32_r_minMag$(OBJ) \ extF80M_to_i64_r_minMag$(OBJ) \ + extF80M_to_f16$(OBJ) \ extF80M_to_f32$(OBJ) \ extF80M_to_f64$(OBJ) \ extF80M_to_f128M$(OBJ) \ @@ -230,6 +277,7 @@ OBJS_OTHERS = \ f128M_to_ui64_r_minMag$(OBJ) \ f128M_to_i32_r_minMag$(OBJ) \ f128M_to_i64_r_minMag$(OBJ) \ + f128M_to_f16$(OBJ) \ f128M_to_f32$(OBJ) \ f128M_to_f64$(OBJ) \ f128M_to_extF80M$(OBJ) \ diff --git a/build/template-not-FAST_INT64/platform.h b/build/template-not-FAST_INT64/platform.h index f4832d2..2aef589 100644 --- a/build/template-not-FAST_INT64/platform.h +++ b/build/template-not-FAST_INT64/platform.h @@ -2,10 +2,10 @@ /*============================================================================ This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic -Package, Release 3a, by John R. Hauser. +Package, Release 3b, by John R. Hauser. -Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. -All rights reserved. +Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of +California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -44,3 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *----------------------------------------------------------------------------*/ ==> #define INLINE inline +/*---------------------------------------------------------------------------- +*----------------------------------------------------------------------------*/ +==> #define THREAD_LOCAL _Thread_local + diff --git a/doc/SoftFloat-history.html b/doc/SoftFloat-history.html index 08cab39..f5f7c91 100644 --- a/doc/SoftFloat-history.html +++ b/doc/SoftFloat-history.html @@ -7,14 +7,41 @@ -

History of Berkeley SoftFloat, to Release 3a

+

History of Berkeley SoftFloat, to Release 3b

John R. Hauser
-2015 October 23
+2016 July 22

+

Release 3b (2016 July)

+ + + +

Release 3a (2015 October)

@@ -418,6 +421,13 @@ For very small microprocessors whose buses and registers are 8-bit or 16-bit in size, this macro should usually not be defined. Whether this macro should be defined for a 32-bit processor may depend on the target machine and the applications that will use SoftFloat. +
SOFTFLOAT_FAST_DIV32TO16 +
+Can be defined to indicate that the target’s division operator +in C (written as /) is reasonably efficient for +dividing a 32-bit unsigned integer by a 16-bit +unsigned integer. +Setting this macro may affect the performance of function f16_div.
SOFTFLOAT_FAST_DIV64TO32
Can be defined to indicate that the target’s division operator @@ -425,7 +435,7 @@ Can be defined to indicate that the target’s division operator dividing a 64-bit unsigned integer by a 32-bit unsigned integer. Setting this macro may affect the performance of division, remainder, and -square root operations. +square root operations other than f16_div.
INLINE_LEVEL
Can be defined to an integer to determine the degree of inlining requested of @@ -443,26 +453,41 @@ inlined. If macro INLINE_LEVEL is defined with a value of 1 or higher, this macro must be defined; otherwise, this macro is ignored and need not be defined. -For some compilers, this macro can be defined as the single keyword +For compilers that conform to the C Standard’s rules for inline +functions, this macro can be defined as the single keyword inline. +For other compilers that follow a convention pre-dating the standardization of +inline, this macro may need to be defined to extern inline. -Historically, the gcc compiler has required that this macro be -defined to extern inline. +
THREAD_LOCAL +
+Can be defined to a sequence of tokens that, when appearing at the start of a +variable declaration, indicates to the C compiler that the variable is +per-thread, meaning that each execution thread gets its own separate +instance of the variable. +This macro is used in header softfloat.h in the declarations of +variables softfloat_roundingMode, +softfloat_detectTininess, extF80_roundingPrecision, +and softfloat_exceptionFlags. +If macro THREAD_LOCAL is left undefined, these variables will +default to being ordinary global variables. +Depending on the compiler, possible valid definitions of this macro include +_Thread_local and __thread.

-Following the usual custom for C, for the first three macros (all -except INLINE_LEVEL and INLINE), the content of any -definition is irrelevant; +Following the usual custom for C, for the first four macros (all +except INLINE_LEVEL, INLINE, and +THREAD_LOCAL), the content of any definition is irrelevant; what matters is a macro’s effect on #ifdef directives.

-It is recommended that any definitions of macros LITTLEENDIAN and -INLINE be made in a build target’s platform.h -header file, because these macros are expected to be determined inflexibly by -the target machine and compiler. +It is recommended that any definitions of macros LITTLEENDIAN, +INLINE, and THREAD_LOCAL be made in a build +target’s platform.h header file, because these macros are +expected to be determined inflexibly by the target machine and compiler. The other three macros control optimization and might be better located in the target’s Makefile (or its equivalent).

@@ -496,7 +521,7 @@ underlying arithmetic operations upon which many of SoftFloat’s floating-point functions are ultimately built. The SoftFloat sources include implementations of all of these functions/macros, written as standard C code, so a complete and correct SoftFloat library can be -built using only the supplied code for all functions. +created using only the supplied code for all functions. However, for many targets, SoftFloat’s performance can be improved by substituting target-specific implementations of some of the functions/macros declared in primitives.h. @@ -505,8 +530,8 @@ declared in primitives.h.

For example, primitives.h declares a function called softfloat_countLeadingZeros32 that takes an unsigned -32-bit integer as an argument and returns the maximal number of -the integer’s most-significant bits that are all zeros. +32-bit integer as an argument and returns the number of the +integer’s most-significant bits that are zeros. While the SoftFloat sources include an implementation of this function written in standard C, many processors can perform this same function directly in only one or two machine instructions. @@ -534,7 +559,7 @@ where <function-name> is the name of the function. This technically defines <function-name> as a macro, but one that resolves to the same name, which may then be a function. -(A preprocessor conforming to the C Standard must limit recursive macro +(A preprocessor that conforms to the C Standard must limit recursive macro expansion from being applied more than once.)

@@ -546,7 +571,7 @@ SoftFloat can be tested using the testsoftfloat program by the same author. This program is part of the Berkeley TestFloat package available at the Web page -http://www.jhauser.us/arithmetic/TestFloat.html. +http://www.jhauser.us/arithmetic/TestFloat.html. The TestFloat package also has a program called timesoftfloat that measures the speed of SoftFloat’s floating-point functions.

@@ -566,10 +591,10 @@ As supplied, softfloat.h depends on another header, softfloat_types.h, that is not intended for public use but which must also be visible to the programmer’s compiler.
  • -More troubling, at the time softfloat.h is included in a C -source file, macro SOFTFLOAT_FAST_INT64 must be defined, or not -defined, consistent with whether this macro was defined when the SoftFloat -library was built. +More troubling, at the time softfloat.h is included in a C source +file, macros SOFTFLOAT_FAST_INT64 and THREAD_LOCAL +must be defined, or not defined, consistent with how these macro were defined +when the SoftFloat library was built. In the situation that new programs may regularly #include header file softfloat.h, it is recommended that a custom, self-contained @@ -582,7 +607,7 @@ version of this header file be created that eliminates these issues.

    At the time of this writing, the most up-to-date information about SoftFloat and the latest release can be found at the Web page -http://www.jhauser.us/arithmetic/SoftFloat.html. +http://www.jhauser.us/arithmetic/SoftFloat.html.

    diff --git a/doc/SoftFloat.html b/doc/SoftFloat.html index 19176dc..b0ae66f 100644 --- a/doc/SoftFloat.html +++ b/doc/SoftFloat.html @@ -7,11 +7,11 @@ -

    Berkeley SoftFloat Release 3a: Library Interface

    +

    Berkeley SoftFloat Release 3b: Library Interface

    John R. Hauser
    -2015 October 23
    +2016 July 22

    @@ -71,9 +71,10 @@ John R. Hauser

    Berkeley SoftFloat is a software implementation of binary floating-point that conforms to the IEEE Standard for Floating-Point Arithmetic. -The current release supports four binary formats: 32-bit -single-precision, 64-bit double-precision, 80-bit -double-extended-precision, and 128-bit quadruple-precision. +The current release supports five binary formats: 16-bit +half-precision, 32-bit single-precision, 64-bit +double-precision, 80-bit double-extended-precision, and +128-bit quadruple-precision. The following functions are supported for each format: