1206917Smarius 2206917Smarius/* 3206917Smarius=============================================================================== 4206917Smarius 5206917SmariusThis C header file is part of TestFloat, Release 2a, a package of programs 6206917Smariusfor testing the correctness of floating-point arithmetic complying to the 7206917SmariusIEC/IEEE Standard for Floating-Point. 8206917Smarius 9206917SmariusWritten by John R. Hauser. More information is available through the Web 10206917Smariuspage `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. 11206917Smarius 12206917SmariusTHIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort 13206917Smariushas been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT 14206917SmariusTIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO 15206917SmariusPERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY 16206917SmariusAND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. 17206917Smarius 18206917SmariusDerivative works are acceptable, even for commercial purposes, so long as 19206917Smarius(1) they include prominent notice that the work is derivative, and (2) they 20206917Smariusinclude prominent notice akin to these four paragraphs for those parts of 21206917Smariusthis code that are retained. 22206917Smarius 23206917Smarius=============================================================================== 24206917Smarius*/ 25206917Smarius 26206917Smariusextern int8 slow_float_rounding_mode; 27206917Smariusextern int8 slow_float_exception_flags; 28206917Smariusextern int8 slow_float_detect_tininess; 29206917Smarius#ifdef FLOATX80 30206917Smariusextern int8 slow_floatx80_rounding_precision; 31206917Smarius#endif 32206917Smarius 33206917Smariusfloat32 slow_int32_to_float32( int32 ); 34206917Smariusfloat64 slow_int32_to_float64( int32 ); 35206917Smarius#ifdef FLOATX80 36206917Smariusfloatx80 slow_int32_to_floatx80( int32 ); 37206917Smarius#endif 38206917Smarius#ifdef FLOAT128 39206917Smariusfloat128 slow_int32_to_float128( int32 ); 40206917Smarius#endif 41206917Smarius#ifdef BITS64 42206917Smariusfloat32 slow_int64_to_float32( int64 ); 43206917Smariusfloat64 slow_int64_to_float64( int64 ); 44206917Smarius#ifdef FLOATX80 45206917Smariusfloatx80 slow_int64_to_floatx80( int64 ); 46206917Smarius#endif 47206917Smarius#ifdef FLOAT128 48206917Smariusfloat128 slow_int64_to_float128( int64 ); 49206917Smarius#endif 50206917Smarius#endif 51206917Smarius 52206917Smariusint32 slow_float32_to_int32( float32 ); 53206917Smariusint32 slow_float32_to_int32_round_to_zero( float32 ); 54206917Smarius#ifdef BITS64 55206917Smariusint64 slow_float32_to_int64( float32 ); 56206917Smariusint64 slow_float32_to_int64_round_to_zero( float32 ); 57206917Smarius#endif 58206917Smariusfloat64 slow_float32_to_float64( float32 ); 59206917Smarius#ifdef FLOATX80 60206917Smariusfloatx80 slow_float32_to_floatx80( float32 ); 61206917Smarius#endif 62206917Smarius#ifdef FLOAT128 63206917Smariusfloat128 slow_float32_to_float128( float32 ); 64206917Smarius#endif 65206917Smarius 66206917Smariusfloat32 slow_float32_round_to_int( float32 ); 67206917Smariusfloat32 slow_float32_add( float32, float32 ); 68206917Smariusfloat32 slow_float32_sub( float32, float32 ); 69206917Smariusfloat32 slow_float32_mul( float32, float32 ); 70206917Smariusfloat32 slow_float32_div( float32, float32 ); 71206917Smariusfloat32 slow_float32_rem( float32, float32 ); 72206917Smariusfloat32 slow_float32_sqrt( float32 ); 73206917Smariusflag slow_float32_eq( float32, float32 ); 74206917Smariusflag slow_float32_le( float32, float32 ); 75206917Smariusflag slow_float32_lt( float32, float32 ); 76206917Smariusflag slow_float32_eq_signaling( float32, float32 ); 77206917Smariusflag slow_float32_le_quiet( float32, float32 ); 78206917Smariusflag slow_float32_lt_quiet( float32, float32 ); 79206917Smarius 80206917Smariusint32 slow_float64_to_int32( float64 ); 81206917Smariusint32 slow_float64_to_int32_round_to_zero( float64 ); 82206917Smarius#ifdef BITS64 83206917Smariusint64 slow_float64_to_int64( float64 ); 84206917Smariusint64 slow_float64_to_int64_round_to_zero( float64 ); 85206917Smarius#endif 86206917Smariusfloat32 slow_float64_to_float32( float64 ); 87206917Smarius#ifdef FLOATX80 88206917Smariusfloatx80 slow_float64_to_floatx80( float64 ); 89206917Smarius#endif 90206917Smarius#ifdef FLOAT128 91206917Smariusfloat128 slow_float64_to_float128( float64 ); 92206917Smarius#endif 93206917Smarius 94206917Smariusfloat64 slow_float64_round_to_int( float64 ); 95206917Smariusfloat64 slow_float64_add( float64, float64 ); 96206917Smariusfloat64 slow_float64_sub( float64, float64 ); 97206917Smariusfloat64 slow_float64_mul( float64, float64 ); 98206917Smariusfloat64 slow_float64_div( float64, float64 ); 99206917Smariusfloat64 slow_float64_rem( float64, float64 ); 100206917Smariusfloat64 slow_float64_sqrt( float64 ); 101206917Smariusflag slow_float64_eq( float64, float64 ); 102206917Smariusflag slow_float64_le( float64, float64 ); 103206917Smariusflag slow_float64_lt( float64, float64 ); 104206917Smariusflag slow_float64_eq_signaling( float64, float64 ); 105206917Smariusflag slow_float64_le_quiet( float64, float64 ); 106206917Smariusflag slow_float64_lt_quiet( float64, float64 ); 107206917Smarius 108206917Smarius#ifdef FLOATX80 109206917Smarius 110206917Smariusint32 slow_floatx80_to_int32( floatx80 ); 111206917Smariusint32 slow_floatx80_to_int32_round_to_zero( floatx80 ); 112206917Smarius#ifdef BITS64 113206917Smariusint64 slow_floatx80_to_int64( floatx80 ); 114206917Smariusint64 slow_floatx80_to_int64_round_to_zero( floatx80 ); 115206917Smarius#endif 116206917Smariusfloat32 slow_floatx80_to_float32( floatx80 ); 117206917Smariusfloat64 slow_floatx80_to_float64( floatx80 ); 118206917Smarius#ifdef FLOAT128 119206917Smariusfloat128 slow_floatx80_to_float128( floatx80 ); 120206917Smarius#endif 121206917Smarius 122206917Smariusfloatx80 slow_floatx80_round_to_int( floatx80 ); 123206917Smariusfloatx80 slow_floatx80_add( floatx80, floatx80 ); 124206917Smariusfloatx80 slow_floatx80_sub( floatx80, floatx80 ); 125206917Smariusfloatx80 slow_floatx80_mul( floatx80, floatx80 ); 126206917Smariusfloatx80 slow_floatx80_div( floatx80, floatx80 ); 127206917Smariusfloatx80 slow_floatx80_rem( floatx80, floatx80 ); 128206917Smariusfloatx80 slow_floatx80_sqrt( floatx80 ); 129206917Smariusflag slow_floatx80_eq( floatx80, floatx80 ); 130206917Smariusflag slow_floatx80_le( floatx80, floatx80 ); 131206917Smariusflag slow_floatx80_lt( floatx80, floatx80 ); 132206917Smariusflag slow_floatx80_eq_signaling( floatx80, floatx80 ); 133206917Smariusflag slow_floatx80_le_quiet( floatx80, floatx80 ); 134206917Smariusflag slow_floatx80_lt_quiet( floatx80, floatx80 ); 135206917Smarius 136206917Smarius#endif 137206917Smarius 138206917Smarius#ifdef FLOAT128 139206917Smarius 140206917Smariusint32 slow_float128_to_int32( float128 ); 141206917Smariusint32 slow_float128_to_int32_round_to_zero( float128 ); 142206917Smarius#ifdef BITS64 143206917Smariusint64 slow_float128_to_int64( float128 ); 144206917Smariusint64 slow_float128_to_int64_round_to_zero( float128 ); 145206917Smarius#endif 146206917Smariusfloat32 slow_float128_to_float32( float128 ); 147206917Smariusfloat64 slow_float128_to_float64( float128 ); 148206917Smarius#ifdef FLOATX80 149206917Smariusfloatx80 slow_float128_to_floatx80( float128 ); 150206917Smarius#endif 151206917Smarius 152206917Smariusfloat128 slow_float128_round_to_int( float128 ); 153206917Smariusfloat128 slow_float128_add( float128, float128 ); 154206917Smariusfloat128 slow_float128_sub( float128, float128 ); 155206917Smariusfloat128 slow_float128_mul( float128, float128 ); 156206917Smariusfloat128 slow_float128_div( float128, float128 ); 157206917Smariusfloat128 slow_float128_rem( float128, float128 ); 158206917Smariusfloat128 slow_float128_sqrt( float128 ); 159206917Smariusflag slow_float128_eq( float128, float128 ); 160206917Smariusflag slow_float128_le( float128, float128 ); 161206917Smariusflag slow_float128_lt( float128, float128 ); 162206917Smariusflag slow_float128_eq_signaling( float128, float128 ); 163206917Smariusflag slow_float128_le_quiet( float128, float128 ); 164206917Smariusflag slow_float128_lt_quiet( float128, float128 ); 165206917Smarius 166206917Smarius#endif 167206917Smarius 168