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