#![allow(non_upper_case_globals)] // TODO: Are aarch64 and riscv32 supported? use std::env; use std::path::Path; #[cfg(target_arch = "x86")] mod path { pub const primitives: [&str; 29] = [ "s_compare96M.c", "s_compare128M.c", "s_shortShiftLeft64To96M.c", "s_shortShiftLeftM.c", "s_shiftLeftM.c", "s_shortShiftRightM.c", "s_shortShiftRightJam64.c", "s_shortShiftRightJamM.c", "s_shiftRightJam32.c", "s_shiftRightJam64.c", "s_shiftRightJamM.c", "s_shiftRightM.c", "s_countLeadingZeros8.c", "s_countLeadingZeros16.c", "s_countLeadingZeros32.c", "s_countLeadingZeros64.c", "s_addM.c", "s_addCarryM.c", "s_addComplCarryM.c", "s_negXM.c", "s_sub1XM.c", "s_subM.c", "s_mul64To128M.c", "s_mul128MTo256M.c", "s_approxRecip_1Ks.c", "s_approxRecip32_1.c", "s_approxRecipSqrt_1Ks.c", "s_approxRecipSqrt32_1.c", "s_remStepMBy32.c", ]; pub const specialize: [&str; 18] = [ "softfloat_raiseFlags.c", "s_f16UIToCommonNaN.c", "s_commonNaNToF16UI.c", "s_propagateNaNF16UI.c", "s_f32UIToCommonNaN.c", "s_commonNaNToF32UI.c", "s_propagateNaNF32UI.c", "s_f64UIToCommonNaN.c", "s_commonNaNToF64UI.c", "s_propagateNaNF64UI.c", "extF80M_isSignalingNaN.c", "s_extF80MToCommonNaN.c", "s_commonNaNToExtF80M.c", "s_propagateNaNExtF80M.c", "f128M_isSignalingNaN.c", "s_f128MToCommonNaN.c", "s_commonNaNToF128M.c", "s_propagateNaNF128M.c", ]; pub const others: [&str; 190] = [ "s_roundToUI32.c", "s_roundMToUI64.c", "s_roundToI32.c", "s_roundMToI64.c", "s_normSubnormalF16Sig.c", "s_roundPackToF16.c", "s_normRoundPackToF16.c", "s_addMagsF16.c", "s_subMagsF16.c", "s_mulAddF16.c", "s_normSubnormalF32Sig.c", "s_roundPackToF32.c", "s_normRoundPackToF32.c", "s_addMagsF32.c", "s_subMagsF32.c", "s_mulAddF32.c", "s_normSubnormalF64Sig.c", "s_roundPackToF64.c", "s_normRoundPackToF64.c", "s_addMagsF64.c", "s_subMagsF64.c", "s_mulAddF64.c", "s_tryPropagateNaNExtF80M.c", "s_invalidExtF80M.c", "s_normExtF80SigM.c", "s_roundPackMToExtF80M.c", "s_normRoundPackMToExtF80M.c", "s_addExtF80M.c", "s_compareNonnormExtF80M.c", "s_isNaNF128M.c", "s_tryPropagateNaNF128M.c", "s_invalidF128M.c", "s_shiftNormSigF128M.c", "s_roundPackMToF128M.c", "s_normRoundPackMToF128M.c", "s_addF128M.c", "s_mulAddF128M.c", "softfloat_state.c", "ui32_to_f16.c", "ui32_to_f32.c", "ui32_to_f64.c", "ui32_to_extF80M.c", "ui32_to_f128M.c", "ui64_to_f16.c", "ui64_to_f32.c", "ui64_to_f64.c", "ui64_to_extF80M.c", "ui64_to_f128M.c", "i32_to_f16.c", "i32_to_f32.c", "i32_to_f64.c", "i32_to_extF80M.c", "i32_to_f128M.c", "i64_to_f16.c", "i64_to_f32.c", "i64_to_f64.c", "i64_to_extF80M.c", "i64_to_f128M.c", "f16_to_ui32.c", "f16_to_ui64.c", "f16_to_i32.c", "f16_to_i64.c", "f16_to_ui32_r_minMag.c", "f16_to_ui64_r_minMag.c", "f16_to_i32_r_minMag.c", "f16_to_i64_r_minMag.c", "f16_to_f32.c", "f16_to_f64.c", "f16_to_extF80M.c", "f16_to_f128M.c", "f16_roundToInt.c", "f16_add.c", "f16_sub.c", "f16_mul.c", "f16_mulAdd.c", "f16_div.c", "f16_rem.c", "f16_sqrt.c", "f16_eq.c", "f16_le.c", "f16_lt.c", "f16_eq_signaling.c", "f16_le_quiet.c", "f16_lt_quiet.c", "f16_isSignalingNaN.c", "f32_to_ui32.c", "f32_to_ui64.c", "f32_to_i32.c", "f32_to_i64.c", "f32_to_ui32_r_minMag.c", "f32_to_ui64_r_minMag.c", "f32_to_i32_r_minMag.c", "f32_to_i64_r_minMag.c", "f32_to_f16.c", "f32_to_f64.c", "f32_to_extF80M.c", "f32_to_f128M.c", "f32_roundToInt.c", "f32_add.c", "f32_sub.c", "f32_mul.c", "f32_mulAdd.c", "f32_div.c", "f32_rem.c", "f32_sqrt.c", "f32_eq.c", "f32_le.c", "f32_lt.c", "f32_eq_signaling.c", "f32_le_quiet.c", "f32_lt_quiet.c", "f32_isSignalingNaN.c", "f64_to_ui32.c", "f64_to_ui64.c", "f64_to_i32.c", "f64_to_i64.c", "f64_to_ui32_r_minMag.c", "f64_to_ui64_r_minMag.c", "f64_to_i32_r_minMag.c", "f64_to_i64_r_minMag.c", "f64_to_f16.c", "f64_to_f32.c", "f64_to_extF80M.c", "f64_to_f128M.c", "f64_roundToInt.c", "f64_add.c", "f64_sub.c", "f64_mul.c", "f64_mulAdd.c", "f64_div.c", "f64_rem.c", "f64_sqrt.c", "f64_eq.c", "f64_le.c", "f64_lt.c", "f64_eq_signaling.c", "f64_le_quiet.c", "f64_lt_quiet.c", "f64_isSignalingNaN.c", "extF80M_to_ui32.c", "extF80M_to_ui64.c", "extF80M_to_i32.c", "extF80M_to_i64.c", "extF80M_to_ui32_r_minMag.c", "extF80M_to_ui64_r_minMag.c", "extF80M_to_i32_r_minMag.c", "extF80M_to_i64_r_minMag.c", "extF80M_to_f16.c", "extF80M_to_f32.c", "extF80M_to_f64.c", "extF80M_to_f128M.c", "extF80M_roundToInt.c", "extF80M_add.c", "extF80M_sub.c", "extF80M_mul.c", "extF80M_div.c", "extF80M_rem.c", "extF80M_sqrt.c", "extF80M_eq.c", "extF80M_le.c", "extF80M_lt.c", "extF80M_eq_signaling.c", "extF80M_le_quiet.c", "extF80M_lt_quiet.c", "f128M_to_ui32.c", "f128M_to_ui64.c", "f128M_to_i32.c", "f128M_to_i64.c", "f128M_to_ui32_r_minMag.c", "f128M_to_ui64_r_minMag.c", "f128M_to_i32_r_minMag.c", "f128M_to_i64_r_minMag.c", "f128M_to_f16.c", "f128M_to_f32.c", "f128M_to_f64.c", "f128M_to_extF80M.c", "f128M_roundToInt.c", "f128M_add.c", "f128M_sub.c", "f128M_mul.c", "f128M_mulAdd.c", "f128M_div.c", "f128M_rem.c", "f128M_sqrt.c", "f128M_eq.c", "f128M_le.c", "f128M_lt.c", "f128M_eq_signaling.c", "f128M_le_quiet.c", "f128M_lt_quiet.c", ]; } #[cfg(target_arch = "x86_64")] mod path { pub const primitives: [&str; 31] = [ "s_eq128.c", "s_le128.c", "s_lt128.c", "s_shortShiftLeft128.c", "s_shortShiftRight128.c", "s_shortShiftRightJam64.c", "s_shortShiftRightJam64Extra.c", "s_shortShiftRightJam128.c", "s_shortShiftRightJam128Extra.c", "s_shiftRightJam32.c", "s_shiftRightJam64.c", "s_shiftRightJam64Extra.c", "s_shiftRightJam128.c", "s_shiftRightJam128Extra.c", "s_shiftRightJam256M.c", "s_countLeadingZeros8.c", "s_countLeadingZeros16.c", "s_countLeadingZeros32.c", "s_countLeadingZeros64.c", "s_add128.c", "s_add256M.c", "s_sub128.c", "s_sub256M.c", "s_mul64ByShifted32To128.c", "s_mul64To128.c", "s_mul128By32.c", "s_mul128To256M.c", "s_approxRecip_1Ks.c", "s_approxRecip32_1.c", "s_approxRecipSqrt_1Ks.c", "s_approxRecipSqrt32_1.c", ]; pub const specialize: [&str; 20] = [ "softfloat_raiseFlags.c", "s_f16UIToCommonNaN.c", "s_commonNaNToF16UI.c", "s_propagateNaNF16UI.c", "s_bf16UIToCommonNaN.c", "s_commonNaNToBF16UI.c", "s_f32UIToCommonNaN.c", "s_commonNaNToF32UI.c", "s_propagateNaNF32UI.c", "s_f64UIToCommonNaN.c", "s_commonNaNToF64UI.c", "s_propagateNaNF64UI.c", "extF80M_isSignalingNaN.c", "s_extF80UIToCommonNaN.c", "s_commonNaNToExtF80UI.c", "s_propagateNaNExtF80UI.c", "f128M_isSignalingNaN.c", "s_f128UIToCommonNaN.c", "s_commonNaNToF128UI.c", "s_propagateNaNF128UI.c", ]; pub const others: [&str; 258] = [ "s_roundToUI32.c", "s_roundToUI64.c", "s_roundToI32.c", "s_roundToI64.c", "s_normSubnormalBF16Sig.c", "s_roundPackToBF16.c", "s_normSubnormalF16Sig.c", "s_roundPackToF16.c", "s_normRoundPackToF16.c", "s_addMagsF16.c", "s_subMagsF16.c", "s_mulAddF16.c", "s_normSubnormalF32Sig.c", "s_roundPackToF32.c", "s_normRoundPackToF32.c", "s_addMagsF32.c", "s_subMagsF32.c", "s_mulAddF32.c", "s_normSubnormalF64Sig.c", "s_roundPackToF64.c", "s_normRoundPackToF64.c", "s_addMagsF64.c", "s_subMagsF64.c", "s_mulAddF64.c", "s_normSubnormalExtF80Sig.c", "s_roundPackToExtF80.c", "s_normRoundPackToExtF80.c", "s_addMagsExtF80.c", "s_subMagsExtF80.c", "s_normSubnormalF128Sig.c", "s_roundPackToF128.c", "s_normRoundPackToF128.c", "s_addMagsF128.c", "s_subMagsF128.c", "s_mulAddF128.c", "softfloat_state.c", "ui32_to_f16.c", "ui32_to_f32.c", "ui32_to_f64.c", "ui32_to_extF80.c", "ui32_to_extF80M.c", "ui32_to_f128.c", "ui32_to_f128M.c", "ui64_to_f16.c", "ui64_to_f32.c", "ui64_to_f64.c", "ui64_to_extF80.c", "ui64_to_extF80M.c", "ui64_to_f128.c", "ui64_to_f128M.c", "i32_to_f16.c", "i32_to_f32.c", "i32_to_f64.c", "i32_to_extF80.c", "i32_to_extF80M.c", "i32_to_f128.c", "i32_to_f128M.c", "i64_to_f16.c", "i64_to_f32.c", "i64_to_f64.c", "i64_to_extF80.c", "i64_to_extF80M.c", "i64_to_f128.c", "i64_to_f128M.c", "bf16_isSignalingNaN.c", "bf16_to_f32.c", "f16_to_ui32.c", "f16_to_ui64.c", "f16_to_i32.c", "f16_to_i64.c", "f16_to_ui32_r_minMag.c", "f16_to_ui64_r_minMag.c", "f16_to_i32_r_minMag.c", "f16_to_i64_r_minMag.c", "f16_to_f32.c", "f16_to_f64.c", "f16_to_extF80.c", "f16_to_extF80M.c", "f16_to_f128.c", "f16_to_f128M.c", "f16_roundToInt.c", "f16_add.c", "f16_sub.c", "f16_mul.c", "f16_mulAdd.c", "f16_div.c", "f16_rem.c", "f16_sqrt.c", "f16_eq.c", "f16_le.c", "f16_lt.c", "f16_eq_signaling.c", "f16_le_quiet.c", "f16_lt_quiet.c", "f16_isSignalingNaN.c", "f32_to_ui32.c", "f32_to_ui64.c", "f32_to_i32.c", "f32_to_i64.c", "f32_to_ui32_r_minMag.c", "f32_to_ui64_r_minMag.c", "f32_to_i32_r_minMag.c", "f32_to_i64_r_minMag.c", "f32_to_bf16.c", "f32_to_f16.c", "f32_to_f64.c", "f32_to_extF80.c", "f32_to_extF80M.c", "f32_to_f128.c", "f32_to_f128M.c", "f32_roundToInt.c", "f32_add.c", "f32_sub.c", "f32_mul.c", "f32_mulAdd.c", "f32_div.c", "f32_rem.c", "f32_sqrt.c", "f32_eq.c", "f32_le.c", "f32_lt.c", "f32_eq_signaling.c", "f32_le_quiet.c", "f32_lt_quiet.c", "f32_isSignalingNaN.c", "f64_to_ui32.c", "f64_to_ui64.c", "f64_to_i32.c", "f64_to_i64.c", "f64_to_ui32_r_minMag.c", "f64_to_ui64_r_minMag.c", "f64_to_i32_r_minMag.c", "f64_to_i64_r_minMag.c", "f64_to_f16.c", "f64_to_f32.c", "f64_to_extF80.c", "f64_to_extF80M.c", "f64_to_f128.c", "f64_to_f128M.c", "f64_roundToInt.c", "f64_add.c", "f64_sub.c", "f64_mul.c", "f64_mulAdd.c", "f64_div.c", "f64_rem.c", "f64_sqrt.c", "f64_eq.c", "f64_le.c", "f64_lt.c", "f64_eq_signaling.c", "f64_le_quiet.c", "f64_lt_quiet.c", "f64_isSignalingNaN.c", "extF80_to_ui32.c", "extF80_to_ui64.c", "extF80_to_i32.c", "extF80_to_i64.c", "extF80_to_ui32_r_minMag.c", "extF80_to_ui64_r_minMag.c", "extF80_to_i32_r_minMag.c", "extF80_to_i64_r_minMag.c", "extF80_to_f16.c", "extF80_to_f32.c", "extF80_to_f64.c", "extF80_to_f128.c", "extF80_roundToInt.c", "extF80_add.c", "extF80_sub.c", "extF80_mul.c", "extF80_div.c", "extF80_rem.c", "extF80_sqrt.c", "extF80_eq.c", "extF80_le.c", "extF80_lt.c", "extF80_eq_signaling.c", "extF80_le_quiet.c", "extF80_lt_quiet.c", "extF80_isSignalingNaN.c", "extF80M_to_ui32.c", "extF80M_to_ui64.c", "extF80M_to_i32.c", "extF80M_to_i64.c", "extF80M_to_ui32_r_minMag.c", "extF80M_to_ui64_r_minMag.c", "extF80M_to_i32_r_minMag.c", "extF80M_to_i64_r_minMag.c", "extF80M_to_f16.c", "extF80M_to_f32.c", "extF80M_to_f64.c", "extF80M_to_f128M.c", "extF80M_roundToInt.c", "extF80M_add.c", "extF80M_sub.c", "extF80M_mul.c", "extF80M_div.c", "extF80M_rem.c", "extF80M_sqrt.c", "extF80M_eq.c", "extF80M_le.c", "extF80M_lt.c", "extF80M_eq_signaling.c", "extF80M_le_quiet.c", "extF80M_lt_quiet.c", "f128_to_ui32.c", "f128_to_ui64.c", "f128_to_i32.c", "f128_to_i64.c", "f128_to_ui32_r_minMag.c", "f128_to_ui64_r_minMag.c", "f128_to_i32_r_minMag.c", "f128_to_i64_r_minMag.c", "f128_to_f16.c", "f128_to_f32.c", "f128_to_extF80.c", "f128_to_f64.c", "f128_roundToInt.c", "f128_add.c", "f128_sub.c", "f128_mul.c", "f128_mulAdd.c", "f128_div.c", "f128_rem.c", "f128_sqrt.c", "f128_eq.c", "f128_le.c", "f128_lt.c", "f128_eq_signaling.c", "f128_le_quiet.c", "f128_lt_quiet.c", "f128_isSignalingNaN.c", "f128M_to_ui32.c", "f128M_to_ui64.c", "f128M_to_i32.c", "f128M_to_i64.c", "f128M_to_ui32_r_minMag.c", "f128M_to_ui64_r_minMag.c", "f128M_to_i32_r_minMag.c", "f128M_to_i64_r_minMag.c", "f128M_to_f16.c", "f128M_to_f32.c", "f128M_to_extF80M.c", "f128M_to_f64.c", "f128M_roundToInt.c", "f128M_add.c", "f128M_sub.c", "f128M_mul.c", "f128M_mulAdd.c", "f128M_div.c", "f128M_rem.c", "f128M_sqrt.c", "f128M_eq.c", "f128M_le.c", "f128M_lt.c", "f128M_eq_signaling.c", "f128M_le_quiet.c", "f128M_lt_quiet.c", ]; } #[cfg(target_arch = "arm")] mod path { pub const primitives: [&str; 29] = [ "s_compare96M.c", "s_compare128M.c", "s_shortShiftLeft64To96M.c", "s_shortShiftLeftM.c", "s_shiftLeftM.c", "s_shortShiftRightM.c", "s_shortShiftRightJam64.c", "s_shortShiftRightJamM.c", "s_shiftRightJam32.c", "s_shiftRightJam64.c", "s_shiftRightJamM.c", "s_shiftRightM.c", "s_countLeadingZeros8.c", "s_countLeadingZeros16.c", "s_countLeadingZeros32.c", "s_countLeadingZeros64.c", "s_addM.c", "s_addCarryM.c", "s_addComplCarryM.c", "s_negXM.c", "s_sub1XM.c", "s_subM.c", "s_mul64To128M.c", "s_mul128MTo256M.c", "s_approxRecip_1Ks.c", "s_approxRecip32_1.c", "s_approxRecipSqrt_1Ks.c", "s_approxRecipSqrt32_1.c", "s_remStepMBy32.c", ]; pub const specialize: [&str; 18] = [ "softfloat_raiseFlags.c", "s_f16UIToCommonNaN.c", "s_commonNaNToF16UI.c", "s_propagateNaNF16UI.c", "s_f32UIToCommonNaN.c", "s_commonNaNToF32UI.c", "s_propagateNaNF32UI.c", "s_f64UIToCommonNaN.c", "s_commonNaNToF64UI.c", "s_propagateNaNF64UI.c", "extF80M_isSignalingNaN.c", "s_extF80MToCommonNaN.c", "s_commonNaNToExtF80M.c", "s_propagateNaNExtF80M.c", "f128M_isSignalingNaN.c", "s_f128MToCommonNaN.c", "s_commonNaNToF128M.c", "s_propagateNaNF128M.c", ]; pub const others: [&str; 190] = [ "s_roundToUI32.c", "s_roundMToUI64.c", "s_roundToI32.c", "s_roundMToI64.c", "s_normSubnormalF16Sig.c", "s_roundPackToF16.c", "s_normRoundPackToF16.c", "s_addMagsF16.c", "s_subMagsF16.c", "s_mulAddF16.c", "s_normSubnormalF32Sig.c", "s_roundPackToF32.c", "s_normRoundPackToF32.c", "s_addMagsF32.c", "s_subMagsF32.c", "s_mulAddF32.c", "s_normSubnormalF64Sig.c", "s_roundPackToF64.c", "s_normRoundPackToF64.c", "s_addMagsF64.c", "s_subMagsF64.c", "s_mulAddF64.c", "s_tryPropagateNaNExtF80M.c", "s_invalidExtF80M.c", "s_normExtF80SigM.c", "s_roundPackMToExtF80M.c", "s_normRoundPackMToExtF80M.c", "s_addExtF80M.c", "s_compareNonnormExtF80M.c", "s_isNaNF128M.c", "s_tryPropagateNaNF128M.c", "s_invalidF128M.c", "s_shiftNormSigF128M.c", "s_roundPackMToF128M.c", "s_normRoundPackMToF128M.c", "s_addF128M.c", "s_mulAddF128M.c", "softfloat_state.c", "ui32_to_f16.c", "ui32_to_f32.c", "ui32_to_f64.c", "ui32_to_extF80M.c", "ui32_to_f128M.c", "ui64_to_f16.c", "ui64_to_f32.c", "ui64_to_f64.c", "ui64_to_extF80M.c", "ui64_to_f128M.c", "i32_to_f16.c", "i32_to_f32.c", "i32_to_f64.c", "i32_to_extF80M.c", "i32_to_f128M.c", "i64_to_f16.c", "i64_to_f32.c", "i64_to_f64.c", "i64_to_extF80M.c", "i64_to_f128M.c", "f16_to_ui32.c", "f16_to_ui64.c", "f16_to_i32.c", "f16_to_i64.c", "f16_to_ui32_r_minMag.c", "f16_to_ui64_r_minMag.c", "f16_to_i32_r_minMag.c", "f16_to_i64_r_minMag.c", "f16_to_f32.c", "f16_to_f64.c", "f16_to_extF80M.c", "f16_to_f128M.c", "f16_roundToInt.c", "f16_add.c", "f16_sub.c", "f16_mul.c", "f16_mulAdd.c", "f16_div.c", "f16_rem.c", "f16_sqrt.c", "f16_eq.c", "f16_le.c", "f16_lt.c", "f16_eq_signaling.c", "f16_le_quiet.c", "f16_lt_quiet.c", "f16_isSignalingNaN.c", "f32_to_ui32.c", "f32_to_ui64.c", "f32_to_i32.c", "f32_to_i64.c", "f32_to_ui32_r_minMag.c", "f32_to_ui64_r_minMag.c", "f32_to_i32_r_minMag.c", "f32_to_i64_r_minMag.c", "f32_to_f16.c", "f32_to_f64.c", "f32_to_extF80M.c", "f32_to_f128M.c", "f32_roundToInt.c", "f32_add.c", "f32_sub.c", "f32_mul.c", "f32_mulAdd.c", "f32_div.c", "f32_rem.c", "f32_sqrt.c", "f32_eq.c", "f32_le.c", "f32_lt.c", "f32_eq_signaling.c", "f32_le_quiet.c", "f32_lt_quiet.c", "f32_isSignalingNaN.c", "f64_to_ui32.c", "f64_to_ui64.c", "f64_to_i32.c", "f64_to_i64.c", "f64_to_ui32_r_minMag.c", "f64_to_ui64_r_minMag.c", "f64_to_i32_r_minMag.c", "f64_to_i64_r_minMag.c", "f64_to_f16.c", "f64_to_f32.c", "f64_to_extF80M.c", "f64_to_f128M.c", "f64_roundToInt.c", "f64_add.c", "f64_sub.c", "f64_mul.c", "f64_mulAdd.c", "f64_div.c", "f64_rem.c", "f64_sqrt.c", "f64_eq.c", "f64_le.c", "f64_lt.c", "f64_eq_signaling.c", "f64_le_quiet.c", "f64_lt_quiet.c", "f64_isSignalingNaN.c", "extF80M_to_ui32.c", "extF80M_to_ui64.c", "extF80M_to_i32.c", "extF80M_to_i64.c", "extF80M_to_ui32_r_minMag.c", "extF80M_to_ui64_r_minMag.c", "extF80M_to_i32_r_minMag.c", "extF80M_to_i64_r_minMag.c", "extF80M_to_f16.c", "extF80M_to_f32.c", "extF80M_to_f64.c", "extF80M_to_f128M.c", "extF80M_roundToInt.c", "extF80M_add.c", "extF80M_sub.c", "extF80M_mul.c", "extF80M_div.c", "extF80M_rem.c", "extF80M_sqrt.c", "extF80M_eq.c", "extF80M_le.c", "extF80M_lt.c", "extF80M_eq_signaling.c", "extF80M_le_quiet.c", "extF80M_lt_quiet.c", "f128M_to_ui32.c", "f128M_to_ui64.c", "f128M_to_i32.c", "f128M_to_i64.c", "f128M_to_ui32_r_minMag.c", "f128M_to_ui64_r_minMag.c", "f128M_to_i32_r_minMag.c", "f128M_to_i64_r_minMag.c", "f128M_to_f16.c", "f128M_to_f32.c", "f128M_to_f64.c", "f128M_to_extF80M.c", "f128M_roundToInt.c", "f128M_add.c", "f128M_sub.c", "f128M_mul.c", "f128M_mulAdd.c", "f128M_div.c", "f128M_rem.c", "f128M_sqrt.c", "f128M_eq.c", "f128M_le.c", "f128M_lt.c", "f128M_eq_signaling.c", "f128M_le_quiet.c", "f128M_lt_quiet.c", ]; } #[cfg(target_arch = "riscv64")] mod path { pub const primitives: [&str; 31] = [ "s_eq128.c", "s_le128.c", "s_lt128.c", "s_shortShiftLeft128.c", "s_shortShiftRight128.c", "s_shortShiftRightJam64.c", "s_shortShiftRightJam64Extra.c", "s_shortShiftRightJam128.c", "s_shortShiftRightJam128Extra.c", "s_shiftRightJam32.c", "s_shiftRightJam64.c", "s_shiftRightJam64Extra.c", "s_shiftRightJam128.c", "s_shiftRightJam128Extra.c", "s_shiftRightJam256M.c", "s_countLeadingZeros8.c", "s_countLeadingZeros16.c", "s_countLeadingZeros32.c", "s_countLeadingZeros64.c", "s_add128.c", "s_add256M.c", "s_sub128.c", "s_sub256M.c", "s_mul64ByShifted32To128.c", "s_mul64To128.c", "s_mul128By32.c", "s_mul128To256M.c", "s_approxRecip_1Ks.c", "s_approxRecip32_1.c", "s_approxRecipSqrt_1Ks.c", "s_approxRecipSqrt32_1.c", ]; pub const specialize: [&str; 20] = [ "softfloat_raiseFlags.c", "s_f16UIToCommonNaN.c", "s_commonNaNToF16UI.c", "s_propagateNaNF16UI.c", "s_bf16UIToCommonNaN.c", "s_commonNaNToBF16UI.c", "s_f32UIToCommonNaN.c", "s_commonNaNToF32UI.c", "s_propagateNaNF32UI.c", "s_f64UIToCommonNaN.c", "s_commonNaNToF64UI.c", "s_propagateNaNF64UI.c", "extF80M_isSignalingNaN.c", "s_extF80UIToCommonNaN.c", "s_commonNaNToExtF80UI.c", "s_propagateNaNExtF80UI.c", "f128M_isSignalingNaN.c", "s_f128UIToCommonNaN.c", "s_commonNaNToF128UI.c", "s_propagateNaNF128UI.c", ]; pub const others: [&str; 258] = [ "s_roundToUI32.c", "s_roundToUI64.c", "s_roundToI32.c", "s_roundToI64.c", "s_normSubnormalBF16Sig.c", "s_roundPackToBF16.c", "s_normSubnormalF16Sig.c", "s_roundPackToF16.c", "s_normRoundPackToF16.c", "s_addMagsF16.c", "s_subMagsF16.c", "s_mulAddF16.c", "s_normSubnormalF32Sig.c", "s_roundPackToF32.c", "s_normRoundPackToF32.c", "s_addMagsF32.c", "s_subMagsF32.c", "s_mulAddF32.c", "s_normSubnormalF64Sig.c", "s_roundPackToF64.c", "s_normRoundPackToF64.c", "s_addMagsF64.c", "s_subMagsF64.c", "s_mulAddF64.c", "s_normSubnormalExtF80Sig.c", "s_roundPackToExtF80.c", "s_normRoundPackToExtF80.c", "s_addMagsExtF80.c", "s_subMagsExtF80.c", "s_normSubnormalF128Sig.c", "s_roundPackToF128.c", "s_normRoundPackToF128.c", "s_addMagsF128.c", "s_subMagsF128.c", "s_mulAddF128.c", "softfloat_state.c", "ui32_to_f16.c", "ui32_to_f32.c", "ui32_to_f64.c", "ui32_to_extF80.c", "ui32_to_extF80M.c", "ui32_to_f128.c", "ui32_to_f128M.c", "ui64_to_f16.c", "ui64_to_f32.c", "ui64_to_f64.c", "ui64_to_extF80.c", "ui64_to_extF80M.c", "ui64_to_f128.c", "ui64_to_f128M.c", "i32_to_f16.c", "i32_to_f32.c", "i32_to_f64.c", "i32_to_extF80.c", "i32_to_extF80M.c", "i32_to_f128.c", "i32_to_f128M.c", "i64_to_f16.c", "i64_to_f32.c", "i64_to_f64.c", "i64_to_extF80.c", "i64_to_extF80M.c", "i64_to_f128.c", "i64_to_f128M.c", "bf16_isSignalingNaN.c", "bf16_to_f32.c", "f16_to_ui32.c", "f16_to_ui64.c", "f16_to_i32.c", "f16_to_i64.c", "f16_to_ui32_r_minMag.c", "f16_to_ui64_r_minMag.c", "f16_to_i32_r_minMag.c", "f16_to_i64_r_minMag.c", "f16_to_f32.c", "f16_to_f64.c", "f16_to_extF80.c", "f16_to_extF80M.c", "f16_to_f128.c", "f16_to_f128M.c", "f16_roundToInt.c", "f16_add.c", "f16_sub.c", "f16_mul.c", "f16_mulAdd.c", "f16_div.c", "f16_rem.c", "f16_sqrt.c", "f16_eq.c", "f16_le.c", "f16_lt.c", "f16_eq_signaling.c", "f16_le_quiet.c", "f16_lt_quiet.c", "f16_isSignalingNaN.c", "f32_to_ui32.c", "f32_to_ui64.c", "f32_to_i32.c", "f32_to_i64.c", "f32_to_ui32_r_minMag.c", "f32_to_ui64_r_minMag.c", "f32_to_i32_r_minMag.c", "f32_to_i64_r_minMag.c", "f32_to_bf16.c", "f32_to_f16.c", "f32_to_f64.c", "f32_to_extF80.c", "f32_to_extF80M.c", "f32_to_f128.c", "f32_to_f128M.c", "f32_roundToInt.c", "f32_add.c", "f32_sub.c", "f32_mul.c", "f32_mulAdd.c", "f32_div.c", "f32_rem.c", "f32_sqrt.c", "f32_eq.c", "f32_le.c", "f32_lt.c", "f32_eq_signaling.c", "f32_le_quiet.c", "f32_lt_quiet.c", "f32_isSignalingNaN.c", "f64_to_ui32.c", "f64_to_ui64.c", "f64_to_i32.c", "f64_to_i64.c", "f64_to_ui32_r_minMag.c", "f64_to_ui64_r_minMag.c", "f64_to_i32_r_minMag.c", "f64_to_i64_r_minMag.c", "f64_to_f16.c", "f64_to_f32.c", "f64_to_extF80.c", "f64_to_extF80M.c", "f64_to_f128.c", "f64_to_f128M.c", "f64_roundToInt.c", "f64_add.c", "f64_sub.c", "f64_mul.c", "f64_mulAdd.c", "f64_div.c", "f64_rem.c", "f64_sqrt.c", "f64_eq.c", "f64_le.c", "f64_lt.c", "f64_eq_signaling.c", "f64_le_quiet.c", "f64_lt_quiet.c", "f64_isSignalingNaN.c", "extF80_to_ui32.c", "extF80_to_ui64.c", "extF80_to_i32.c", "extF80_to_i64.c", "extF80_to_ui32_r_minMag.c", "extF80_to_ui64_r_minMag.c", "extF80_to_i32_r_minMag.c", "extF80_to_i64_r_minMag.c", "extF80_to_f16.c", "extF80_to_f32.c", "extF80_to_f64.c", "extF80_to_f128.c", "extF80_roundToInt.c", "extF80_add.c", "extF80_sub.c", "extF80_mul.c", "extF80_div.c", "extF80_rem.c", "extF80_sqrt.c", "extF80_eq.c", "extF80_le.c", "extF80_lt.c", "extF80_eq_signaling.c", "extF80_le_quiet.c", "extF80_lt_quiet.c", "extF80_isSignalingNaN.c", "extF80M_to_ui32.c", "extF80M_to_ui64.c", "extF80M_to_i32.c", "extF80M_to_i64.c", "extF80M_to_ui32_r_minMag.c", "extF80M_to_ui64_r_minMag.c", "extF80M_to_i32_r_minMag.c", "extF80M_to_i64_r_minMag.c", "extF80M_to_f16.c", "extF80M_to_f32.c", "extF80M_to_f64.c", "extF80M_to_f128M.c", "extF80M_roundToInt.c", "extF80M_add.c", "extF80M_sub.c", "extF80M_mul.c", "extF80M_div.c", "extF80M_rem.c", "extF80M_sqrt.c", "extF80M_eq.c", "extF80M_le.c", "extF80M_lt.c", "extF80M_eq_signaling.c", "extF80M_le_quiet.c", "extF80M_lt_quiet.c", "f128_to_ui32.c", "f128_to_ui64.c", "f128_to_i32.c", "f128_to_i64.c", "f128_to_ui32_r_minMag.c", "f128_to_ui64_r_minMag.c", "f128_to_i32_r_minMag.c", "f128_to_i64_r_minMag.c", "f128_to_f16.c", "f128_to_f32.c", "f128_to_extF80.c", "f128_to_f64.c", "f128_roundToInt.c", "f128_add.c", "f128_sub.c", "f128_mul.c", "f128_mulAdd.c", "f128_div.c", "f128_rem.c", "f128_sqrt.c", "f128_eq.c", "f128_le.c", "f128_lt.c", "f128_eq_signaling.c", "f128_le_quiet.c", "f128_lt_quiet.c", "f128_isSignalingNaN.c", "f128M_to_ui32.c", "f128M_to_ui64.c", "f128M_to_i32.c", "f128M_to_i64.c", "f128M_to_ui32_r_minMag.c", "f128M_to_ui64_r_minMag.c", "f128M_to_i32_r_minMag.c", "f128M_to_i64_r_minMag.c", "f128M_to_f16.c", "f128M_to_f32.c", "f128M_to_extF80M.c", "f128M_to_f64.c", "f128M_roundToInt.c", "f128M_add.c", "f128M_sub.c", "f128M_mul.c", "f128M_mulAdd.c", "f128M_div.c", "f128M_rem.c", "f128M_sqrt.c", "f128M_eq.c", "f128M_le.c", "f128M_lt.c", "f128M_eq_signaling.c", "f128M_le_quiet.c", "f128M_lt_quiet.c", ]; } fn main() { let mut builder = cc::Build::new(); builder.file("src/c/f16.c"); builder.file("src/c/f32.c"); builder.file("src/c/f64.c"); builder.file("src/c/f128.c"); let root = Path::new("berkeley-softfloat-3"); let source = root.join("source"); let special = if cfg!(any(target_arch = "x86", target_arch = "x86_64")) { source.join("8086-SSE") } else if cfg!(any(target_arch = "arm", target_arch = "aarch64")) { source.join("ARM-VFPv2") } else if cfg!(target_arch = "riscv64") { source.join("RISCV") } else { panic!("not supported arch") }; builder.files(path::primitives.into_iter().map(|s| source.join(s))); builder.files(path::specialize.into_iter().map(|s| special.join(s))); builder.files(path::others.into_iter().map(|s| source.join(s))); builder.include(source.join("include")); // load platform.h builder.include(special); // from MakeFile builder.define("INLINE_LEVEL", Some("5")); if cfg!(target_arch = "x86") { builder.define("SOFTFLOAT_FAST_DIV32TO16", None); builder.define("SOFTFLOAT_FAST_DIV64TO32", None); } else if cfg!(target_arch = "x86_64") { builder.define("SOFTFLOAT_FAST_DIV32TO16", None); builder.define("SOFTFLOAT_FAST_DIV64TO32", None); // TODO: disable when MigWin builder.define("SOFTFLOAT_FAST_INT64", None); } else if cfg!(any(target_arch = "arm", target_arch = "aarch64")) { // no other def } else if cfg!(target_arch = "riscv64") { builder.define("SOFTFLOAT_FAST_DIV32TO16", None); builder.define("SOFTFLOAT_FAST_DIV64TO32", None); builder.define("SOFTFLOAT_FAST_INT64", None); } else { panic!("not supported arch") } // from platform.h let tool = builder.get_compiler(); if tool.is_like_gnu() || tool.is_like_clang() { builder.include("src/c/platform/opts-gnu"); } else { builder.include("src/c/platform/empty"); } // use c99 inline builder.define("INLINE", Some("inline")); builder.define("LITTLEENDIAN", Some("1")); builder.define("SOFTFLOAT_BUILTIN_CLZ", Some("1")); if cfg!(target_arch = "x86") { // no other def } else if cfg!(target_arch = "x86_64") { builder.define("SOFTFLOAT_INTRINSIC_INT128", Some("1")); } else if cfg!(any(target_arch = "arm", target_arch = "aarch64")) { // no other def } else if cfg!(target_arch = "riscv64") { builder.define("SOFTFLOAT_INTRINSIC_INT128", Some("1")); } else { panic!("not supported arch") } // use c11 _Thread_local builder.define("THREAD_LOCAL", Some("_Thread_local")); if env::var("OPT_LEVEL").unwrap() == "0" { builder.opt_level(1); } builder.compile("softfloat"); println!("cc:build-command={:?}", builder.get_compiler().to_command()); }