Home | History | Annotate | Line # | Download | only in softfloat
softfloat-for-gcc.h revision 1.9.2.2
      1  1.9.2.1    tls /* $NetBSD: softfloat-for-gcc.h,v 1.9.2.2 2014/08/20 00:02:15 tls Exp $ */
      2      1.1  bjh21 
      3      1.1  bjh21 /*
      4      1.1  bjh21  * Move private identifiers with external linkage into implementation
      5      1.6   salo  * namespace.  -- Klaus Klein <kleink (at) NetBSD.org>, May 5, 1999
      6      1.1  bjh21  */
      7      1.1  bjh21 #define float_exception_flags	_softfloat_float_exception_flags
      8      1.5  bjh21 #define float_exception_mask	_softfloat_float_exception_mask
      9      1.1  bjh21 #define float_rounding_mode	_softfloat_float_rounding_mode
     10      1.1  bjh21 #define float_raise		_softfloat_float_raise
     11      1.8   matt 
     12      1.1  bjh21 /* The following batch are called by GCC through wrappers */
     13      1.1  bjh21 #define float32_eq		_softfloat_float32_eq
     14      1.1  bjh21 #define float32_le		_softfloat_float32_le
     15      1.1  bjh21 #define float32_lt		_softfloat_float32_lt
     16      1.1  bjh21 #define float64_eq		_softfloat_float64_eq
     17      1.1  bjh21 #define float64_le		_softfloat_float64_le
     18      1.1  bjh21 #define float64_lt		_softfloat_float64_lt
     19      1.8   matt #define float128_eq		_softfloat_float128_eq
     20      1.8   matt #define float128_le		_softfloat_float128_le
     21      1.8   matt #define float128_lt		_softfloat_float128_lt
     22      1.1  bjh21 
     23      1.1  bjh21 /*
     24      1.1  bjh21  * Macros to define functions with the GCC expected names
     25      1.1  bjh21  */
     26      1.1  bjh21 
     27      1.1  bjh21 #define float32_add			__addsf3
     28      1.1  bjh21 #define float64_add			__adddf3
     29      1.7   jmmv #define floatx80_add			__addxf3
     30      1.8   matt #define float128_add			__addtf3
     31      1.8   matt 
     32      1.1  bjh21 #define float32_sub			__subsf3
     33      1.1  bjh21 #define float64_sub			__subdf3
     34      1.7   jmmv #define floatx80_sub			__subxf3
     35      1.8   matt #define float128_sub			__subtf3
     36      1.8   matt 
     37      1.1  bjh21 #define float32_mul			__mulsf3
     38      1.1  bjh21 #define float64_mul			__muldf3
     39      1.7   jmmv #define floatx80_mul			__mulxf3
     40      1.8   matt #define float128_mul			__multf3
     41      1.8   matt 
     42      1.1  bjh21 #define float32_div			__divsf3
     43      1.1  bjh21 #define float64_div			__divdf3
     44      1.7   jmmv #define floatx80_div			__divxf3
     45      1.8   matt #define float128_div			__divtf3
     46      1.8   matt 
     47      1.8   matt #if 0
     48      1.8   matt #define float32_neg			__negsf2
     49      1.8   matt #define float64_neg			__negdf2
     50      1.8   matt #define floatx80_neg			__negxf2
     51      1.8   matt #define float128_neg			__negtf2
     52      1.8   matt #endif
     53      1.8   matt 
     54      1.1  bjh21 #define int32_to_float32		__floatsisf
     55      1.1  bjh21 #define int32_to_float64		__floatsidf
     56      1.7   jmmv #define int32_to_floatx80		__floatsixf
     57      1.8   matt #define int32_to_float128		__floatsitf
     58      1.8   matt 
     59      1.1  bjh21 #define int64_to_float32		__floatdisf
     60      1.1  bjh21 #define int64_to_float64		__floatdidf
     61      1.7   jmmv #define int64_to_floatx80		__floatdixf
     62      1.8   matt #define int64_to_float128		__floatditf
     63      1.8   matt 
     64      1.8   matt #define int128_to_float32		__floattisf
     65      1.8   matt #define int128_to_float64		__floattidf
     66      1.8   matt #define int128_to_floatx80		__floattixf
     67      1.8   matt #define int128_to_float128		__floattitf
     68      1.8   matt 
     69      1.8   matt #define uint32_to_float32		__floatunsisf
     70      1.8   matt #define uint32_to_float64		__floatunsidf
     71      1.8   matt #define uint32_to_floatx80		__floatunsixf
     72      1.8   matt #define uint32_to_float128		__floatunsitf
     73      1.8   matt 
     74      1.8   matt #define uint64_to_float32		__floatundisf
     75      1.8   matt #define uint64_to_float64		__floatundidf
     76      1.8   matt #define uint64_to_floatx80		__floatundixf
     77      1.8   matt #define uint64_to_float128		__floatunditf
     78      1.8   matt 
     79      1.8   matt #define uint128_to_float32		__floatuntisf
     80      1.8   matt #define uint128_to_float64		__floatuntidf
     81      1.8   matt #define uint128_to_floatx80		__floatuntixf
     82      1.8   matt #define uint128_to_float128		__floatuntitf
     83      1.8   matt 
     84      1.1  bjh21 #define float32_to_int32_round_to_zero	__fixsfsi
     85      1.1  bjh21 #define float64_to_int32_round_to_zero	__fixdfsi
     86      1.7   jmmv #define floatx80_to_int32_round_to_zero __fixxfsi
     87      1.8   matt #define float128_to_int32_round_to_zero __fixtfsi
     88      1.8   matt 
     89      1.1  bjh21 #define float32_to_int64_round_to_zero	__fixsfdi
     90      1.1  bjh21 #define float64_to_int64_round_to_zero	__fixdfdi
     91      1.8   matt #define floatx80_to_int64_round_to_zero	__fixxfdi
     92      1.8   matt #define float128_to_int64_round_to_zero	__fixtfdi
     93      1.8   matt 
     94      1.8   matt #define float32_to_int128_round_to_zero __fixsfti
     95      1.8   matt #define float64_to_int128_round_to_zero __fixdfti
     96      1.8   matt #define floatx80_to_int128_round_to_zero __fixxfti
     97      1.8   matt #define float128_to_int128_round_to_zero __fixtfti
     98      1.8   matt 
     99      1.4  bjh21 #define float32_to_uint32_round_to_zero	__fixunssfsi
    100      1.4  bjh21 #define float64_to_uint32_round_to_zero	__fixunsdfsi
    101      1.8   matt #define floatx80_to_uint32_round_to_zero	__fixunsxfsi
    102      1.8   matt #define float128_to_uint32_round_to_zero	__fixunstfsi
    103      1.8   matt 
    104      1.8   matt #define float32_to_uint64_round_to_zero	__fixunssfdi
    105      1.8   matt #define float64_to_uint64_round_to_zero	__fixunsdfdi
    106      1.8   matt #define floatx80_to_uint64_round_to_zero	__fixunsxfdi
    107      1.8   matt #define float128_to_uint64_round_to_zero	__fixunstfdi
    108      1.8   matt 
    109      1.8   matt #define float32_to_uint128_round_to_zero	__fixunssfti
    110      1.8   matt #define float64_to_uint128_round_to_zero	__fixunsdfti
    111      1.8   matt #define floatx80_to_uint128_round_to_zero	__fixunsxfti
    112      1.8   matt #define float128_to_uint128_round_to_zero	__fixunstfti
    113      1.8   matt 
    114      1.1  bjh21 #define float32_to_float64		__extendsfdf2
    115      1.8   matt #define float32_to_floatx80		__extendsfxf2
    116      1.8   matt #define float32_to_float128		__extendsftf2
    117      1.7   jmmv #define float64_to_floatx80		__extenddfxf2
    118      1.8   matt #define float64_to_float128		__extenddftf2
    119      1.8   matt 
    120      1.8   matt #define float128_to_float64		__trunctfdf2
    121      1.7   jmmv #define floatx80_to_float64		__truncxfdf2
    122      1.8   matt #define float128_to_float32		__trunctfsf2
    123      1.7   jmmv #define floatx80_to_float32		__truncxfsf2
    124      1.8   matt #define float64_to_float32		__truncdfsf2
    125      1.8   matt 
    126      1.8   matt #if 0
    127      1.8   matt #define float32_cmp			__cmpsf2
    128      1.8   matt #define float32_unord			__unordsf2
    129      1.8   matt #define float32_eq			__eqsf2
    130      1.8   matt #define float32_ne			__nesf2
    131      1.8   matt #define float32_ge			__gesf2
    132      1.8   matt #define float32_lt			__ltsf2
    133      1.8   matt #define float32_le			__lesf2
    134      1.8   matt #define float32_gt			__gtsf2
    135      1.8   matt #endif
    136      1.8   matt 
    137      1.8   matt #if 0
    138      1.8   matt #define float64_cmp			__cmpdf2
    139      1.8   matt #define float64_unord			__unorddf2
    140      1.8   matt #define float64_eq			__eqdf2
    141      1.8   matt #define float64_ne			__nedf2
    142      1.8   matt #define float64_ge			__gedf2
    143      1.8   matt #define float64_lt			__ltdf2
    144      1.8   matt #define float64_le			__ledf2
    145      1.8   matt #define float64_gt			__gtdf2
    146      1.8   matt #endif
    147      1.7   jmmv 
    148      1.8   matt /* XXX not in libgcc */
    149      1.8   matt #if 1
    150      1.8   matt #define floatx80_cmp			__cmpxf2
    151      1.8   matt #define floatx80_unord			__unordxf2
    152      1.8   matt #define floatx80_eq			__eqxf2
    153      1.8   matt #define floatx80_ne			__nexf2
    154      1.8   matt #define floatx80_ge			__gexf2
    155      1.7   jmmv #define floatx80_lt			__ltxf2
    156      1.7   jmmv #define floatx80_le			__lexf2
    157      1.8   matt #define floatx80_gt			__gtxf2
    158      1.8   matt #endif
    159      1.8   matt 
    160      1.8   matt #if 0
    161      1.8   matt #define float128_cmp			__cmptf2
    162      1.8   matt #define float128_unord			__unordtf2
    163      1.8   matt #define float128_eq			__eqtf2
    164      1.8   matt #define float128_ne			__netf2
    165      1.8   matt #define float128_ge			__getf2
    166      1.8   matt #define float128_lt			__lttf2
    167      1.8   matt #define float128_le			__letf2
    168      1.8   matt #define float128_gt			__gttf2
    169      1.8   matt #endif
    170      1.9   matt 
    171      1.9   matt #ifdef __ARM_EABI__
    172  1.9.2.2    tls #ifdef __ARM_PCS_VFP
    173  1.9.2.2    tls #include <arm/aeabi.h>
    174  1.9.2.2    tls #endif
    175      1.9   matt #define __addsf3			__aeabi_fadd
    176      1.9   matt #define __adddf3			__aeabi_dadd
    177      1.9   matt 
    178      1.9   matt #define __subsf3			__aeabi_fsub
    179      1.9   matt #define __subdf3			__aeabi_dsub
    180      1.9   matt 
    181      1.9   matt #define __mulsf3			__aeabi_fmul
    182      1.9   matt #define __muldf3			__aeabi_dmul
    183      1.9   matt 
    184      1.9   matt #define __divsf3			__aeabi_fdiv
    185      1.9   matt #define __divdf3			__aeabi_ddiv
    186      1.9   matt 
    187      1.9   matt #define __floatsisf			__aeabi_i2f
    188      1.9   matt #define __floatsidf			__aeabi_i2d
    189      1.9   matt 
    190      1.9   matt #define __floatdisf			__aeabi_l2f
    191      1.9   matt #define __floatdidf			__aeabi_l2d
    192      1.9   matt 
    193      1.9   matt #define __floatunsisf			__aeabi_ui2f
    194      1.9   matt #define __floatunsidf			__aeabi_ui2d
    195      1.9   matt 
    196      1.9   matt #define __floatundisf			__aeabi_ul2f
    197      1.9   matt #define __floatundidf			__aeabi_ul2d
    198      1.9   matt 
    199      1.9   matt #define __fixsfsi			__aeabi_f2iz
    200      1.9   matt #define __fixdfsi			__aeabi_d2iz
    201      1.9   matt 
    202      1.9   matt #define __fixsfdi			__aeabi_f2lz
    203      1.9   matt #define __fixdfdi			__aeabi_d2lz
    204      1.9   matt 
    205      1.9   matt #define __fixunssfsi			__aeabi_f2uiz
    206      1.9   matt #define __fixunsdfsi			__aeabi_d2uiz
    207      1.9   matt 
    208      1.9   matt #define __fixunssfdi			__aeabi_f2ulz
    209      1.9   matt #define __fixunsdfdi			__aeabi_d2ulz
    210      1.9   matt 
    211      1.9   matt #define __extendsfdf2			__aeabi_f2d
    212      1.9   matt #define __truncdfsf2			__aeabi_d2f
    213      1.9   matt 
    214      1.9   matt #endif /* __ARM_EABI__ */
    215