mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
parent
6db9be8900
commit
5a7a0e8518
435 changed files with 4434 additions and 898 deletions
224
CMakeLists.txt
224
CMakeLists.txt
|
|
@ -240,116 +240,116 @@ else()
|
|||
install(TARGETS embedded_lld_elf embedded_lld_coff embedded_lld_mingw embedded_lld_wasm embedded_lld_lib DESTINATION "${ZIG_CPP_LIB_DIR}")
|
||||
endif()
|
||||
|
||||
# No patches have been applied to SoftFloat-3d
|
||||
# No patches have been applied to SoftFloat-3e
|
||||
set(EMBEDDED_SOFTFLOAT_SOURCES
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/f128M_isSignalingNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_commonNaNToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_commonNaNToF32UI.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_commonNaNToF64UI.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_f128MToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_f32UIToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_f64UIToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/s_propagateNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086/softfloat_raiseFlags.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_add.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_div.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_eq.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_eq_signaling.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_le.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_le_quiet.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_lt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_lt_quiet.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_mul.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_mulAdd.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_rem.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_roundToInt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_sqrt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_sub.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_f16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_f32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_f64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_i32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_i32_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_i64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_i64_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_ui32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_ui32_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_ui64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f128M_to_ui64_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f32_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/f64_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_add256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addCarryM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addComplCarryM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addMagsF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addMagsF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_addMagsF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_approxRecip32_1.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_approxRecipSqrt32_1.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_approxRecipSqrt_1Ks.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_approxRecip_1Ks.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_compare128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_compare96M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_countLeadingZeros16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_countLeadingZeros32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_countLeadingZeros64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_countLeadingZeros8.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_eq128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_invalidF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_isNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_le128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_lt128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mul128MTo256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mul64To128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mulAddF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mulAddF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mulAddF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_mulAddF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_negXM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normRoundPackMToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normRoundPackToF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normRoundPackToF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normRoundPackToF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normSubnormalF128SigM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normSubnormalF16Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normSubnormalF32Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_normSubnormalF64Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_remStepMBy32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundMToI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundMToUI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundPackMToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundPackToF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundPackToF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundPackToF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundToI32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundToI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundToUI32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_roundToUI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftLeftM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftNormSigF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftRightJam256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftRightJam32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftRightJam64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftRightJamM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shiftRightM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftLeft64To96M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftLeftM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftRightExtendM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftRightJam64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftRightJamM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_shortShiftRightM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_sub1XM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_sub256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_subM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_subMagsF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_subMagsF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_subMagsF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/s_tryPropagateNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/softfloat_state.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/ui32_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/ui64_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/f128M_isSignalingNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF32UI.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF64UI.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f128MToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f32UIToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f64UIToCommonNaN.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_propagateNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/softfloat_raiseFlags.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_add.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_div.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_eq.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_eq_signaling.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_le.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_le_quiet.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_lt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_lt_quiet.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_mul.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_mulAdd.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_rem.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_roundToInt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_sqrt.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_sub.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i32_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i64_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui32_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui64_r_minMag.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f32_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f64_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_add256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addCarryM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addComplCarryM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecip32_1.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecipSqrt32_1.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecipSqrt_1Ks.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecip_1Ks.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_compare128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_compare96M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros8.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_eq128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_invalidF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_isNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_le128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_lt128.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mul128MTo256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mul64To128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_negXM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackMToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF128SigM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF16Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF32Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF64Sig.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_remStepMBy32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundMToI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundMToUI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackMToF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToI32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToUI32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToUI64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftLeftM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftNormSigF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJamM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftLeft64To96M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftLeftM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightExtendM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightJam64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightJamM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_sub1XM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_sub256M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subM.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF16.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF32.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF64.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_tryPropagateNaNF128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/softfloat_state.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui32_to_f128M.c"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui64_to_f128M.c"
|
||||
)
|
||||
add_library(embedded_softfloat ${EMBEDDED_SOFTFLOAT_SOURCES})
|
||||
if(MSVC)
|
||||
|
|
@ -362,10 +362,10 @@ else()
|
|||
)
|
||||
endif()
|
||||
target_include_directories(embedded_softfloat PUBLIC
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d-prebuilt"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/8086"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e-prebuilt"
|
||||
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086"
|
||||
)
|
||||
include_directories("${CMAKE_SOURCE_DIR}/deps/SoftFloat-3d/source/include")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/include")
|
||||
set(SOFTFLOAT_LIBRARIES embedded_softfloat)
|
||||
|
||||
find_package(Threads)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
License for Berkeley SoftFloat Release 3d
|
||||
License for Berkeley SoftFloat Release 3e
|
||||
|
||||
John R. Hauser
|
||||
2017 August 10
|
||||
2018 January 20
|
||||
|
||||
The following applies to the whole of SoftFloat Release 3d as well as to
|
||||
The following applies to the whole of SoftFloat Release 3e as well as to
|
||||
each source file individually.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the
|
||||
University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
<BODY>
|
||||
|
||||
<H1>Package Overview for Berkeley SoftFloat Release 3d</H1>
|
||||
<H1>Package Overview for Berkeley SoftFloat Release 3e</H1>
|
||||
|
||||
<P>
|
||||
John R. Hauser<BR>
|
||||
2017 August 10<BR>
|
||||
2018 January 20<BR>
|
||||
</P>
|
||||
|
||||
<P>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
Package Overview for Berkeley SoftFloat Release 3d
|
||||
Package Overview for Berkeley SoftFloat Release 3e
|
||||
|
||||
John R. Hauser
|
||||
2017 August 10
|
||||
2018 January 20
|
||||
|
||||
Berkeley SoftFloat is a software implementation of binary floating-point
|
||||
that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat
|
||||
|
|
@ -7,14 +7,57 @@
|
|||
|
||||
<BODY>
|
||||
|
||||
<H1>History of Berkeley SoftFloat, to Release 3d</H1>
|
||||
<H1>History of Berkeley SoftFloat, to Release 3e</H1>
|
||||
|
||||
<P>
|
||||
John R. Hauser<BR>
|
||||
2017 August 10<BR>
|
||||
2018 January 20<BR>
|
||||
</P>
|
||||
|
||||
|
||||
<H3>Release 3e (2018 January)</H3>
|
||||
|
||||
<UL>
|
||||
|
||||
<LI>
|
||||
Changed the default numeric code for optional rounding mode <CODE>odd</CODE>
|
||||
(round to odd, also known as <EM>jamming</EM>) from 5 to 6.
|
||||
|
||||
<LI>
|
||||
Modified the behavior of rounding mode <CODE>odd</CODE> when rounding to an
|
||||
integer value (either conversion to an integer format or a
|
||||
‘<CODE>roundToInt</CODE>’ function).
|
||||
Previously, for those cases only, rounding mode <CODE>odd</CODE> acted the same
|
||||
as rounding to minimum magnitude.
|
||||
Now all operations are rounded consistently.
|
||||
|
||||
<LI>
|
||||
Fixed some errors in the specialization code modeling Intel x86 floating-point,
|
||||
specifically the integers returned on invalid operations and the propagation of
|
||||
NaN payloads in a few rare cases.
|
||||
|
||||
<LI>
|
||||
Added specialization code modeling ARM floating-point, conforming to VFPv2 or
|
||||
later.
|
||||
|
||||
<LI>
|
||||
Added an example target for ARM processors.
|
||||
|
||||
<LI>
|
||||
Fixed a minor bug whereby function <CODE>f16_to_ui64</CODE> might return a
|
||||
different integer than expected in the case that the floating-point operand is
|
||||
negative.
|
||||
|
||||
<LI>
|
||||
Added example target-specific optimization for GCC, employing GCC instrinsics
|
||||
and support for <NOBR>128-bit</NOBR> integer arithmetic.
|
||||
|
||||
<LI>
|
||||
Made other minor improvements.
|
||||
|
||||
</UL>
|
||||
|
||||
|
||||
<H3>Release 3d (2017 August)</H3>
|
||||
|
||||
<UL>
|
||||
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
<BODY>
|
||||
|
||||
<H1>Berkeley SoftFloat Release 3d: Source Documentation</H1>
|
||||
<H1>Berkeley SoftFloat Release 3e: Source Documentation</H1>
|
||||
|
||||
<P>
|
||||
John R. Hauser<BR>
|
||||
2017 August 10<BR>
|
||||
2018 January 20<BR>
|
||||
</P>
|
||||
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ SoftFloat has been successfully compiled with the GNU C Compiler
|
|||
<NOBR>Release 2</NOBR> or earlier.
|
||||
Changes to the interface of SoftFloat functions are documented in
|
||||
<A HREF="SoftFloat.html"><NOBR><CODE>SoftFloat.html</CODE></NOBR></A>.
|
||||
The current version of SoftFloat is <NOBR>Release 3d</NOBR>.
|
||||
The current version of SoftFloat is <NOBR>Release 3e</NOBR>.
|
||||
</P>
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ and <CODE><stdint.h></CODE></I>.
|
|||
The SoftFloat package was written by me, <NOBR>John R.</NOBR> Hauser.
|
||||
<NOBR>Release 3</NOBR> of SoftFloat was a completely new implementation
|
||||
supplanting earlier releases.
|
||||
The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3d</NOBR>) was
|
||||
The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3e</NOBR>) was
|
||||
done in the employ of the University of California, Berkeley, within the
|
||||
Department of Electrical Engineering and Computer Sciences, first for the
|
||||
Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab.
|
||||
|
|
@ -148,12 +148,12 @@ Oracle, and Samsung.
|
|||
</P>
|
||||
|
||||
<P>
|
||||
The following applies to the whole of SoftFloat <NOBR>Release 3d</NOBR> as well
|
||||
The following applies to the whole of SoftFloat <NOBR>Release 3e</NOBR> as well
|
||||
as to each source file individually.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the
|
||||
University of California.
|
||||
All rights reserved.
|
||||
</P>
|
||||
|
|
@ -215,12 +215,15 @@ source
|
|||
include
|
||||
8086
|
||||
8086-SSE
|
||||
ARM-VFPv2
|
||||
ARM-VFPv2-defaultNaN
|
||||
build
|
||||
template-FAST_INT64
|
||||
template-not-FAST_INT64
|
||||
Linux-386-GCC
|
||||
Linux-386-SSE2-GCC
|
||||
Linux-x86_64-GCC
|
||||
Linux-ARM-VFPv2-GCC
|
||||
Win32-MinGW
|
||||
Win32-SSE2-MinGW
|
||||
Win64-MinGW-w64
|
||||
|
|
@ -228,20 +231,37 @@ build
|
|||
</BLOCKQUOTE>
|
||||
The majority of the SoftFloat sources are provided in the <CODE>source</CODE>
|
||||
directory.
|
||||
The <CODE>include</CODE> subdirectory of <CODE>source</CODE> contains several
|
||||
header files (unsurprisingly), while the <CODE>8086</CODE> and
|
||||
<NOBR><CODE>8086-SSE</CODE></NOBR> subdirectories contain source files that
|
||||
specialize the floating-point behavior to match the Intel x86 line of
|
||||
processors.
|
||||
The files in directory <CODE>8086</CODE> give floating-point behavior
|
||||
consistent solely with Intel’s older, 8087-derived floating-point, while
|
||||
those in <NOBR><CODE>8086-SSE</CODE></NOBR> update the behavior of the
|
||||
non-extended formats (<CODE>float16_t</CODE>, <CODE>float32_t</CODE>,
|
||||
<CODE>float64_t</CODE>, and <CODE>float128_t</CODE>) to mirror Intel’s
|
||||
more recent Streaming SIMD Extensions (SSE) and other compatible extensions.
|
||||
The <CODE>include</CODE> subdirectory contains several header files
|
||||
(unsurprisingly), while the other subdirectories of <CODE>source</CODE> contain
|
||||
source files that specialize the floating-point behavior to match particular
|
||||
processor families:
|
||||
<BLOCKQUOTE>
|
||||
<DL>
|
||||
<DT><CODE>8086</CODE></DT>
|
||||
<DD>
|
||||
Intel’s older, 8087-derived floating-point, extended to all supported
|
||||
floating-point types
|
||||
</DD>
|
||||
<DT><CODE>8086-SSE</CODE></DT>
|
||||
<DD>
|
||||
Intel’s x86 processors with Streaming SIMD Extensions (SSE) and later
|
||||
compatible extensions, having 8087 behavior for <NOBR>80-bit</NOBR>
|
||||
double-extended-precision (<CODE>extFloat80_t</CODE>) and SSE behavior for
|
||||
other floating-point types
|
||||
</DD>
|
||||
<DT><CODE>ARM-VFPv2</CODE></DT>
|
||||
<DD>
|
||||
ARM’s VFPv2 or later floating-point, with NaN payload propagation
|
||||
</DD>
|
||||
<DT><CODE>ARM-VFPv2-defaultNaN</CODE></DT>
|
||||
<DD>
|
||||
ARM’s VFPv2 or later floating-point, with the “default NaN”
|
||||
option
|
||||
</DD>
|
||||
</DL>
|
||||
</BLOCKQUOTE>
|
||||
If other specializations are attempted, these would be expected to be other
|
||||
subdirectories of <CODE>source</CODE> alongside <CODE>8086</CODE> and
|
||||
<NOBR><CODE>8086-SSE</CODE></NOBR>.
|
||||
subdirectories of <CODE>source</CODE> alongside the ones listed above.
|
||||
Specialization is covered later, in <NOBR>section 5.2</NOBR>, <I>Specializing
|
||||
Floating-Point Behavior</I>.
|
||||
</P>
|
||||
|
|
@ -264,19 +284,20 @@ are intended to follow a naming system of
|
|||
For the example targets,
|
||||
<NOBR><CODE><<I>execution-environment</I>></CODE></NOBR> is
|
||||
<NOBR><CODE>Linux-386</CODE></NOBR>, <NOBR><CODE>Linux-386-SSE2</CODE></NOBR>,
|
||||
<NOBR><CODE>Linux-x86_64</CODE></NOBR>, <CODE>Win32</CODE>,
|
||||
<NOBR><CODE>Linux-x86_64</CODE></NOBR>,
|
||||
<NOBR><CODE>Linux-ARM-VFPv2</CODE></NOBR>, <CODE>Win32</CODE>,
|
||||
<NOBR><CODE>Win32-SSE2</CODE></NOBR>, or <CODE>Win64</CODE>, and
|
||||
<NOBR><CODE><<I>compiler</I>></CODE></NOBR> is <CODE>GCC</CODE>,
|
||||
<CODE>MinGW</CODE>, or <NOBR><CODE>MinGW-w64</CODE></NOBR>.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
At the current time, all of the supplied target directories are merely examples
|
||||
that may or may not be correct for compiling on any particular system.
|
||||
All of the supplied target directories are merely examples that may or may not
|
||||
be correct for compiling on any particular system.
|
||||
Despite requests, there are currently no plans to include and maintain in the
|
||||
SoftFloat package the build files needed for a great many users’
|
||||
compilation environments, which after all can span a broad range of operating
|
||||
systems, compilers, and other tools.
|
||||
compilation environments, which can span a huge range of operating systems,
|
||||
compilers, and other tools.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
|
|
@ -402,8 +423,8 @@ A new build target may use an existing specialization, such as the ones
|
|||
provided by the <CODE>8086</CODE> and <NOBR><CODE>8086-SSE</CODE></NOBR>
|
||||
subdirectories.
|
||||
If a build target needs a new specialization, different from any existing ones,
|
||||
it is recommended that a new specialization subdirectory be created in the
|
||||
<CODE>source</CODE> directory for this purpose.
|
||||
it is recommended that a new specialization directory be created for this
|
||||
purpose.
|
||||
The <CODE>specialize.h</CODE> header file from any of the provided
|
||||
specialization subdirectories can be used as a model for what definitions are
|
||||
needed.
|
||||
|
|
@ -577,8 +598,40 @@ function.
|
|||
This technically defines <NOBR><CODE><<I>function-name</I>></CODE></NOBR>
|
||||
as a macro, but one that resolves to the same name, which may then be a
|
||||
function.
|
||||
(A preprocessor that conforms to the C Standard must limit recursive macro
|
||||
expansion from being applied more than once.)
|
||||
(A preprocessor that conforms to the C Standard is required to limit recursive
|
||||
macro expansion from being applied more than once.)
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The supplied header file <CODE>opts-GCC.h</CODE> (in directory
|
||||
<CODE>source/include</CODE>) provides an example of target-specific
|
||||
optimization for the GCC compiler.
|
||||
Each GCC target example in the <CODE>build</CODE> directory has
|
||||
<BLOCKQUOTE>
|
||||
<CODE>#include "opts-GCC.h"</CODE>
|
||||
</BLOCKQUOTE>
|
||||
in its <CODE>platform.h</CODE> header file.
|
||||
Before <CODE>opts-GCC.h</CODE> is included, the following macros must be
|
||||
defined (or not) to control which features are invoked:
|
||||
<BLOCKQUOTE>
|
||||
<DL>
|
||||
<DT><CODE>SOFTFLOAT_BUILTIN_CLZ</CODE></DT>
|
||||
<DD>
|
||||
If defined, SoftFloat’s internal
|
||||
‘<CODE>countLeadingZeros</CODE>’ functions use intrinsics
|
||||
<CODE>__builtin_clz</CODE> and <CODE>__builtin_clzll</CODE>.
|
||||
</DD>
|
||||
<DT><CODE>SOFTFLOAT_INTRINSIC_INT128</CODE></DT>
|
||||
<DD>
|
||||
If defined, SoftFloat makes use of GCC’s nonstandard <NOBR>128-bit</NOBR>
|
||||
integer type <CODE>__int128</CODE>.
|
||||
</DD>
|
||||
</DL>
|
||||
</BLOCKQUOTE>
|
||||
On some machines, these improvements are observed to increase the speeds of
|
||||
<CODE>f64_mul</CODE> and <CODE>f128_mul</CODE> by around 20 to 25%, although
|
||||
other functions receive less dramatic boosts, or none at all.
|
||||
Results can vary greatly across different platforms.
|
||||
</P>
|
||||
|
||||
|
||||
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
<BODY>
|
||||
|
||||
<H1>Berkeley SoftFloat Release 3d: Library Interface</H1>
|
||||
<H1>Berkeley SoftFloat Release 3e: Library Interface</H1>
|
||||
|
||||
<P>
|
||||
John R. Hauser<BR>
|
||||
2017 August 10<BR>
|
||||
2018 January 20<BR>
|
||||
</P>
|
||||
|
||||
|
||||
|
|
@ -106,13 +106,20 @@ Information about the standard is available elsewhere.
|
|||
</P>
|
||||
|
||||
<P>
|
||||
The current version of SoftFloat is <NOBR>Release 3d</NOBR>.
|
||||
This release fixes bugs that were found in the square root functions for the
|
||||
<NOBR>64-bit</NOBR>, <NOBR>80-bit</NOBR>, and <NOBR>128-bit</NOBR>
|
||||
floating-point formats.
|
||||
The current version of SoftFloat is <NOBR>Release 3e</NOBR>.
|
||||
This release modifies the behavior of the rarely used <I>odd</I> rounding mode
|
||||
(<I>round to odd</I>, also known as <I>jamming</I>), and also adds some new
|
||||
specialization and optimization examples for those compiling SoftFloat.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The previous <NOBR>Release 3d</NOBR> fixed bugs that were found in the square
|
||||
root functions for the <NOBR>64-bit</NOBR>, <NOBR>80-bit</NOBR>, and
|
||||
<NOBR>128-bit</NOBR> floating-point formats.
|
||||
(Thanks to Alexei Sibidanov at the University of Victoria for reporting an
|
||||
incorrect result.)
|
||||
The bugs affected all prior <NOBR>Release-3</NOBR> versions of SoftFloat.
|
||||
The bugs affected all prior <NOBR>Release-3</NOBR> versions of SoftFloat
|
||||
<NOBR>through 3c</NOBR>.
|
||||
The flaw in the <NOBR>64-bit</NOBR> floating-point square root function was of
|
||||
very minor impact, causing a <NOBR>1-ulp</NOBR> error (<NOBR>1 unit</NOBR> in
|
||||
the last place) a few times out of a billion.
|
||||
|
|
@ -124,13 +131,8 @@ wrong.
|
|||
</P>
|
||||
|
||||
<P>
|
||||
<NOBR>Release 3d</NOBR> makes no changes to the SoftFloat library interface
|
||||
compared to the previous <NOBR>Release 3c</NOBR>.
|
||||
Since the original <NOBR>Release 3</NOBR>, the main changes to the interface
|
||||
have been that <NOBR>Release 3b</NOBR> added support for the
|
||||
<NOBR>16-bit</NOBR> half-precision format, and <NOBR>Release 3c</NOBR> added
|
||||
optional support for a rarely used rounding mode, <I>round to odd</I>, also
|
||||
known as <I>jamming</I>.
|
||||
Among earlier releases, 3b was notable for adding support for the
|
||||
<NOBR>16-bit</NOBR> half-precision format.
|
||||
For more about the evolution of SoftFloat releases, see
|
||||
<A HREF="SoftFloat-history.html"><NOBR><CODE>SoftFloat-history.html</CODE></NOBR></A>.
|
||||
</P>
|
||||
|
|
@ -169,7 +171,7 @@ strictly required.
|
|||
<P>
|
||||
Most operations not required by the original 1985 version of the IEEE
|
||||
Floating-Point Standard but added in the 2008 version are not yet supported in
|
||||
SoftFloat <NOBR>Release 3d</NOBR>.
|
||||
SoftFloat <NOBR>Release 3e</NOBR>.
|
||||
</P>
|
||||
|
||||
|
||||
|
|
@ -179,7 +181,7 @@ SoftFloat <NOBR>Release 3d</NOBR>.
|
|||
The SoftFloat package was written by me, <NOBR>John R.</NOBR> Hauser.
|
||||
<NOBR>Release 3</NOBR> of SoftFloat was a completely new implementation
|
||||
supplanting earlier releases.
|
||||
The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3d</NOBR>) was
|
||||
The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3e</NOBR>) was
|
||||
done in the employ of the University of California, Berkeley, within the
|
||||
Department of Electrical Engineering and Computer Sciences, first for the
|
||||
Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab.
|
||||
|
|
@ -213,12 +215,12 @@ Oracle, and Samsung.
|
|||
</P>
|
||||
|
||||
<P>
|
||||
The following applies to the whole of SoftFloat <NOBR>Release 3d</NOBR> as well
|
||||
The following applies to the whole of SoftFloat <NOBR>Release 3e</NOBR> as well
|
||||
as to each source file individually.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the
|
||||
University of California.
|
||||
All rights reserved.
|
||||
</P>
|
||||
|
|
@ -395,7 +397,7 @@ comparisons between two values in the same floating-point format.
|
|||
|
||||
<P>
|
||||
The following operations required by the 2008 IEEE Floating-Point Standard are
|
||||
not supported in SoftFloat <NOBR>Release 3d</NOBR>:
|
||||
not supported in SoftFloat <NOBR>Release 3e</NOBR>:
|
||||
<UL>
|
||||
<LI>
|
||||
<B>nextUp</B>, <B>nextDown</B>, <B>minNum</B>, <B>maxNum</B>, <B>minNumMag</B>,
|
||||
|
|
@ -445,8 +447,8 @@ exponent must both be zero.
|
|||
</P>
|
||||
|
||||
<P>
|
||||
SoftFloat's functions are not guaranteed to operate as expected when inputs of
|
||||
type <CODE>extFloat80_t</CODE> are non-canonical.
|
||||
SoftFloat’s functions are not guaranteed to operate as expected when
|
||||
inputs of type <CODE>extFloat80_t</CODE> are non-canonical.
|
||||
Assuming all of a function’s <CODE>extFloat80_t</CODE> inputs (if any)
|
||||
are canonical, function outputs of type <CODE>extFloat80_t</CODE> will always
|
||||
be canonical.
|
||||
|
|
@ -591,16 +593,15 @@ Variable <CODE>softfloat_roundingMode</CODE> is initialized to
|
|||
</P>
|
||||
|
||||
<P>
|
||||
If supported, mode <CODE>softfloat_round_odd</CODE> first rounds a
|
||||
floating-point result to minimum magnitude, the same as
|
||||
When <CODE>softfloat_round_odd</CODE> is the rounding mode for a function that
|
||||
rounds to an integer value (either conversion to an integer format or a
|
||||
‘<CODE>roundToInt</CODE>’ function), if the input is not already an
|
||||
integer, the rounded result is the closest <EM>odd</EM> integer.
|
||||
For other operations, this rounding mode acts as though the floating-point
|
||||
result is first rounded to minimum magnitude, the same as
|
||||
<CODE>softfloat_round_minMag</CODE>, and then, if the result is inexact, the
|
||||
least-significant bit of the result is set <NOBR>to 1</NOBR>.
|
||||
This rounding mode is also known as <EM>jamming</EM>.
|
||||
As a special case, when <CODE>softfloat_round_odd</CODE> is the rounding mode
|
||||
for a function that rounds to an integer value (either conversion to an integer
|
||||
format or a ‘<CODE>roundToInt</CODE>’ function), rounding is the
|
||||
same as <CODE>softfloat_round_minMag</CODE>, without any change to the
|
||||
least-significant integer bit.
|
||||
Rounding to odd is also known as <EM>jamming</EM>.
|
||||
</P>
|
||||
|
||||
<H3>6.2. Underflow Detection</H3>
|
||||
|
|
@ -820,12 +821,6 @@ The <CODE><I>roundingMode</I></CODE> argument specifies the rounding mode for
|
|||
the conversion.
|
||||
The variable that usually indicates rounding mode,
|
||||
<CODE>softfloat_roundingMode</CODE>, is ignored.
|
||||
If <CODE><I>roundingMode</I></CODE> is <CODE>softfloat_round_odd</CODE>,
|
||||
rounding is to minimum magnitude, the same as
|
||||
<CODE>softfloat_round_minMag</CODE>, rather than to an odd integer.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Argument <CODE><I>exact</I></CODE> determines whether the <I>inexact</I>
|
||||
exception flag is raised if the conversion is not exact.
|
||||
If <CODE><I>exact</I></CODE> is <CODE>true</CODE>, the <I>inexact</I> flag may
|
||||
|
|
@ -1087,12 +1082,6 @@ The <CODE><I>roundingMode</I></CODE> argument specifies the rounding mode to
|
|||
apply.
|
||||
The variable that usually indicates rounding mode,
|
||||
<CODE>softfloat_roundingMode</CODE>, is ignored.
|
||||
If <CODE><I>roundingMode</I></CODE> is <CODE>softfloat_round_odd</CODE>,
|
||||
rounding is to minimum magnitude, the same as
|
||||
<CODE>softfloat_round_minMag</CODE>, rather than to an odd integer value.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Argument <CODE><I>exact</I></CODE> determines whether the <I>inexact</I>
|
||||
exception flag is raised if the conversion is not exact.
|
||||
If <CODE><I>exact</I></CODE> is <CODE>true</CODE>, the <I>inexact</I> flag may
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
|
|
@ -90,8 +90,8 @@ struct uint128
|
|||
uiMagB64 = uiB64 & 0x7FFF;
|
||||
if ( uiMagA64 < uiMagB64 ) goto returnB;
|
||||
if ( uiMagB64 < uiMagA64 ) goto returnA;
|
||||
if ( uiNonsigA0 < uiNonsigB0 ) goto returnB;
|
||||
if ( uiNonsigB0 < uiNonsigA0 ) goto returnA;
|
||||
if ( uiA0 < uiB0 ) goto returnB;
|
||||
if ( uiB0 < uiA0 ) goto returnA;
|
||||
if ( uiA64 < uiB64 ) goto returnA;
|
||||
returnB:
|
||||
uiZ.v64 = uiB64;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2018 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:
|
||||
|
|
@ -39,10 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "softfloat_types.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Default value for `softfloat_detectTininess'.
|
||||
| Default value for 'softfloat_detectTininess'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define init_detectTininess softfloat_tininess_afterRounding
|
||||
|
||||
|
|
@ -51,22 +52,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui32_fromPosOverflow 0xFFFFFFFF
|
||||
#define ui32_fromNegOverflow 0
|
||||
#define ui32_fromNegOverflow 0xFFFFFFFF
|
||||
#define ui32_fromNaN 0xFFFFFFFF
|
||||
#define i32_fromPosOverflow 0x7FFFFFFF
|
||||
#define i32_fromPosOverflow (-0x7FFFFFFF - 1)
|
||||
#define i32_fromNegOverflow (-0x7FFFFFFF - 1)
|
||||
#define i32_fromNaN 0x7FFFFFFF
|
||||
#define i32_fromNaN (-0x7FFFFFFF - 1)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The values to return on conversions to 64-bit integer formats that raise an
|
||||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui64_fromPosOverflow UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define ui64_fromNegOverflow 0
|
||||
#define ui64_fromNegOverflow UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define ui64_fromNaN UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define i64_fromPosOverflow UINT64_C( 0x7FFFFFFFFFFFFFFF )
|
||||
#define i64_fromNegOverflow (-UINT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNaN UINT64_C( 0x7FFFFFFFFFFFFFFF )
|
||||
#define i64_fromPosOverflow (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNegOverflow (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNaN (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| "Common NaN" structure, used to transfer NaN representations from one format
|
||||
|
|
@ -87,30 +88,30 @@ struct commonNaN {
|
|||
#define defaultNaNF16UI 0xFE00
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 16-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 16-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 16-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF16UI( uiA ) ((((uiA) & 0x7E00) == 0x7C00) && ((uiA) & 0x01FF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 16-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 16-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t softfloat_commonNaNToF16UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 16-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 16-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t
|
||||
|
|
@ -122,30 +123,30 @@ uint_fast16_t
|
|||
#define defaultNaNF32UI 0xFFC00000
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 32-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 32-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 32-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF32UI( uiA ) ((((uiA) & 0x7FC00000) == 0x7F800000) && ((uiA) & 0x003FFFFF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 32-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 32-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 32-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 32-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t
|
||||
|
|
@ -157,30 +158,30 @@ uint_fast32_t
|
|||
#define defaultNaNF64UI UINT64_C( 0xFFF8000000000000 )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 64-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 64-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 64-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF64UI( uiA ) ((((uiA) & UINT64_C( 0x7FF8000000000000 )) == UINT64_C( 0x7FF0000000000000 )) && ((uiA) & UINT64_C( 0x0007FFFFFFFFFFFF )))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 64-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 64-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t softfloat_commonNaNToF64UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 64-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 64-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t
|
||||
|
|
@ -194,7 +195,7 @@ uint_fast64_t
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 80-bit unsigned integer formed from concatenating
|
||||
| 16-bit `uiA64' and 64-bit `uiA0' has the bit pattern of an 80-bit extended
|
||||
| 16-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of an 80-bit extended
|
||||
| floating-point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
@ -203,15 +204,15 @@ uint_fast64_t
|
|||
#ifdef SOFTFLOAT_FAST_INT64
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when `SOFTFLOAT_FAST_INT64' is
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating `uiA64' and `uiA0'
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of an 80-bit extended floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -219,16 +220,16 @@ void
|
|||
uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into an 80-bit extended
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and returns the bit pattern of this value as an unsigned
|
||||
| integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
|
|
@ -250,17 +251,17 @@ struct uint128
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 128-bit unsigned integer formed from concatenating
|
||||
| 64-bit `uiA64' and 64-bit `uiA0' has the bit pattern of a 128-bit floating-
|
||||
| 64-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of a 128-bit floating-
|
||||
| point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF128UI( uiA64, uiA0 ) ((((uiA64) & UINT64_C( 0x7FFF800000000000 )) == UINT64_C( 0x7FFF000000000000 )) && ((uiA0) || ((uiA64) & UINT64_C( 0x00007FFFFFFFFFFF ))))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating `uiA64' and `uiA0'
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of a 128-bit floating-point NaN, converts this NaN to
|
||||
| the common NaN form, and stores the resulting common NaN at the location
|
||||
| pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -268,15 +269,15 @@ void
|
|||
uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 128-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN * );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
|
|
@ -293,14 +294,14 @@ struct uint128
|
|||
#else
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when `SOFTFLOAT_FAST_INT64' is not
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is not
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 80-bit extended floating-point value pointed to by `aSPtr' is
|
||||
| Assuming the 80-bit extended floating-point value pointed to by 'aSPtr' is
|
||||
| a NaN, converts this NaN to the common NaN form, and stores the resulting
|
||||
| common NaN at the location pointed to by `zPtr'. If the NaN is a signaling
|
||||
| common NaN at the location pointed to by 'zPtr'. If the NaN is a signaling
|
||||
| NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -308,9 +309,9 @@ void
|
|||
const struct extFloat80M *aSPtr, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into an 80-bit extended
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and stores this NaN at the location pointed to by
|
||||
| `zSPtr'.
|
||||
| 'zSPtr'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
|
|
@ -318,8 +319,8 @@ void
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 80-bit extended floating-point values
|
||||
| pointed to by `aSPtr' and `bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by `zSPtr'. If either original floating-point
|
||||
| pointed to by 'aSPtr' and 'bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by 'zSPtr'. If either original floating-point
|
||||
| value is a signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -338,10 +339,10 @@ void
|
|||
#define defaultNaNF128UI0 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 128-bit floating-point value pointed to by `aWPtr' is a NaN,
|
||||
| Assuming the 128-bit floating-point value pointed to by 'aWPtr' is a NaN,
|
||||
| converts this NaN to the common NaN form, and stores the resulting common
|
||||
| NaN at the location pointed to by `zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument `aWPtr' points to an array of
|
||||
| NaN at the location pointed to by 'zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument 'aWPtr' points to an array of
|
||||
| four 32-bit elements that concatenate in the platform's normal endian order
|
||||
| to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
@ -349,9 +350,9 @@ void
|
|||
softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by `zWPtr'. Argument
|
||||
| `zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by 'zWPtr'. Argument
|
||||
| 'zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -359,10 +360,10 @@ void
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 128-bit floating-point values pointed to by
|
||||
| `aWPtr' and `bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by `zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of `aWPtr', `bWPtr',
|
||||
| and `zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| 'aWPtr' and 'bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by 'zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of 'aWPtr', 'bWPtr',
|
||||
| and 'zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| the platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
|
|
@ -90,8 +90,8 @@ struct uint128
|
|||
uiMagB64 = uiB64 & 0x7FFF;
|
||||
if ( uiMagA64 < uiMagB64 ) goto returnB;
|
||||
if ( uiMagB64 < uiMagA64 ) goto returnA;
|
||||
if ( uiNonsigA0 < uiNonsigB0 ) goto returnB;
|
||||
if ( uiNonsigB0 < uiNonsigA0 ) goto returnA;
|
||||
if ( uiA0 < uiB0 ) goto returnB;
|
||||
if ( uiB0 < uiA0 ) goto returnA;
|
||||
if ( uiA64 < uiB64 ) goto returnA;
|
||||
returnB:
|
||||
uiZ.v64 = uiB64;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
|
|
@ -85,8 +85,8 @@ struct uint128
|
|||
}
|
||||
}
|
||||
returnLargerMag:
|
||||
uiMagA64 = uiNonsigA64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagB64 = uiNonsigB64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagA64 = uiA64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagB64 = uiB64 & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
if ( uiMagA64 < uiMagB64 ) goto returnB;
|
||||
if ( uiMagB64 < uiMagA64 ) goto returnA;
|
||||
if ( uiA0 < uiB0 ) goto returnB;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 16-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 16-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t
|
||||
|
|
@ -74,8 +74,8 @@ uint_fast16_t
|
|||
}
|
||||
}
|
||||
returnLargerMag:
|
||||
uiMagA = uiNonsigA & 0x7FFF;
|
||||
uiMagB = uiNonsigB & 0x7FFF;
|
||||
uiMagA = uiA & 0x7FFF;
|
||||
uiMagB = uiB & 0x7FFF;
|
||||
if ( uiMagA < uiMagB ) return uiNonsigB;
|
||||
if ( uiMagB < uiMagA ) return uiNonsigA;
|
||||
return (uiNonsigA < uiNonsigB) ? uiNonsigA : uiNonsigB;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 32-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 32-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t
|
||||
|
|
@ -74,8 +74,8 @@ uint_fast32_t
|
|||
}
|
||||
}
|
||||
returnLargerMag:
|
||||
uiMagA = uiNonsigA & 0x7FFFFFFF;
|
||||
uiMagB = uiNonsigB & 0x7FFFFFFF;
|
||||
uiMagA = uiA & 0x7FFFFFFF;
|
||||
uiMagB = uiB & 0x7FFFFFFF;
|
||||
if ( uiMagA < uiMagB ) return uiNonsigB;
|
||||
if ( uiMagB < uiMagA ) return uiNonsigA;
|
||||
return (uiNonsigA < uiNonsigB) ? uiNonsigA : uiNonsigB;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2018 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:
|
||||
|
|
@ -42,9 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 64-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 64-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t
|
||||
|
|
@ -74,8 +74,8 @@ uint_fast64_t
|
|||
}
|
||||
}
|
||||
returnLargerMag:
|
||||
uiMagA = uiNonsigA & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagB = uiNonsigB & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagA = uiA & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
uiMagB = uiB & UINT64_C( 0x7FFFFFFFFFFFFFFF );
|
||||
if ( uiMagA < uiMagB ) return uiNonsigB;
|
||||
if ( uiMagB < uiMagA ) return uiNonsigA;
|
||||
return (uiNonsigA < uiNonsigB) ? uiNonsigA : uiNonsigB;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
/*============================================================================
|
||||
|
||||
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3d, by John R. Hauser.
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2018 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:
|
||||
|
|
@ -39,10 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "softfloat_types.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Default value for `softfloat_detectTininess'.
|
||||
| Default value for 'softfloat_detectTininess'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define init_detectTininess softfloat_tininess_afterRounding
|
||||
|
||||
|
|
@ -51,22 +52,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui32_fromPosOverflow 0xFFFFFFFF
|
||||
#define ui32_fromNegOverflow 0
|
||||
#define ui32_fromNegOverflow 0xFFFFFFFF
|
||||
#define ui32_fromNaN 0xFFFFFFFF
|
||||
#define i32_fromPosOverflow 0x7FFFFFFF
|
||||
#define i32_fromPosOverflow (-0x7FFFFFFF - 1)
|
||||
#define i32_fromNegOverflow (-0x7FFFFFFF - 1)
|
||||
#define i32_fromNaN 0x7FFFFFFF
|
||||
#define i32_fromNaN (-0x7FFFFFFF - 1)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The values to return on conversions to 64-bit integer formats that raise an
|
||||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui64_fromPosOverflow UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define ui64_fromNegOverflow 0
|
||||
#define ui64_fromNegOverflow UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define ui64_fromNaN UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define i64_fromPosOverflow UINT64_C( 0x7FFFFFFFFFFFFFFF )
|
||||
#define i64_fromNegOverflow (-UINT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNaN UINT64_C( 0x7FFFFFFFFFFFFFFF )
|
||||
#define i64_fromPosOverflow (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNegOverflow (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNaN (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| "Common NaN" structure, used to transfer NaN representations from one format
|
||||
|
|
@ -87,30 +88,30 @@ struct commonNaN {
|
|||
#define defaultNaNF16UI 0xFE00
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 16-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 16-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 16-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF16UI( uiA ) ((((uiA) & 0x7E00) == 0x7C00) && ((uiA) & 0x01FF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 16-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 16-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t softfloat_commonNaNToF16UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 16-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 16-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t
|
||||
|
|
@ -122,30 +123,30 @@ uint_fast16_t
|
|||
#define defaultNaNF32UI 0xFFC00000
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 32-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 32-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 32-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF32UI( uiA ) ((((uiA) & 0x7FC00000) == 0x7F800000) && ((uiA) & 0x003FFFFF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 32-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 32-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 32-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 32-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t
|
||||
|
|
@ -157,30 +158,30 @@ uint_fast32_t
|
|||
#define defaultNaNF64UI UINT64_C( 0xFFF8000000000000 )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 64-bit unsigned integer `uiA' has the bit pattern of a
|
||||
| Returns true when 64-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 64-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF64UI( uiA ) ((((uiA) & UINT64_C( 0x7FF8000000000000 )) == UINT64_C( 0x7FF0000000000000 )) && ((uiA) & UINT64_C( 0x0007FFFFFFFFFFFF )))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming `uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| Assuming 'uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 64-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 64-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t softfloat_commonNaNToF64UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting `uiA' and `uiB' as the bit patterns of two 64-bit floating-
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 64-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either `uiA' or `uiB' has the pattern of a
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t
|
||||
|
|
@ -194,7 +195,7 @@ uint_fast64_t
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 80-bit unsigned integer formed from concatenating
|
||||
| 16-bit `uiA64' and 64-bit `uiA0' has the bit pattern of an 80-bit extended
|
||||
| 16-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of an 80-bit extended
|
||||
| floating-point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
@ -203,15 +204,15 @@ uint_fast64_t
|
|||
#ifdef SOFTFLOAT_FAST_INT64
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when `SOFTFLOAT_FAST_INT64' is
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating `uiA64' and `uiA0'
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of an 80-bit extended floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -219,16 +220,16 @@ void
|
|||
uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into an 80-bit extended
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and returns the bit pattern of this value as an unsigned
|
||||
| integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
|
|
@ -250,17 +251,17 @@ struct uint128
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 128-bit unsigned integer formed from concatenating
|
||||
| 64-bit `uiA64' and 64-bit `uiA0' has the bit pattern of a 128-bit floating-
|
||||
| 64-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of a 128-bit floating-
|
||||
| point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF128UI( uiA64, uiA0 ) ((((uiA64) & UINT64_C( 0x7FFF800000000000 )) == UINT64_C( 0x7FFF000000000000 )) && ((uiA0) || ((uiA64) & UINT64_C( 0x00007FFFFFFFFFFF ))))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating `uiA64' and `uiA0'
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of a 128-bit floating-point NaN, converts this NaN to
|
||||
| the common NaN form, and stores the resulting common NaN at the location
|
||||
| pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -268,15 +269,15 @@ void
|
|||
uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 128-bit floating-point
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN * );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating `uiA64' and
|
||||
| `uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating `uiB64' and `uiB0' as another
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
|
|
@ -293,14 +294,14 @@ struct uint128
|
|||
#else
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when `SOFTFLOAT_FAST_INT64' is not
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is not
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 80-bit extended floating-point value pointed to by `aSPtr' is
|
||||
| Assuming the 80-bit extended floating-point value pointed to by 'aSPtr' is
|
||||
| a NaN, converts this NaN to the common NaN form, and stores the resulting
|
||||
| common NaN at the location pointed to by `zPtr'. If the NaN is a signaling
|
||||
| common NaN at the location pointed to by 'zPtr'. If the NaN is a signaling
|
||||
| NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -308,9 +309,9 @@ void
|
|||
const struct extFloat80M *aSPtr, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into an 80-bit extended
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and stores this NaN at the location pointed to by
|
||||
| `zSPtr'.
|
||||
| 'zSPtr'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
|
|
@ -318,8 +319,8 @@ void
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 80-bit extended floating-point values
|
||||
| pointed to by `aSPtr' and `bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by `zSPtr'. If either original floating-point
|
||||
| pointed to by 'aSPtr' and 'bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by 'zSPtr'. If either original floating-point
|
||||
| value is a signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -338,10 +339,10 @@ void
|
|||
#define defaultNaNF128UI0 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 128-bit floating-point value pointed to by `aWPtr' is a NaN,
|
||||
| Assuming the 128-bit floating-point value pointed to by 'aWPtr' is a NaN,
|
||||
| converts this NaN to the common NaN form, and stores the resulting common
|
||||
| NaN at the location pointed to by `zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument `aWPtr' points to an array of
|
||||
| NaN at the location pointed to by 'zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument 'aWPtr' points to an array of
|
||||
| four 32-bit elements that concatenate in the platform's normal endian order
|
||||
| to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
@ -349,9 +350,9 @@ void
|
|||
softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by `aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by `zWPtr'. Argument
|
||||
| `zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by 'zWPtr'. Argument
|
||||
| 'zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
@ -359,10 +360,10 @@ void
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 128-bit floating-point values pointed to by
|
||||
| `aWPtr' and `bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by `zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of `aWPtr', `bWPtr',
|
||||
| and `zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| 'aWPtr' and 'bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by 'zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of 'aWPtr', 'bWPtr',
|
||||
| and 'zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| the platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/extF80M_isSignalingNaN.c
vendored
Normal file
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/extF80M_isSignalingNaN.c
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool extF80M_isSignalingNaN( const extFloat80_t *aPtr )
|
||||
{
|
||||
const struct extFloat80M *aSPtr;
|
||||
uint64_t uiA0;
|
||||
|
||||
aSPtr = (const struct extFloat80M *) aPtr;
|
||||
if ( (aSPtr->signExp & 0x7FFF) != 0x7FFF ) return false;
|
||||
uiA0 = aSPtr->signif;
|
||||
return
|
||||
! (uiA0 & UINT64_C( 0x4000000000000000 ))
|
||||
&& (uiA0 & UINT64_C( 0x3FFFFFFFFFFFFFFF));
|
||||
|
||||
}
|
||||
|
||||
60
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/f128M_isSignalingNaN.c
vendored
Normal file
60
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/f128M_isSignalingNaN.c
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool f128M_isSignalingNaN( const float128_t *aPtr )
|
||||
{
|
||||
const uint32_t *aWPtr;
|
||||
uint32_t uiA96;
|
||||
|
||||
aWPtr = (const uint32_t *) aPtr;
|
||||
uiA96 = aWPtr[indexWordHi( 4 )];
|
||||
if ( (uiA96 & 0x7FFF8000) != 0x7FFF0000 ) return false;
|
||||
return
|
||||
((uiA96 & 0x00007FFF) != 0)
|
||||
|| ((aWPtr[indexWord( 4, 2 )] | aWPtr[indexWord( 4, 1 )]
|
||||
| aWPtr[indexWord( 4, 0 )])
|
||||
!= 0);
|
||||
|
||||
}
|
||||
|
||||
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToExtF80M.c
vendored
Normal file
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToExtF80M.c
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "softfloat_types.h"
|
||||
|
||||
#define softfloat_commonNaNToExtF80M softfloat_commonNaNToExtF80M
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and stores this NaN at the location pointed to by
|
||||
| 'zSPtr'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
const struct commonNaN *aPtr, struct extFloat80M *zSPtr )
|
||||
{
|
||||
|
||||
zSPtr->signExp = defaultNaNExtF80UI64;
|
||||
zSPtr->signif = defaultNaNExtF80UI0;
|
||||
|
||||
}
|
||||
|
||||
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToExtF80UI.c
vendored
Normal file
57
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToExtF80UI.c
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
|
||||
#define softfloat_commonNaNToExtF80UI softfloat_commonNaNToExtF80UI
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and returns the bit pattern of this value as an unsigned
|
||||
| integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
uiZ.v64 = defaultNaNExtF80UI64;
|
||||
uiZ.v0 = defaultNaNExtF80UI0;
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
60
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF128M.c
vendored
Normal file
60
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF128M.c
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
|
||||
#define softfloat_commonNaNToF128M softfloat_commonNaNToF128M
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by 'zWPtr'. Argument
|
||||
| 'zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToF128M( const struct commonNaN *aPtr, uint32_t *zWPtr )
|
||||
{
|
||||
|
||||
zWPtr[indexWord( 4, 3 )] = defaultNaNF128UI96;
|
||||
zWPtr[indexWord( 4, 2 )] = defaultNaNF128UI64;
|
||||
zWPtr[indexWord( 4, 1 )] = defaultNaNF128UI32;
|
||||
zWPtr[indexWord( 4, 0 )] = defaultNaNF128UI0;
|
||||
|
||||
}
|
||||
|
||||
56
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF128UI.c
vendored
Normal file
56
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF128UI.c
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
|
||||
#define softfloat_commonNaNToF128UI softfloat_commonNaNToF128UI
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF16UI.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF16UI.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF32UI.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF32UI.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF64UI.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_commonNaNToF64UI.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_extF80MToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_extF80MToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_extF80UIToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_extF80UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f128MToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f128MToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f128UIToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f128UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f16UIToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f16UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f32UIToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f32UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f64UIToCommonNaN.c
vendored
Normal file
5
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_f64UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
| This file intentionally contains no code.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
74
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNExtF80M.c
vendored
Normal file
74
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNExtF80M.c
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 80-bit extended floating-point values
|
||||
| pointed to by 'aSPtr' and 'bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by 'zSPtr'. If either original floating-point
|
||||
| value is a signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_propagateNaNExtF80M(
|
||||
const struct extFloat80M *aSPtr,
|
||||
const struct extFloat80M *bSPtr,
|
||||
struct extFloat80M *zSPtr
|
||||
)
|
||||
{
|
||||
uint_fast16_t ui64;
|
||||
uint_fast64_t ui0;
|
||||
|
||||
ui64 = aSPtr->signExp;
|
||||
ui0 = aSPtr->signif;
|
||||
if (
|
||||
softfloat_isSigNaNExtF80UI( ui64, ui0 )
|
||||
|| (bSPtr
|
||||
&& (ui64 = bSPtr->signExp,
|
||||
ui0 = bSPtr->signif,
|
||||
softfloat_isSigNaNExtF80UI( ui64, ui0 )))
|
||||
) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zSPtr->signExp = defaultNaNExtF80UI64;
|
||||
zSPtr->signif = defaultNaNExtF80UI0;
|
||||
|
||||
}
|
||||
|
||||
73
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNExtF80UI.c
vendored
Normal file
73
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNExtF80UI.c
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
| invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128
|
||||
softfloat_propagateNaNExtF80UI(
|
||||
uint_fast16_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast16_t uiB64,
|
||||
uint_fast64_t uiB0
|
||||
)
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
if (
|
||||
softfloat_isSigNaNExtF80UI( uiA64, uiA0 )
|
||||
|| softfloat_isSigNaNExtF80UI( uiB64, uiB0 )
|
||||
) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
uiZ.v64 = defaultNaNExtF80UI64;
|
||||
uiZ.v0 = defaultNaNExtF80UI0;
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
68
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF128M.c
vendored
Normal file
68
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF128M.c
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 128-bit floating-point values pointed to by
|
||||
| 'aWPtr' and 'bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by 'zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of 'aWPtr', 'bWPtr',
|
||||
| and 'zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| the platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_propagateNaNF128M(
|
||||
const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr )
|
||||
{
|
||||
|
||||
if (
|
||||
f128M_isSignalingNaN( (const float128_t *) aWPtr );
|
||||
|| (bWPtr && f128M_isSignalingNaN( (const float128_t *) bWPtr ))
|
||||
) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zWPtr[indexWord( 4, 3 )] = defaultNaNF128UI96;
|
||||
zWPtr[indexWord( 4, 2 )] = defaultNaNF128UI64;
|
||||
zWPtr[indexWord( 4, 1 )] = defaultNaNF128UI32;
|
||||
zWPtr[indexWord( 4, 0 )] = defaultNaNF128UI0;
|
||||
|
||||
}
|
||||
|
||||
73
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF128UI.c
vendored
Normal file
73
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF128UI.c
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitiveTypes.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128
|
||||
softfloat_propagateNaNF128UI(
|
||||
uint_fast64_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast64_t uiB64,
|
||||
uint_fast64_t uiB0
|
||||
)
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
if (
|
||||
softfloat_isSigNaNF128UI( uiA64, uiA0 )
|
||||
|| softfloat_isSigNaNF128UI( uiB64, uiB0 )
|
||||
) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF16UI.c
vendored
Normal file
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF16UI.c
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 16-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t
|
||||
softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF16UI( uiA ) || softfloat_isSigNaNF16UI( uiB ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
return defaultNaNF16UI;
|
||||
|
||||
}
|
||||
|
||||
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF32UI.c
vendored
Normal file
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF32UI.c
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 32-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t
|
||||
softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF32UI( uiA ) || softfloat_isSigNaNF32UI( uiB ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
return defaultNaNF32UI;
|
||||
|
||||
}
|
||||
|
||||
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF64UI.c
vendored
Normal file
58
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/s_propagateNaNF64UI.c
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 64-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t
|
||||
softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF64UI( uiA ) || softfloat_isSigNaNF64UI( uiB ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
return defaultNaNF64UI;
|
||||
|
||||
}
|
||||
|
||||
52
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/softfloat_raiseFlags.c
vendored
Normal file
52
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/softfloat_raiseFlags.c
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Raises the exceptions specified by 'flags'. Floating-point traps can be
|
||||
| defined here if desired. It is currently not possible for such a trap
|
||||
| to substitute a result value. If traps are not implemented, this routine
|
||||
| should be simply 'softfloat_exceptionFlags |= flags;'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_raiseFlags( uint_fast8_t flags )
|
||||
{
|
||||
|
||||
softfloat_exceptionFlags |= flags;
|
||||
|
||||
}
|
||||
|
||||
407
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/specialize.h
vendored
Normal file
407
deps/SoftFloat-3e/source/ARM-VFPv2-defaultNaN/specialize.h
vendored
Normal file
|
|
@ -0,0 +1,407 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#ifndef specialize_h
|
||||
#define specialize_h 1
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "primitiveTypes.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Default value for 'softfloat_detectTininess'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define init_detectTininess softfloat_tininess_beforeRounding
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The values to return on conversions to 32-bit integer formats that raise an
|
||||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui32_fromPosOverflow 0xFFFFFFFF
|
||||
#define ui32_fromNegOverflow 0
|
||||
#define ui32_fromNaN 0
|
||||
#define i32_fromPosOverflow 0x7FFFFFFF
|
||||
#define i32_fromNegOverflow (-0x7FFFFFFF - 1)
|
||||
#define i32_fromNaN 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The values to return on conversions to 64-bit integer formats that raise an
|
||||
| invalid exception.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define ui64_fromPosOverflow UINT64_C( 0xFFFFFFFFFFFFFFFF )
|
||||
#define ui64_fromNegOverflow 0
|
||||
#define ui64_fromNaN 0
|
||||
#define i64_fromPosOverflow INT64_C( 0x7FFFFFFFFFFFFFFF )
|
||||
#define i64_fromNegOverflow (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
|
||||
#define i64_fromNaN 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| "Common NaN" structure, used to transfer NaN representations from one format
|
||||
| to another.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct commonNaN { char _unused; };
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 16-bit floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNF16UI 0x7E00
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 16-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 16-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF16UI( uiA ) ((((uiA) & 0x7E00) == 0x7C00) && ((uiA) & 0x01FF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_f16UIToCommonNaN( uiA, zPtr ) if ( ! ((uiA) & 0x0200) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 16-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_commonNaNToF16UI( aPtr ) ((uint_fast16_t) defaultNaNF16UI)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 16-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t
|
||||
softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 32-bit floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNF32UI 0x7FC00000
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 32-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 32-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF32UI( uiA ) ((((uiA) & 0x7FC00000) == 0x7F800000) && ((uiA) & 0x003FFFFF))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_f32UIToCommonNaN( uiA, zPtr ) if ( ! ((uiA) & 0x00400000) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 32-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_commonNaNToF32UI( aPtr ) ((uint_fast32_t) defaultNaNF32UI)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 32-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t
|
||||
softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 64-bit floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNF64UI UINT64_C( 0x7FF8000000000000 )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when 64-bit unsigned integer 'uiA' has the bit pattern of a
|
||||
| 64-bit floating-point signaling NaN.
|
||||
| Note: This macro evaluates its argument more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF64UI( uiA ) ((((uiA) & UINT64_C( 0x7FF8000000000000 )) == UINT64_C( 0x7FF0000000000000 )) && ((uiA) & UINT64_C( 0x0007FFFFFFFFFFFF )))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_f64UIToCommonNaN( uiA, zPtr ) if ( ! ((uiA) & UINT64_C( 0x0008000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 64-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_commonNaNToF64UI( aPtr ) ((uint_fast64_t) defaultNaNF64UI)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting 'uiA' and 'uiB' as the bit patterns of two 64-bit floating-
|
||||
| point values, at least one of which is a NaN, returns the bit pattern of
|
||||
| the combined NaN result. If either 'uiA' or 'uiB' has the pattern of a
|
||||
| signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t
|
||||
softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB );
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 80-bit extended floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNExtF80UI64 0x7FFF
|
||||
#define defaultNaNExtF80UI0 UINT64_C( 0xC000000000000000 )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 80-bit unsigned integer formed from concatenating
|
||||
| 16-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of an 80-bit extended
|
||||
| floating-point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNExtF80UI( uiA64, uiA0 ) ((((uiA64) & 0x7FFF) == 0x7FFF) && ! ((uiA0) & UINT64_C( 0x4000000000000000 )) && ((uiA0) & UINT64_C( 0x3FFFFFFFFFFFFFFF )))
|
||||
|
||||
#ifdef SOFTFLOAT_FAST_INT64
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of an 80-bit extended floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_extF80UIToCommonNaN( uiA64, uiA0, zPtr ) if ( ! ((uiA0) & UINT64_C( 0x4000000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and returns the bit pattern of this value as an unsigned
|
||||
| integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined INLINE && ! defined softfloat_commonNaNToExtF80UI
|
||||
INLINE
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
uiZ.v64 = defaultNaNExtF80UI64;
|
||||
uiZ.v0 = defaultNaNExtF80UI0;
|
||||
return uiZ;
|
||||
}
|
||||
#else
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr );
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as an 80-bit extended floating-point value, and likewise interpreting
|
||||
| the unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 80-bit extended floating-point value, and assuming at least on of these
|
||||
| floating-point values is a NaN, returns the bit pattern of the combined NaN
|
||||
| result. If either original floating-point value is a signaling NaN, the
|
||||
| invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128
|
||||
softfloat_propagateNaNExtF80UI(
|
||||
uint_fast16_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast16_t uiB64,
|
||||
uint_fast64_t uiB0
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 128-bit floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNF128UI64 UINT64_C( 0x7FFF800000000000 )
|
||||
#define defaultNaNF128UI0 UINT64_C( 0 )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Returns true when the 128-bit unsigned integer formed from concatenating
|
||||
| 64-bit 'uiA64' and 64-bit 'uiA0' has the bit pattern of a 128-bit floating-
|
||||
| point signaling NaN.
|
||||
| Note: This macro evaluates its arguments more than once.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_isSigNaNF128UI( uiA64, uiA0 ) ((((uiA64) & UINT64_C( 0x7FFF800000000000 )) == UINT64_C( 0x7FFF000000000000 )) && ((uiA0) || ((uiA64) & UINT64_C( 0x00007FFFFFFFFFFF ))))
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of a 128-bit floating-point NaN, converts this NaN to
|
||||
| the common NaN form, and stores the resulting common NaN at the location
|
||||
| pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_f128UIToCommonNaN( uiA64, uiA0, zPtr ) if ( ! ((uiA64) & UINT64_C( 0x0000800000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined INLINE && ! defined softfloat_commonNaNToF128UI
|
||||
INLINE
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
uiZ.v64 = defaultNaNF128UI64;
|
||||
uiZ.v0 = defaultNaNF128UI0;
|
||||
return uiZ;
|
||||
}
|
||||
#else
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN * );
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Interpreting the unsigned integer formed from concatenating 'uiA64' and
|
||||
| 'uiA0' as a 128-bit floating-point value, and likewise interpreting the
|
||||
| unsigned integer formed from concatenating 'uiB64' and 'uiB0' as another
|
||||
| 128-bit floating-point value, and assuming at least on of these floating-
|
||||
| point values is a NaN, returns the bit pattern of the combined NaN result.
|
||||
| If either original floating-point value is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128
|
||||
softfloat_propagateNaNF128UI(
|
||||
uint_fast64_t uiA64,
|
||||
uint_fast64_t uiA0,
|
||||
uint_fast64_t uiB64,
|
||||
uint_fast64_t uiB0
|
||||
);
|
||||
|
||||
#else
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The following functions are needed only when 'SOFTFLOAT_FAST_INT64' is not
|
||||
| defined.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 80-bit extended floating-point value pointed to by 'aSPtr' is
|
||||
| a NaN, converts this NaN to the common NaN form, and stores the resulting
|
||||
| common NaN at the location pointed to by 'zPtr'. If the NaN is a signaling
|
||||
| NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_extF80MToCommonNaN( aSPtr, zPtr ) if ( ! ((aSPtr)->signif & UINT64_C( 0x4000000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and stores this NaN at the location pointed to by
|
||||
| 'zSPtr'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined INLINE && ! defined softfloat_commonNaNToExtF80M
|
||||
INLINE
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
const struct commonNaN *aPtr, struct extFloat80M *zSPtr )
|
||||
{
|
||||
zSPtr->signExp = defaultNaNExtF80UI64;
|
||||
zSPtr->signif = defaultNaNExtF80UI0;
|
||||
}
|
||||
#else
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
const struct commonNaN *aPtr, struct extFloat80M *zSPtr );
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 80-bit extended floating-point values
|
||||
| pointed to by 'aSPtr' and 'bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by 'zSPtr'. If either original floating-point
|
||||
| value is a signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_propagateNaNExtF80M(
|
||||
const struct extFloat80M *aSPtr,
|
||||
const struct extFloat80M *bSPtr,
|
||||
struct extFloat80M *zSPtr
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| The bit pattern for a default generated 128-bit floating-point NaN.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define defaultNaNF128UI96 0x7FFF8000
|
||||
#define defaultNaNF128UI64 0
|
||||
#define defaultNaNF128UI32 0
|
||||
#define defaultNaNF128UI0 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 128-bit floating-point value pointed to by 'aWPtr' is a NaN,
|
||||
| converts this NaN to the common NaN form, and stores the resulting common
|
||||
| NaN at the location pointed to by 'zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument 'aWPtr' points to an array of
|
||||
| four 32-bit elements that concatenate in the platform's normal endian order
|
||||
| to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define softfloat_f128MToCommonNaN( aWPtr, zPtr ) if ( ! ((aWPtr)[indexWordHi( 4 )] & UINT64_C( 0x0000800000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by 'zWPtr'. Argument
|
||||
| 'zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if defined INLINE && ! defined softfloat_commonNaNToF128M
|
||||
INLINE
|
||||
void
|
||||
softfloat_commonNaNToF128M( const struct commonNaN *aPtr, uint32_t *zWPtr )
|
||||
{
|
||||
zWPtr[indexWord( 4, 3 )] = defaultNaNF128UI96;
|
||||
zWPtr[indexWord( 4, 2 )] = defaultNaNF128UI64;
|
||||
zWPtr[indexWord( 4, 1 )] = defaultNaNF128UI32;
|
||||
zWPtr[indexWord( 4, 0 )] = defaultNaNF128UI0;
|
||||
}
|
||||
#else
|
||||
void
|
||||
softfloat_commonNaNToF128M( const struct commonNaN *aPtr, uint32_t *zWPtr );
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 128-bit floating-point values pointed to by
|
||||
| 'aWPtr' and 'bWPtr' is a NaN, stores the combined NaN result at the location
|
||||
| pointed to by 'zWPtr'. If either original floating-point value is a
|
||||
| signaling NaN, the invalid exception is raised. Each of 'aWPtr', 'bWPtr',
|
||||
| and 'zWPtr' points to an array of four 32-bit elements that concatenate in
|
||||
| the platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_propagateNaNF128M(
|
||||
const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr );
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
57
deps/SoftFloat-3e/source/ARM-VFPv2/extF80M_isSignalingNaN.c
vendored
Normal file
57
deps/SoftFloat-3e/source/ARM-VFPv2/extF80M_isSignalingNaN.c
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool extF80M_isSignalingNaN( const extFloat80_t *aPtr )
|
||||
{
|
||||
const struct extFloat80M *aSPtr;
|
||||
uint64_t uiA0;
|
||||
|
||||
aSPtr = (const struct extFloat80M *) aPtr;
|
||||
if ( (aSPtr->signExp & 0x7FFF) != 0x7FFF ) return false;
|
||||
uiA0 = aSPtr->signif;
|
||||
return
|
||||
! (uiA0 & UINT64_C( 0x4000000000000000 ))
|
||||
&& (uiA0 & UINT64_C( 0x3FFFFFFFFFFFFFFF));
|
||||
|
||||
}
|
||||
|
||||
60
deps/SoftFloat-3e/source/ARM-VFPv2/f128M_isSignalingNaN.c
vendored
Normal file
60
deps/SoftFloat-3e/source/ARM-VFPv2/f128M_isSignalingNaN.c
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool f128M_isSignalingNaN( const float128_t *aPtr )
|
||||
{
|
||||
const uint32_t *aWPtr;
|
||||
uint32_t uiA96;
|
||||
|
||||
aWPtr = (const uint32_t *) aPtr;
|
||||
uiA96 = aWPtr[indexWordHi( 4 )];
|
||||
if ( (uiA96 & 0x7FFF8000) != 0x7FFF0000 ) return false;
|
||||
return
|
||||
((uiA96 & 0x00007FFF) != 0)
|
||||
|| ((aWPtr[indexWord( 4, 2 )] | aWPtr[indexWord( 4, 1 )]
|
||||
| aWPtr[indexWord( 4, 0 )])
|
||||
!= 0);
|
||||
|
||||
}
|
||||
|
||||
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToExtF80M.c
vendored
Normal file
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToExtF80M.c
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and stores this NaN at the location pointed to by
|
||||
| 'zSPtr'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToExtF80M(
|
||||
const struct commonNaN *aPtr, struct extFloat80M *zSPtr )
|
||||
{
|
||||
|
||||
zSPtr->signExp = packToExtF80UI64( aPtr->sign, 0x7FFF );
|
||||
zSPtr->signif = UINT64_C( 0xC000000000000000 ) | aPtr->v64>>1;
|
||||
|
||||
}
|
||||
|
||||
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToExtF80UI.c
vendored
Normal file
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToExtF80UI.c
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into an 80-bit extended
|
||||
| floating-point NaN, and returns the bit pattern of this value as an unsigned
|
||||
| integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
uiZ.v64 = (uint_fast16_t) aPtr->sign<<15 | 0x7FFF;
|
||||
uiZ.v0 = UINT64_C( 0xC000000000000000 ) | aPtr->v64>>1;
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF128M.c
vendored
Normal file
56
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF128M.c
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and stores this NaN at the location pointed to by 'zWPtr'. Argument
|
||||
| 'zWPtr' points to an array of four 32-bit elements that concatenate in the
|
||||
| platform's normal endian order to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_commonNaNToF128M( const struct commonNaN *aPtr, uint32_t *zWPtr )
|
||||
{
|
||||
|
||||
softfloat_shortShiftRight128M( (const uint32_t *) &aPtr->v0, 16, zWPtr );
|
||||
zWPtr[indexWordHi( 4 )] |= (uint32_t) aPtr->sign<<31 | 0x7FFF8000;
|
||||
|
||||
}
|
||||
|
||||
55
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF128UI.c
vendored
Normal file
55
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF128UI.c
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
struct uint128 uiZ;
|
||||
|
||||
uiZ = softfloat_shortShiftRight128( aPtr->v64, aPtr->v0, 16 );
|
||||
uiZ.v64 |= (uint_fast64_t) aPtr->sign<<63 | UINT64_C( 0x7FFF800000000000 );
|
||||
return uiZ;
|
||||
|
||||
}
|
||||
|
||||
51
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF16UI.c
vendored
Normal file
51
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF16UI.c
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 16-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast16_t softfloat_commonNaNToF16UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
|
||||
return (uint_fast16_t) aPtr->sign<<15 | 0x7E00 | aPtr->v64>>54;
|
||||
|
||||
}
|
||||
|
||||
51
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF32UI.c
vendored
Normal file
51
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF32UI.c
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 32-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
|
||||
return (uint_fast32_t) aPtr->sign<<31 | 0x7FC00000 | aPtr->v64>>41;
|
||||
|
||||
}
|
||||
|
||||
53
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF64UI.c
vendored
Normal file
53
deps/SoftFloat-3e/source/ARM-VFPv2/s_commonNaNToF64UI.c
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Converts the common NaN pointed to by 'aPtr' into a 64-bit floating-point
|
||||
| NaN, and returns the bit pattern of this value as an unsigned integer.
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint_fast64_t softfloat_commonNaNToF64UI( const struct commonNaN *aPtr )
|
||||
{
|
||||
|
||||
return
|
||||
(uint_fast64_t) aPtr->sign<<63 | UINT64_C( 0x7FF8000000000000 )
|
||||
| aPtr->v64>>12;
|
||||
|
||||
}
|
||||
|
||||
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_extF80MToCommonNaN.c
vendored
Normal file
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_extF80MToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 80-bit extended floating-point value pointed to by 'aSPtr' is
|
||||
| a NaN, converts this NaN to the common NaN form, and stores the resulting
|
||||
| common NaN at the location pointed to by 'zPtr'. If the NaN is a signaling
|
||||
| NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_extF80MToCommonNaN(
|
||||
const struct extFloat80M *aSPtr, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( extF80M_isSignalingNaN( (const extFloat80_t *) aSPtr ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = signExtF80UI64( aSPtr->signExp );
|
||||
zPtr->v64 = aSPtr->signif<<1;
|
||||
zPtr->v0 = 0;
|
||||
|
||||
}
|
||||
|
||||
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_extF80UIToCommonNaN.c
vendored
Normal file
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_extF80UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of an 80-bit extended floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_extF80UIToCommonNaN(
|
||||
uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNExtF80UI( uiA64, uiA0 ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = uiA64>>15;
|
||||
zPtr->v64 = uiA0<<1;
|
||||
zPtr->v0 = 0;
|
||||
|
||||
}
|
||||
|
||||
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_f128MToCommonNaN.c
vendored
Normal file
62
deps/SoftFloat-3e/source/ARM-VFPv2/s_f128MToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the 128-bit floating-point value pointed to by 'aWPtr' is a NaN,
|
||||
| converts this NaN to the common NaN form, and stores the resulting common
|
||||
| NaN at the location pointed to by 'zPtr'. If the NaN is a signaling NaN,
|
||||
| the invalid exception is raised. Argument 'aWPtr' points to an array of
|
||||
| four 32-bit elements that concatenate in the platform's normal endian order
|
||||
| to form a 128-bit floating-point value.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( f128M_isSignalingNaN( (const float128_t *) aWPtr ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = aWPtr[indexWordHi( 4 )]>>31;
|
||||
softfloat_shortShiftLeft128M( aWPtr, 16, (uint32_t *) &zPtr->v0 );
|
||||
|
||||
}
|
||||
|
||||
65
deps/SoftFloat-3e/source/ARM-VFPv2/s_f128UIToCommonNaN.c
vendored
Normal file
65
deps/SoftFloat-3e/source/ARM-VFPv2/s_f128UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "primitives.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0'
|
||||
| has the bit pattern of a 128-bit floating-point NaN, converts this NaN to
|
||||
| the common NaN form, and stores the resulting common NaN at the location
|
||||
| pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid exception
|
||||
| is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_f128UIToCommonNaN(
|
||||
uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr )
|
||||
{
|
||||
struct uint128 NaNSig;
|
||||
|
||||
if ( softfloat_isSigNaNF128UI( uiA64, uiA0 ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
NaNSig = softfloat_shortShiftLeft128( uiA64, uiA0, 16 );
|
||||
zPtr->sign = uiA64>>63;
|
||||
zPtr->v64 = NaNSig.v64;
|
||||
zPtr->v0 = NaNSig.v0;
|
||||
|
||||
}
|
||||
|
||||
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f16UIToCommonNaN.c
vendored
Normal file
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f16UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2015, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 16-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF16UI( uiA ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = uiA>>15;
|
||||
zPtr->v64 = (uint_fast64_t) uiA<<54;
|
||||
zPtr->v0 = 0;
|
||||
|
||||
}
|
||||
|
||||
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f32UIToCommonNaN.c
vendored
Normal file
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f32UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 32-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF32UI( uiA ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = uiA>>31;
|
||||
zPtr->v64 = (uint_fast64_t) uiA<<41;
|
||||
zPtr->v0 = 0;
|
||||
|
||||
}
|
||||
|
||||
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f64UIToCommonNaN.c
vendored
Normal file
59
deps/SoftFloat-3e/source/ARM-VFPv2/s_f64UIToCommonNaN.c
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming 'uiA' has the bit pattern of a 64-bit floating-point NaN, converts
|
||||
| this NaN to the common NaN form, and stores the resulting common NaN at the
|
||||
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid
|
||||
| exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr )
|
||||
{
|
||||
|
||||
if ( softfloat_isSigNaNF64UI( uiA ) ) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
}
|
||||
zPtr->sign = uiA>>63;
|
||||
zPtr->v64 = uiA<<12;
|
||||
zPtr->v0 = 0;
|
||||
|
||||
}
|
||||
|
||||
86
deps/SoftFloat-3e/source/ARM-VFPv2/s_propagateNaNExtF80M.c
vendored
Normal file
86
deps/SoftFloat-3e/source/ARM-VFPv2/s_propagateNaNExtF80M.c
vendored
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
/*============================================================================
|
||||
|
||||
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
|
||||
Package, Release 3e, by John R. Hauser.
|
||||
|
||||
Copyright 2011, 2012, 2013, 2014, 2017 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:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions, and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the University nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=============================================================================*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
#include "internals.h"
|
||||
#include "specialize.h"
|
||||
#include "softfloat.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Assuming at least one of the two 80-bit extended floating-point values
|
||||
| pointed to by 'aSPtr' and 'bSPtr' is a NaN, stores the combined NaN result
|
||||
| at the location pointed to by 'zSPtr'. If either original floating-point
|
||||
| value is a signaling NaN, the invalid exception is raised.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
softfloat_propagateNaNExtF80M(
|
||||
const struct extFloat80M *aSPtr,
|
||||
const struct extFloat80M *bSPtr,
|
||||
struct extFloat80M *zSPtr
|
||||
)
|
||||
{
|
||||
const struct extFloat80M *sPtr;
|
||||
bool isSigNaNA;
|
||||
uint_fast16_t uiZ64;
|
||||
uint_fast64_t uiZ0;
|
||||
|
||||
sPtr = aSPtr;
|
||||
isSigNaNA = extF80M_isSignalingNaN( (const extFloat80_t *) aSPtr );
|
||||
if (
|
||||
isSigNaNA
|
||||
|| (bSPtr
|
||||
&& extF80M_isSignalingNaN( (const extFloat80_t *) bSPtr ))
|
||||
) {
|
||||
softfloat_raiseFlags( softfloat_flag_invalid );
|
||||
if ( isSigNaNA ) goto copyNonsig;
|
||||
goto copyNonsigB;
|
||||
}
|
||||
uiZ64 = sPtr->signExp;
|
||||
uiZ0 = sPtr->signif;
|
||||
if ( isNaNExtF80UI( uiZ64, uiZ0 ) ) goto returnNonsig;
|
||||
copyNonsigB:
|
||||
sPtr = bSPtr;
|
||||
copyNonsig:
|
||||
uiZ64 = sPtr->signExp;
|
||||
uiZ0 = sPtr->signif;
|
||||
returnNonsig:
|
||||
zSPtr->signExp = uiZ64;
|
||||
zSPtr->signif = uiZ0 | UINT64_C( 0xC000000000000000 );
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue