1*84d9c625SLionel Sambuc /* $NetBSD: softfloat-for-gcc.h,v 1.12 2013/08/01 23:21:19 matt Exp $ */ 22fe8fb19SBen Gras 32fe8fb19SBen Gras /* 42fe8fb19SBen Gras * Move private identifiers with external linkage into implementation 52fe8fb19SBen Gras * namespace. -- Klaus Klein <kleink@NetBSD.org>, May 5, 1999 62fe8fb19SBen Gras */ 72fe8fb19SBen Gras #define float_exception_flags _softfloat_float_exception_flags 82fe8fb19SBen Gras #define float_exception_mask _softfloat_float_exception_mask 92fe8fb19SBen Gras #define float_rounding_mode _softfloat_float_rounding_mode 102fe8fb19SBen Gras #define float_raise _softfloat_float_raise 112fe8fb19SBen Gras 122fe8fb19SBen Gras /* The following batch are called by GCC through wrappers */ 132fe8fb19SBen Gras #define float32_eq _softfloat_float32_eq 142fe8fb19SBen Gras #define float32_le _softfloat_float32_le 152fe8fb19SBen Gras #define float32_lt _softfloat_float32_lt 162fe8fb19SBen Gras #define float64_eq _softfloat_float64_eq 172fe8fb19SBen Gras #define float64_le _softfloat_float64_le 182fe8fb19SBen Gras #define float64_lt _softfloat_float64_lt 192fe8fb19SBen Gras #define float128_eq _softfloat_float128_eq 202fe8fb19SBen Gras #define float128_le _softfloat_float128_le 212fe8fb19SBen Gras #define float128_lt _softfloat_float128_lt 222fe8fb19SBen Gras 232fe8fb19SBen Gras /* 242fe8fb19SBen Gras * Macros to define functions with the GCC expected names 252fe8fb19SBen Gras */ 262fe8fb19SBen Gras 272fe8fb19SBen Gras #define float32_add __addsf3 282fe8fb19SBen Gras #define float64_add __adddf3 292fe8fb19SBen Gras #define floatx80_add __addxf3 302fe8fb19SBen Gras #define float128_add __addtf3 312fe8fb19SBen Gras 322fe8fb19SBen Gras #define float32_sub __subsf3 332fe8fb19SBen Gras #define float64_sub __subdf3 342fe8fb19SBen Gras #define floatx80_sub __subxf3 352fe8fb19SBen Gras #define float128_sub __subtf3 362fe8fb19SBen Gras 372fe8fb19SBen Gras #define float32_mul __mulsf3 382fe8fb19SBen Gras #define float64_mul __muldf3 392fe8fb19SBen Gras #define floatx80_mul __mulxf3 402fe8fb19SBen Gras #define float128_mul __multf3 412fe8fb19SBen Gras 422fe8fb19SBen Gras #define float32_div __divsf3 432fe8fb19SBen Gras #define float64_div __divdf3 442fe8fb19SBen Gras #define floatx80_div __divxf3 452fe8fb19SBen Gras #define float128_div __divtf3 462fe8fb19SBen Gras 472fe8fb19SBen Gras #if 0 482fe8fb19SBen Gras #define float32_neg __negsf2 492fe8fb19SBen Gras #define float64_neg __negdf2 502fe8fb19SBen Gras #define floatx80_neg __negxf2 512fe8fb19SBen Gras #define float128_neg __negtf2 522fe8fb19SBen Gras #endif 532fe8fb19SBen Gras 542fe8fb19SBen Gras #define int32_to_float32 __floatsisf 552fe8fb19SBen Gras #define int32_to_float64 __floatsidf 562fe8fb19SBen Gras #define int32_to_floatx80 __floatsixf 572fe8fb19SBen Gras #define int32_to_float128 __floatsitf 582fe8fb19SBen Gras 592fe8fb19SBen Gras #define int64_to_float32 __floatdisf 602fe8fb19SBen Gras #define int64_to_float64 __floatdidf 612fe8fb19SBen Gras #define int64_to_floatx80 __floatdixf 622fe8fb19SBen Gras #define int64_to_float128 __floatditf 632fe8fb19SBen Gras 642fe8fb19SBen Gras #define int128_to_float32 __floattisf 652fe8fb19SBen Gras #define int128_to_float64 __floattidf 662fe8fb19SBen Gras #define int128_to_floatx80 __floattixf 672fe8fb19SBen Gras #define int128_to_float128 __floattitf 682fe8fb19SBen Gras 692fe8fb19SBen Gras #define uint32_to_float32 __floatunsisf 702fe8fb19SBen Gras #define uint32_to_float64 __floatunsidf 712fe8fb19SBen Gras #define uint32_to_floatx80 __floatunsixf 722fe8fb19SBen Gras #define uint32_to_float128 __floatunsitf 732fe8fb19SBen Gras 742fe8fb19SBen Gras #define uint64_to_float32 __floatundisf 752fe8fb19SBen Gras #define uint64_to_float64 __floatundidf 762fe8fb19SBen Gras #define uint64_to_floatx80 __floatundixf 772fe8fb19SBen Gras #define uint64_to_float128 __floatunditf 782fe8fb19SBen Gras 792fe8fb19SBen Gras #define uint128_to_float32 __floatuntisf 802fe8fb19SBen Gras #define uint128_to_float64 __floatuntidf 812fe8fb19SBen Gras #define uint128_to_floatx80 __floatuntixf 822fe8fb19SBen Gras #define uint128_to_float128 __floatuntitf 832fe8fb19SBen Gras 842fe8fb19SBen Gras #define float32_to_int32_round_to_zero __fixsfsi 852fe8fb19SBen Gras #define float64_to_int32_round_to_zero __fixdfsi 862fe8fb19SBen Gras #define floatx80_to_int32_round_to_zero __fixxfsi 872fe8fb19SBen Gras #define float128_to_int32_round_to_zero __fixtfsi 882fe8fb19SBen Gras 892fe8fb19SBen Gras #define float32_to_int64_round_to_zero __fixsfdi 902fe8fb19SBen Gras #define float64_to_int64_round_to_zero __fixdfdi 912fe8fb19SBen Gras #define floatx80_to_int64_round_to_zero __fixxfdi 922fe8fb19SBen Gras #define float128_to_int64_round_to_zero __fixtfdi 932fe8fb19SBen Gras 942fe8fb19SBen Gras #define float32_to_int128_round_to_zero __fixsfti 952fe8fb19SBen Gras #define float64_to_int128_round_to_zero __fixdfti 962fe8fb19SBen Gras #define floatx80_to_int128_round_to_zero __fixxfti 972fe8fb19SBen Gras #define float128_to_int128_round_to_zero __fixtfti 982fe8fb19SBen Gras 992fe8fb19SBen Gras #define float32_to_uint32_round_to_zero __fixunssfsi 1002fe8fb19SBen Gras #define float64_to_uint32_round_to_zero __fixunsdfsi 1012fe8fb19SBen Gras #define floatx80_to_uint32_round_to_zero __fixunsxfsi 1022fe8fb19SBen Gras #define float128_to_uint32_round_to_zero __fixunstfsi 1032fe8fb19SBen Gras 1042fe8fb19SBen Gras #define float32_to_uint64_round_to_zero __fixunssfdi 1052fe8fb19SBen Gras #define float64_to_uint64_round_to_zero __fixunsdfdi 1062fe8fb19SBen Gras #define floatx80_to_uint64_round_to_zero __fixunsxfdi 1072fe8fb19SBen Gras #define float128_to_uint64_round_to_zero __fixunstfdi 1082fe8fb19SBen Gras 1092fe8fb19SBen Gras #define float32_to_uint128_round_to_zero __fixunssfti 1102fe8fb19SBen Gras #define float64_to_uint128_round_to_zero __fixunsdfti 1112fe8fb19SBen Gras #define floatx80_to_uint128_round_to_zero __fixunsxfti 1122fe8fb19SBen Gras #define float128_to_uint128_round_to_zero __fixunstfti 1132fe8fb19SBen Gras 1142fe8fb19SBen Gras #define float32_to_float64 __extendsfdf2 1152fe8fb19SBen Gras #define float32_to_floatx80 __extendsfxf2 1162fe8fb19SBen Gras #define float32_to_float128 __extendsftf2 1172fe8fb19SBen Gras #define float64_to_floatx80 __extenddfxf2 1182fe8fb19SBen Gras #define float64_to_float128 __extenddftf2 1192fe8fb19SBen Gras 1202fe8fb19SBen Gras #define float128_to_float64 __trunctfdf2 1212fe8fb19SBen Gras #define floatx80_to_float64 __truncxfdf2 1222fe8fb19SBen Gras #define float128_to_float32 __trunctfsf2 1232fe8fb19SBen Gras #define floatx80_to_float32 __truncxfsf2 1242fe8fb19SBen Gras #define float64_to_float32 __truncdfsf2 1252fe8fb19SBen Gras 1262fe8fb19SBen Gras #if 0 1272fe8fb19SBen Gras #define float32_cmp __cmpsf2 1282fe8fb19SBen Gras #define float32_unord __unordsf2 1292fe8fb19SBen Gras #define float32_eq __eqsf2 1302fe8fb19SBen Gras #define float32_ne __nesf2 1312fe8fb19SBen Gras #define float32_ge __gesf2 1322fe8fb19SBen Gras #define float32_lt __ltsf2 1332fe8fb19SBen Gras #define float32_le __lesf2 1342fe8fb19SBen Gras #define float32_gt __gtsf2 1352fe8fb19SBen Gras #endif 1362fe8fb19SBen Gras 1372fe8fb19SBen Gras #if 0 1382fe8fb19SBen Gras #define float64_cmp __cmpdf2 1392fe8fb19SBen Gras #define float64_unord __unorddf2 1402fe8fb19SBen Gras #define float64_eq __eqdf2 1412fe8fb19SBen Gras #define float64_ne __nedf2 1422fe8fb19SBen Gras #define float64_ge __gedf2 1432fe8fb19SBen Gras #define float64_lt __ltdf2 1442fe8fb19SBen Gras #define float64_le __ledf2 1452fe8fb19SBen Gras #define float64_gt __gtdf2 1462fe8fb19SBen Gras #endif 1472fe8fb19SBen Gras 1482fe8fb19SBen Gras /* XXX not in libgcc */ 1492fe8fb19SBen Gras #if 1 1502fe8fb19SBen Gras #define floatx80_cmp __cmpxf2 1512fe8fb19SBen Gras #define floatx80_unord __unordxf2 1522fe8fb19SBen Gras #define floatx80_eq __eqxf2 1532fe8fb19SBen Gras #define floatx80_ne __nexf2 1542fe8fb19SBen Gras #define floatx80_ge __gexf2 1552fe8fb19SBen Gras #define floatx80_lt __ltxf2 1562fe8fb19SBen Gras #define floatx80_le __lexf2 1572fe8fb19SBen Gras #define floatx80_gt __gtxf2 1582fe8fb19SBen Gras #endif 1592fe8fb19SBen Gras 1602fe8fb19SBen Gras #if 0 1612fe8fb19SBen Gras #define float128_cmp __cmptf2 1622fe8fb19SBen Gras #define float128_unord __unordtf2 1632fe8fb19SBen Gras #define float128_eq __eqtf2 1642fe8fb19SBen Gras #define float128_ne __netf2 1652fe8fb19SBen Gras #define float128_ge __getf2 1662fe8fb19SBen Gras #define float128_lt __lttf2 1672fe8fb19SBen Gras #define float128_le __letf2 1682fe8fb19SBen Gras #define float128_gt __gttf2 1692fe8fb19SBen Gras #endif 170f14fb602SLionel Sambuc 171f14fb602SLionel Sambuc #ifdef __ARM_EABI__ 172*84d9c625SLionel Sambuc #ifdef __ARM_PCS_VFP 173*84d9c625SLionel Sambuc #include <arm/aeabi.h> 174*84d9c625SLionel Sambuc #endif 175f14fb602SLionel Sambuc #define __addsf3 __aeabi_fadd 176f14fb602SLionel Sambuc #define __adddf3 __aeabi_dadd 177f14fb602SLionel Sambuc 178f14fb602SLionel Sambuc #define __subsf3 __aeabi_fsub 179f14fb602SLionel Sambuc #define __subdf3 __aeabi_dsub 180f14fb602SLionel Sambuc 181f14fb602SLionel Sambuc #define __mulsf3 __aeabi_fmul 182f14fb602SLionel Sambuc #define __muldf3 __aeabi_dmul 183f14fb602SLionel Sambuc 184f14fb602SLionel Sambuc #define __divsf3 __aeabi_fdiv 185f14fb602SLionel Sambuc #define __divdf3 __aeabi_ddiv 186f14fb602SLionel Sambuc 187f14fb602SLionel Sambuc #define __floatsisf __aeabi_i2f 188f14fb602SLionel Sambuc #define __floatsidf __aeabi_i2d 189f14fb602SLionel Sambuc 190f14fb602SLionel Sambuc #define __floatdisf __aeabi_l2f 191f14fb602SLionel Sambuc #define __floatdidf __aeabi_l2d 192f14fb602SLionel Sambuc 193f14fb602SLionel Sambuc #define __floatunsisf __aeabi_ui2f 194f14fb602SLionel Sambuc #define __floatunsidf __aeabi_ui2d 195f14fb602SLionel Sambuc 196f14fb602SLionel Sambuc #define __floatundisf __aeabi_ul2f 197f14fb602SLionel Sambuc #define __floatundidf __aeabi_ul2d 198f14fb602SLionel Sambuc 199f14fb602SLionel Sambuc #define __fixsfsi __aeabi_f2iz 200f14fb602SLionel Sambuc #define __fixdfsi __aeabi_d2iz 201f14fb602SLionel Sambuc 202f14fb602SLionel Sambuc #define __fixsfdi __aeabi_f2lz 203f14fb602SLionel Sambuc #define __fixdfdi __aeabi_d2lz 204f14fb602SLionel Sambuc 205f14fb602SLionel Sambuc #define __fixunssfsi __aeabi_f2uiz 206f14fb602SLionel Sambuc #define __fixunsdfsi __aeabi_d2uiz 207f14fb602SLionel Sambuc 208f14fb602SLionel Sambuc #define __fixunssfdi __aeabi_f2ulz 209f14fb602SLionel Sambuc #define __fixunsdfdi __aeabi_d2ulz 210f14fb602SLionel Sambuc 211f14fb602SLionel Sambuc #define __extendsfdf2 __aeabi_f2d 212f14fb602SLionel Sambuc #define __truncdfsf2 __aeabi_d2f 213f14fb602SLionel Sambuc 214f14fb602SLionel Sambuc #endif /* __ARM_EABI__ */ 215