Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Original post-\r-rip include files for TestFloat-2a

  • Loading branch information...
commit 4ae71d86de8974cb2e7bf2e3665a3a9d13e8fdee 1 parent 477a19d
ross authored
29 regress/lib/libc/ieeefp/testfloat/include/fail.h
... ... @@ -0,0 +1,29 @@
  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 +extern char *fail_programName;
  27 +
  28 +void fail( const char *, ... );
  29 +
32 regress/lib/libc/ieeefp/testfloat/include/random.h
... ... @@ -0,0 +1,32 @@
  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 +uint8 randomUint8( void );
  27 +uint16 randomUint16( void );
  28 +uint32 randomUint32( void );
  29 +#ifdef BITS64
  30 +uint64 randomUint64( void );
  31 +#endif
  32 +
33 regress/lib/libc/ieeefp/testfloat/include/systflags.h
... ... @@ -0,0 +1,33 @@
  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 +/*
  27 +-------------------------------------------------------------------------------
  28 +Target-specific function for clearing the system's IEC/IEEE floating-point
  29 +exception flags. The previous value of the flags is returned.
  30 +-------------------------------------------------------------------------------
  31 +*/
  32 +int8 syst_float_flags_clear( void );
  33 +
233 regress/lib/libc/ieeefp/testfloat/include/systfloat.h
... ... @@ -0,0 +1,233 @@
  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 +/*
  27 +-------------------------------------------------------------------------------
  28 +The following macros are defined to indicate that the corresponding
  29 +functions exist.
  30 +-------------------------------------------------------------------------------
  31 +*/
  32 +#define SYST_INT32_TO_FLOAT32
  33 +#define SYST_INT32_TO_FLOAT64
  34 +#ifdef BITS64
  35 +#define SYST_INT64_TO_FLOAT32
  36 +#define SYST_INT64_TO_FLOAT64
  37 +#endif
  38 +#define SYST_FLOAT32_TO_INT32_ROUND_TO_ZERO
  39 +#ifdef BITS64
  40 +#define SYST_FLOAT32_TO_INT64_ROUND_TO_ZERO
  41 +#endif
  42 +#define SYST_FLOAT32_TO_FLOAT64
  43 +#define SYST_FLOAT32_ADD
  44 +#define SYST_FLOAT32_SUB
  45 +#define SYST_FLOAT32_MUL
  46 +#define SYST_FLOAT32_DIV
  47 +#define SYST_FLOAT32_EQ
  48 +#define SYST_FLOAT32_LE
  49 +#define SYST_FLOAT32_LT
  50 +#define SYST_FLOAT64_TO_INT32_ROUND_TO_ZERO
  51 +#ifdef BITS64
  52 +#define SYST_FLOAT64_TO_INT64_ROUND_TO_ZERO
  53 +#endif
  54 +#define SYST_FLOAT64_TO_FLOAT32
  55 +#define SYST_FLOAT64_ADD
  56 +#define SYST_FLOAT64_SUB
  57 +#define SYST_FLOAT64_MUL
  58 +#define SYST_FLOAT64_DIV
  59 +#define SYST_FLOAT64_SQRT
  60 +#define SYST_FLOAT64_EQ
  61 +#define SYST_FLOAT64_LE
  62 +#define SYST_FLOAT64_LT
  63 +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 )
  64 +#define SYST_INT32_TO_FLOATX80
  65 +#ifdef BITS64
  66 +#define SYST_INT64_TO_FLOATX80
  67 +#endif
  68 +#define SYST_FLOAT32_TO_FLOATX80
  69 +#define SYST_FLOAT64_TO_FLOATX80
  70 +#define SYST_FLOATX80_TO_INT32_ROUND_TO_ZERO
  71 +#ifdef BITS64
  72 +#define SYST_FLOATX80_TO_INT64_ROUND_TO_ZERO
  73 +#endif
  74 +#define SYST_FLOATX80_TO_FLOAT32
  75 +#define SYST_FLOATX80_TO_FLOAT64
  76 +#define SYST_FLOATX80_ADD
  77 +#define SYST_FLOATX80_SUB
  78 +#define SYST_FLOATX80_MUL
  79 +#define SYST_FLOATX80_DIV
  80 +#define SYST_FLOATX80_EQ
  81 +#define SYST_FLOATX80_LE
  82 +#define SYST_FLOATX80_LT
  83 +#endif
  84 +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 )
  85 +#define SYST_INT32_TO_FLOAT128
  86 +#ifdef BITS64
  87 +#define SYST_INT64_TO_FLOAT128
  88 +#endif
  89 +#define SYST_FLOAT32_TO_FLOAT128
  90 +#define SYST_FLOAT64_TO_FLOAT128
  91 +#define SYST_FLOAT128_TO_INT32_ROUND_TO_ZERO
  92 +#ifdef BITS64
  93 +#define SYST_FLOAT128_TO_INT64_ROUND_TO_ZERO
  94 +#endif
  95 +#define SYST_FLOAT128_TO_FLOAT32
  96 +#define SYST_FLOAT128_TO_FLOAT64
  97 +#define SYST_FLOAT128_ADD
  98 +#define SYST_FLOAT128_SUB
  99 +#define SYST_FLOAT128_MUL
  100 +#define SYST_FLOAT128_DIV
  101 +#define SYST_FLOAT128_EQ
  102 +#define SYST_FLOAT128_LE
  103 +#define SYST_FLOAT128_LT
  104 +#endif
  105 +
  106 +/*
  107 +-------------------------------------------------------------------------------
  108 +System function declarations. (Some of these functions may not exist.)
  109 +-------------------------------------------------------------------------------
  110 +*/
  111 +float32 syst_int32_to_float32( int32 );
  112 +float64 syst_int32_to_float64( int32 );
  113 +#ifdef FLOATX80
  114 +floatx80 syst_int32_to_floatx80( int32 );
  115 +#endif
  116 +#ifdef FLOAT128
  117 +float128 syst_int32_to_float128( int32 );
  118 +#endif
  119 +#ifdef BITS64
  120 +float32 syst_int64_to_float32( int64 );
  121 +float64 syst_int64_to_float64( int64 );
  122 +#ifdef FLOATX80
  123 +floatx80 syst_int64_to_floatx80( int64 );
  124 +#endif
  125 +#ifdef FLOAT128
  126 +float128 syst_int64_to_float128( int64 );
  127 +#endif
  128 +#endif
  129 +int32 syst_float32_to_int32( float32 );
  130 +int32 syst_float32_to_int32_round_to_zero( float32 );
  131 +#ifdef BITS64
  132 +int64 syst_float32_to_int64( float32 );
  133 +int64 syst_float32_to_int64_round_to_zero( float32 );
  134 +#endif
  135 +float64 syst_float32_to_float64( float32 );
  136 +#ifdef FLOATX80
  137 +floatx80 syst_float32_to_floatx80( float32 );
  138 +#endif
  139 +#ifdef FLOAT128
  140 +float128 syst_float32_to_float128( float32 );
  141 +#endif
  142 +float32 syst_float32_round_to_int( float32 );
  143 +float32 syst_float32_add( float32, float32 );
  144 +float32 syst_float32_sub( float32, float32 );
  145 +float32 syst_float32_mul( float32, float32 );
  146 +float32 syst_float32_div( float32, float32 );
  147 +float32 syst_float32_rem( float32, float32 );
  148 +float32 syst_float32_sqrt( float32 );
  149 +flag syst_float32_eq( float32, float32 );
  150 +flag syst_float32_le( float32, float32 );
  151 +flag syst_float32_lt( float32, float32 );
  152 +flag syst_float32_eq_signaling( float32, float32 );
  153 +flag syst_float32_le_quiet( float32, float32 );
  154 +flag syst_float32_lt_quiet( float32, float32 );
  155 +int32 syst_float64_to_int32( float64 );
  156 +int32 syst_float64_to_int32_round_to_zero( float64 );
  157 +#ifdef BITS64
  158 +int64 syst_float64_to_int64( float64 );
  159 +int64 syst_float64_to_int64_round_to_zero( float64 );
  160 +#endif
  161 +float32 syst_float64_to_float32( float64 );
  162 +#ifdef FLOATX80
  163 +floatx80 syst_float64_to_floatx80( float64 );
  164 +#endif
  165 +#ifdef FLOAT128
  166 +float128 syst_float64_to_float128( float64 );
  167 +#endif
  168 +float64 syst_float64_round_to_int( float64 );
  169 +float64 syst_float64_add( float64, float64 );
  170 +float64 syst_float64_sub( float64, float64 );
  171 +float64 syst_float64_mul( float64, float64 );
  172 +float64 syst_float64_div( float64, float64 );
  173 +float64 syst_float64_rem( float64, float64 );
  174 +float64 syst_float64_sqrt( float64 );
  175 +flag syst_float64_eq( float64, float64 );
  176 +flag syst_float64_le( float64, float64 );
  177 +flag syst_float64_lt( float64, float64 );
  178 +flag syst_float64_eq_signaling( float64, float64 );
  179 +flag syst_float64_le_quiet( float64, float64 );
  180 +flag syst_float64_lt_quiet( float64, float64 );
  181 +#ifdef FLOATX80
  182 +int32 syst_floatx80_to_int32( floatx80 );
  183 +int32 syst_floatx80_to_int32_round_to_zero( floatx80 );
  184 +#ifdef BITS64
  185 +int64 syst_floatx80_to_int64( floatx80 );
  186 +int64 syst_floatx80_to_int64_round_to_zero( floatx80 );
  187 +#endif
  188 +float32 syst_floatx80_to_float32( floatx80 );
  189 +float64 syst_floatx80_to_float64( floatx80 );
  190 +#ifdef FLOAT128
  191 +float128 syst_floatx80_to_float128( floatx80 );
  192 +#endif
  193 +floatx80 syst_floatx80_round_to_int( floatx80 );
  194 +floatx80 syst_floatx80_add( floatx80, floatx80 );
  195 +floatx80 syst_floatx80_sub( floatx80, floatx80 );
  196 +floatx80 syst_floatx80_mul( floatx80, floatx80 );
  197 +floatx80 syst_floatx80_div( floatx80, floatx80 );
  198 +floatx80 syst_floatx80_rem( floatx80, floatx80 );
  199 +floatx80 syst_floatx80_sqrt( floatx80 );
  200 +flag syst_floatx80_eq( floatx80, floatx80 );
  201 +flag syst_floatx80_le( floatx80, floatx80 );
  202 +flag syst_floatx80_lt( floatx80, floatx80 );
  203 +flag syst_floatx80_eq_signaling( floatx80, floatx80 );
  204 +flag syst_floatx80_le_quiet( floatx80, floatx80 );
  205 +flag syst_floatx80_lt_quiet( floatx80, floatx80 );
  206 +#endif
  207 +#ifdef FLOAT128
  208 +int32 syst_float128_to_int32( float128 );
  209 +int32 syst_float128_to_int32_round_to_zero( float128 );
  210 +#ifdef BITS64
  211 +int64 syst_float128_to_int64( float128 );
  212 +int64 syst_float128_to_int64_round_to_zero( float128 );
  213 +#endif
  214 +float32 syst_float128_to_float32( float128 );
  215 +float64 syst_float128_to_float64( float128 );
  216 +#ifdef FLOATX80
  217 +floatx80 syst_float128_to_floatx80( float128 );
  218 +#endif
  219 +float128 syst_float128_round_to_int( float128 );
  220 +float128 syst_float128_add( float128, float128 );
  221 +float128 syst_float128_sub( float128, float128 );
  222 +float128 syst_float128_mul( float128, float128 );
  223 +float128 syst_float128_div( float128, float128 );
  224 +float128 syst_float128_rem( float128, float128 );
  225 +float128 syst_float128_sqrt( float128 );
  226 +flag syst_float128_eq( float128, float128 );
  227 +flag syst_float128_le( float128, float128 );
  228 +flag syst_float128_lt( float128, float128 );
  229 +flag syst_float128_eq_signaling( float128, float128 );
  230 +flag syst_float128_le_quiet( float128, float128 );
  231 +flag syst_float128_lt_quiet( float128, float128 );
  232 +#endif
  233 +
42 regress/lib/libc/ieeefp/testfloat/include/systmodes.h
... ... @@ -0,0 +1,42 @@
  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 +/*
  27 +-------------------------------------------------------------------------------
  28 +Target-specific function for setting the system's IEC/IEEE floating-point
  29 +rounding mode. Other system modes are also initialized as necessary (for
  30 +example, exception trapping may be disabled).
  31 +-------------------------------------------------------------------------------
  32 +*/
  33 +void syst_float_set_rounding_mode( int8 );
  34 +
  35 +/*
  36 +-------------------------------------------------------------------------------
  37 +Target-specific function for setting the IEC/IEEE rounding precision of
  38 +subsequent extended double-precision operations performed by the system.
  39 +-------------------------------------------------------------------------------
  40 +*/
  41 +void syst_float_set_rounding_precision( int8 );
  42 +
69 regress/lib/libc/ieeefp/testfloat/include/testCases.h
... ... @@ -0,0 +1,69 @@
  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 +void testCases_setLevel( int8 );
  27 +
  28 +void testCases_initSequence( int8 );
  29 +enum {
  30 + testCases_sequence_a_int32,
  31 +#ifdef BITS64
  32 + testCases_sequence_a_int64,
  33 +#endif
  34 + testCases_sequence_a_float32,
  35 + testCases_sequence_ab_float32,
  36 + testCases_sequence_a_float64,
  37 + testCases_sequence_ab_float64,
  38 +#ifdef FLOATX80
  39 + testCases_sequence_a_floatx80,
  40 + testCases_sequence_ab_floatx80,
  41 +#endif
  42 +#ifdef FLOAT128
  43 + testCases_sequence_a_float128,
  44 + testCases_sequence_ab_float128,
  45 +#endif
  46 +};
  47 +
  48 +extern uint32 testCases_total;
  49 +extern flag testCases_done;
  50 +
  51 +void testCases_next( void );
  52 +
  53 +extern int32 testCases_a_int32;
  54 +#ifdef BITS64
  55 +extern int64 testCases_a_int64;
  56 +#endif
  57 +extern float32 testCases_a_float32;
  58 +extern float32 testCases_b_float32;
  59 +extern float64 testCases_a_float64;
  60 +extern float64 testCases_b_float64;
  61 +#ifdef FLOATX80
  62 +extern floatx80 testCases_a_floatx80;
  63 +extern floatx80 testCases_b_floatx80;
  64 +#endif
  65 +#ifdef FLOAT128
  66 +extern float128 testCases_a_float128;
  67 +extern float128 testCases_b_float128;
  68 +#endif
  69 +
135 regress/lib/libc/ieeefp/testfloat/include/testFunction.h
... ... @@ -0,0 +1,135 @@
  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 +enum {
  27 + INT32_TO_FLOAT32 = 1,
  28 + INT32_TO_FLOAT64,
  29 + INT32_TO_FLOATX80,
  30 + INT32_TO_FLOAT128,
  31 + INT64_TO_FLOAT32,
  32 + INT64_TO_FLOAT64,
  33 + INT64_TO_FLOATX80,
  34 + INT64_TO_FLOAT128,
  35 + FLOAT32_TO_INT32,
  36 + FLOAT32_TO_INT32_ROUND_TO_ZERO,
  37 + FLOAT32_TO_INT64,
  38 + FLOAT32_TO_INT64_ROUND_TO_ZERO,
  39 + FLOAT32_TO_FLOAT64,
  40 + FLOAT32_TO_FLOATX80,
  41 + FLOAT32_TO_FLOAT128,
  42 + FLOAT32_ROUND_TO_INT,
  43 + FLOAT32_ADD,
  44 + FLOAT32_SUB,
  45 + FLOAT32_MUL,
  46 + FLOAT32_DIV,
  47 + FLOAT32_REM,
  48 + FLOAT32_SQRT,
  49 + FLOAT32_EQ,
  50 + FLOAT32_LE,
  51 + FLOAT32_LT,
  52 + FLOAT32_EQ_SIGNALING,
  53 + FLOAT32_LE_QUIET,
  54 + FLOAT32_LT_QUIET,
  55 + FLOAT64_TO_INT32,
  56 + FLOAT64_TO_INT32_ROUND_TO_ZERO,
  57 + FLOAT64_TO_INT64,
  58 + FLOAT64_TO_INT64_ROUND_TO_ZERO,
  59 + FLOAT64_TO_FLOAT32,
  60 + FLOAT64_TO_FLOATX80,
  61 + FLOAT64_TO_FLOAT128,
  62 + FLOAT64_ROUND_TO_INT,
  63 + FLOAT64_ADD,
  64 + FLOAT64_SUB,
  65 + FLOAT64_MUL,
  66 + FLOAT64_DIV,
  67 + FLOAT64_REM,
  68 + FLOAT64_SQRT,
  69 + FLOAT64_EQ,
  70 + FLOAT64_LE,
  71 + FLOAT64_LT,
  72 + FLOAT64_EQ_SIGNALING,
  73 + FLOAT64_LE_QUIET,
  74 + FLOAT64_LT_QUIET,
  75 + FLOATX80_TO_INT32,
  76 + FLOATX80_TO_INT32_ROUND_TO_ZERO,
  77 + FLOATX80_TO_INT64,
  78 + FLOATX80_TO_INT64_ROUND_TO_ZERO,
  79 + FLOATX80_TO_FLOAT32,
  80 + FLOATX80_TO_FLOAT64,
  81 + FLOATX80_TO_FLOAT128,
  82 + FLOATX80_ROUND_TO_INT,
  83 + FLOATX80_ADD,
  84 + FLOATX80_SUB,
  85 + FLOATX80_MUL,
  86 + FLOATX80_DIV,
  87 + FLOATX80_REM,
  88 + FLOATX80_SQRT,
  89 + FLOATX80_EQ,
  90 + FLOATX80_LE,
  91 + FLOATX80_LT,
  92 + FLOATX80_EQ_SIGNALING,
  93 + FLOATX80_LE_QUIET,
  94 + FLOATX80_LT_QUIET,
  95 + FLOAT128_TO_INT32,
  96 + FLOAT128_TO_INT32_ROUND_TO_ZERO,
  97 + FLOAT128_TO_INT64,
  98 + FLOAT128_TO_INT64_ROUND_TO_ZERO,
  99 + FLOAT128_TO_FLOAT32,
  100 + FLOAT128_TO_FLOAT64,
  101 + FLOAT128_TO_FLOATX80,
  102 + FLOAT128_ROUND_TO_INT,
  103 + FLOAT128_ADD,
  104 + FLOAT128_SUB,
  105 + FLOAT128_MUL,
  106 + FLOAT128_DIV,
  107 + FLOAT128_REM,
  108 + FLOAT128_SQRT,
  109 + FLOAT128_EQ,
  110 + FLOAT128_LE,
  111 + FLOAT128_LT,
  112 + FLOAT128_EQ_SIGNALING,
  113 + FLOAT128_LE_QUIET,
  114 + FLOAT128_LT_QUIET,
  115 + NUM_FUNCTIONS
  116 +};
  117 +
  118 +typedef struct {
  119 + char *name;
  120 + int8 numInputs;
  121 + flag roundingPrecision, roundingMode;
  122 +} functionT;
  123 +extern const functionT functions[ NUM_FUNCTIONS ];
  124 +extern const flag functionExists[ NUM_FUNCTIONS ];
  125 +
  126 +enum {
  127 + ROUND_NEAREST_EVEN = 1,
  128 + ROUND_TO_ZERO,
  129 + ROUND_DOWN,
  130 + ROUND_UP,
  131 + NUM_ROUNDINGMODES
  132 +};
  133 +
  134 +void testFunction( uint8, int8, int8 );
  135 +
143 regress/lib/libc/ieeefp/testfloat/include/testLoops.h
... ... @@ -0,0 +1,143 @@
  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 +
42 regress/lib/libc/ieeefp/testfloat/include/writeHex.h
... ... @@ -0,0 +1,42 @@
  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 +void writeHex_flag( flag, FILE * );
  29 +void writeHex_bits32( bits32, FILE * );
  30 +#ifdef BITS64
  31 +void writeHex_bits64( bits64, FILE * );
  32 +#endif
  33 +void writeHex_float32( float32, FILE * );
  34 +void writeHex_float64( float64, FILE * );
  35 +#ifdef FLOATX80
  36 +void writeHex_floatx80( floatx80, FILE * );
  37 +#endif
  38 +#ifdef FLOAT128
  39 +void writeHex_float128( float128, FILE * );
  40 +#endif
  41 +void writeHex_float_flags( uint8, FILE * );
  42 +

0 comments on commit 4ae71d8

Please sign in to comment.
Something went wrong with that request. Please try again.