1 2 /* 3 =============================================================================== 4 5 This C header file is part of TestFloat, Release 2a, a package of programs 6 for testing the correctness of floating-point arithmetic complying to the 7 IEC/IEEE Standard for Floating-Point. 8 9 Written by John R. Hauser. More information is available through the Web 10 page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. 11 12 THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort 13 has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT 14 TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO 15 PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY 16 AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. 17 18 Derivative works are acceptable, even for commercial purposes, so long as 19 (1) they include prominent notice that the work is derivative, and (2) they 20 include prominent notice akin to these four paragraphs for those parts of 21 this code that are retained. 22 23 =============================================================================== 24 */ 25 26 #include <stdio.h> 27 28 extern volatile flag stop; 29 30 extern char *trueName, *testName; 31 extern flag forever, errorStop; 32 extern uint32 maxErrorCount; 33 extern flag checkNaNs; 34 extern int8 *trueFlagsPtr; 35 extern int8 ( *testFlagsFunctionPtr )( void ); 36 extern char *functionName; 37 extern char *roundingPrecisionName, *roundingModeName, *tininessModeName; 38 extern flag anyErrors; 39 40 void writeFunctionName( FILE * ); 41 void exitWithStatus( void ); 42 43 void test_a_int32_z_float32( float32 ( int32 ), float32 ( int32 ) ); 44 void test_a_int32_z_float64( float64 ( int32 ), float64 ( int32 ) ); 45 #ifdef FLOATX80 46 void test_a_int32_z_floatx80( floatx80 ( int32 ), floatx80 ( int32 ) ); 47 #endif 48 #ifdef FLOAT128 49 void test_a_int32_z_float128( float128 ( int32 ), float128 ( int32 ) ); 50 #endif 51 #ifdef BITS64 52 void test_a_int64_z_float32( float32 ( int64 ), float32 ( int64 ) ); 53 void test_a_int64_z_float64( float64 ( int64 ), float64 ( int64 ) ); 54 #ifdef FLOATX80 55 void test_a_int64_z_floatx80( floatx80 ( int64 ), floatx80 ( int64 ) ); 56 #endif 57 #ifdef FLOAT128 58 void test_a_int64_z_float128( float128 ( int64 ), float128 ( int64 ) ); 59 #endif 60 #endif 61 62 void test_a_float32_z_int32( int32 ( float32 ), int32 ( float32 ) ); 63 #ifdef BITS64 64 void test_a_float32_z_int64( int64 ( float32 ), int64 ( float32 ) ); 65 #endif 66 void test_a_float32_z_float64( float64 ( float32 ), float64 ( float32 ) ); 67 #ifdef FLOATX80 68 void test_a_float32_z_floatx80( floatx80 ( float32 ), floatx80 ( float32 ) ); 69 #endif 70 #ifdef FLOAT128 71 void test_a_float32_z_float128( float128 ( float32 ), float128 ( float32 ) ); 72 #endif 73 void test_az_float32( float32 ( float32 ), float32 ( float32 ) ); 74 void 75 test_ab_float32_z_flag( 76 flag ( float32, float32 ), flag ( float32, float32 ) ); 77 void 78 test_abz_float32( 79 float32 ( float32, float32 ), float32 ( float32, float32 ) ); 80 81 void test_a_float64_z_int32( int32 ( float64 ), int32 ( float64 ) ); 82 #ifdef BITS64 83 void test_a_float64_z_int64( int64 ( float64 ), int64 ( float64 ) ); 84 #endif 85 void test_a_float64_z_float32( float32 ( float64 ), float32 ( float64 ) ); 86 #ifdef FLOATX80 87 void test_a_float64_z_floatx80( floatx80 ( float64 ), floatx80 ( float64 ) ); 88 #endif 89 #ifdef FLOAT128 90 void test_a_float64_z_float128( float128 ( float64 ), float128 ( float64 ) ); 91 #endif 92 void test_az_float64( float64 ( float64 ), float64 ( float64 ) ); 93 void 94 test_ab_float64_z_flag( 95 flag ( float64, float64 ), flag ( float64, float64 ) ); 96 void 97 test_abz_float64( 98 float64 ( float64, float64 ), float64 ( float64, float64 ) ); 99 100 #ifdef FLOATX80 101 102 void test_a_floatx80_z_int32( int32 ( floatx80 ), int32 ( floatx80 ) ); 103 #ifdef BITS64 104 void test_a_floatx80_z_int64( int64 ( floatx80 ), int64 ( floatx80 ) ); 105 #endif 106 void test_a_floatx80_z_float32( float32 ( floatx80 ), float32 ( floatx80 ) ); 107 void test_a_floatx80_z_float64( float64 ( floatx80 ), float64 ( floatx80 ) ); 108 #ifdef FLOAT128 109 void 110 test_a_floatx80_z_float128( float128 ( floatx80 ), float128 ( floatx80 ) ); 111 #endif 112 void test_az_floatx80( floatx80 ( floatx80 ), floatx80 ( floatx80 ) ); 113 void 114 test_ab_floatx80_z_flag( 115 flag ( floatx80, floatx80 ), flag ( floatx80, floatx80 ) ); 116 void 117 test_abz_floatx80( 118 floatx80 ( floatx80, floatx80 ), floatx80 ( floatx80, floatx80 ) ); 119 120 #endif 121 122 #ifdef FLOAT128 123 124 void test_a_float128_z_int32( int32 ( float128 ), int32 ( float128 ) ); 125 #ifdef BITS64 126 void test_a_float128_z_int64( int64 ( float128 ), int64 ( float128 ) ); 127 #endif 128 void test_a_float128_z_float32( float32 ( float128 ), float32 ( float128 ) ); 129 void test_a_float128_z_float64( float64 ( float128 ), float64 ( float128 ) ); 130 #ifdef FLOATX80 131 void 132 test_a_float128_z_floatx80( floatx80 ( float128 ), floatx80 ( float128 ) ); 133 #endif 134 void test_az_float128( float128 ( float128 ), float128 ( float128 ) ); 135 void 136 test_ab_float128_z_flag( 137 flag ( float128, float128 ), flag ( float128, float128 ) ); 138 void 139 test_abz_float128( 140 float128 ( float128, float128 ), float128 ( float128, float128 ) ); 141 142 #endif 143 144