OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [apps/] [testfloat/] [testLoops.c] - Diff between revs 393 and 425

Only display areas with differences | Details | Blame | View Log

Rev 393 Rev 425
 
 
/*
/*
===============================================================================
===============================================================================
 
 
This C source file is part of TestFloat, Release 2a, a package of programs
This C source file is part of TestFloat, Release 2a, a package of programs
for testing the correctness of floating-point arithmetic complying to the
for testing the correctness of floating-point arithmetic complying to the
IEC/IEEE Standard for Floating-Point.
IEC/IEEE Standard for Floating-Point.
 
 
Written by John R. Hauser.  More information is available through the Web
Written by John R. Hauser.  More information is available through the Web
page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'.
 
 
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
 
 
Derivative works are acceptable, even for commercial purposes, so long as
Derivative works are acceptable, even for commercial purposes, so long as
(1) they include prominent notice that the work is derivative, and (2) they
(1) they include prominent notice that the work is derivative, and (2) they
include prominent notice akin to these four paragraphs for those parts of
include prominent notice akin to these four paragraphs for those parts of
this code that are retained.
this code that are retained.
 
 
Modified for use with or1ksim's testsuite.
Modified for use with or1ksim's testsuite.
 
 
Contributor Julius Baxter <julius.baxter@orsoc.se>
Contributor Julius Baxter <julius.baxter@orsoc.se>
 
 
===============================================================================
===============================================================================
*/
*/
                                                                 /*
                                                                 /*
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
                                                                 */
                                                                 */
#include "or32-utils.h" // OR1k support C library
#include "cpu-utils.h" // OR1k support C library
#include "milieu.h"
#include "milieu.h"
#include "printf.h"
#include "printf.h"
#include "softfloat.h"
#include "softfloat.h"
#include "testCases.h"
#include "testCases.h"
#include "writeHex.h"
#include "writeHex.h"
#include "testLoops.h"
#include "testLoops.h"
 
 
volatile flag stop = FALSE;
volatile flag stop = FALSE;
 
 
char *trueName, *testName;
char *trueName, *testName;
flag forever, errorStop;
flag forever, errorStop;
uint32 maxErrorCount = 0;
uint32 maxErrorCount = 0;
flag checkNaNs = FALSE;
flag checkNaNs = FALSE;
int8 *trueFlagsPtr;
int8 *trueFlagsPtr;
int8 ( *testFlagsFunctionPtr )( void );
int8 ( *testFlagsFunctionPtr )( void );
char *functionName;
char *functionName;
char *roundingPrecisionName, *roundingModeName, *tininessModeName;
char *roundingPrecisionName, *roundingModeName, *tininessModeName;
flag anyErrors = FALSE;
flag anyErrors = FALSE;
 
 
void
void
writeFunctionName( /* FILE *stream */ )
writeFunctionName( /* FILE *stream */ )
{
{
 
 
    printf( functionName/*, stream */ );
    printf( functionName/*, stream */ );
    if ( roundingModeName ) {
    if ( roundingModeName ) {
        if ( roundingPrecisionName ) {
        if ( roundingPrecisionName ) {
            printf( ", precision "/*, stream */ );
            printf( ", precision "/*, stream */ );
            printf( roundingPrecisionName/*, stream */ );
            printf( roundingPrecisionName/*, stream */ );
        }
        }
        printf( ", rounding "/*, stream */ );
        printf( ", rounding "/*, stream */ );
        printf( roundingModeName/*, stream */ );
        printf( roundingModeName/*, stream */ );
        if ( tininessModeName ) {
        if ( tininessModeName ) {
            printf( ", tininess "/*, stream */ );
            printf( ", tininess "/*, stream */ );
            printf( tininessModeName/*, stream */ );
            printf( tininessModeName/*, stream */ );
            printf( " rounding"/*, stream */ );
            printf( " rounding"/*, stream */ );
        }
        }
    }
    }
 
 
}
}
 
 
void
void
exitWithStatus( void )
exitWithStatus( void )
{
{
 
 
  exit( anyErrors ? /*EXIT_FAILURE */ 0x1 : /* EXIT_SUCCESS */ 0 );
  exit( anyErrors ? /*EXIT_FAILURE */ 0x1 : /* EXIT_SUCCESS */ 0 );
 
 
}
}
 
 
static uint32 tenthousandsCount, errorCount = 0;
static uint32 tenthousandsCount, errorCount = 0;
 
 
static void
static void
writeTestsTotal( void )
writeTestsTotal( void )
{
{
 
 
    if ( forever ) {
    if ( forever ) {
        printf( "Unbounded tests.\n"/*, stderr */ );
        printf( "Unbounded tests.\n"/*, stderr */ );
    }
    }
    else {
    else {
        printf( "\r%d tests total.\n", testCases_total );
        printf( "\r%d tests total.\n", testCases_total );
    }
    }
 
 
}
}
 
 
static void
static void
writeTestsPerformed( int16 count )
writeTestsPerformed( int16 count )
{
{
 
 
    if ( tenthousandsCount ) {
    if ( tenthousandsCount ) {
        printf(
        printf(
             "\r%d%04d tests performed", tenthousandsCount, count );
             "\r%d%04d tests performed", tenthousandsCount, count );
    }
    }
    else {
    else {
        printf(  "\r%d tests performed", count );
        printf(  "\r%d tests performed", count );
    }
    }
    if ( errorCount ) {
    if ( errorCount ) {
        printf(
        printf(
 
 
            "; %d error%s found.\n",
            "; %d error%s found.\n",
            errorCount,
            errorCount,
            ( errorCount == 1 ) ? "" : "s"
            ( errorCount == 1 ) ? "" : "s"
        );
        );
    }
    }
    else {
    else {
        printf( ".\n"/*, stderr */ );
        printf( ".\n"/*, stderr */ );
        printf( "No errors found in "/*, stdout*/ );
        printf( "No errors found in "/*, stdout*/ );
        writeFunctionName( /*stdout */ );
        writeFunctionName( /*stdout */ );
        printf( ".\n"/*, stdout*/ );
        printf( ".\n"/*, stdout*/ );
        //fflush( stdout );
        //fflush( stdout );
    }
    }
 
 
}
}
 
 
static void
static void
checkEarlyExit( void )
checkEarlyExit( void )
{
{
 
 
    ++tenthousandsCount;
    ++tenthousandsCount;
    if ( stop ) {
    if ( stop ) {
        writeTestsPerformed( 0 );
        writeTestsPerformed( 0 );
        exitWithStatus();
        exitWithStatus();
    }
    }
    printf(  "\r%3d0000", tenthousandsCount );
    printf(  "\r%3d0000", tenthousandsCount );
 
 
}
}
 
 
static void
static void
writeErrorFound( int16 count )
writeErrorFound( int16 count )
{
{
 
 
    putchar( '\r'/*, stderr */ );
    putchar( '\r'/*, stderr */ );
    if ( errorCount == 1 ) {
    if ( errorCount == 1 ) {
        printf( "Errors found in "/*, stdout*/ );
        printf( "Errors found in "/*, stdout*/ );
        writeFunctionName( /*stdout*/ );
        writeFunctionName( /*stdout*/ );
        printf( ":\n"/*, stdout*/ );
        printf( ":\n"/*, stdout*/ );
    }
    }
    if ( stop ) {
    if ( stop ) {
        writeTestsPerformed( count );
        writeTestsPerformed( count );
        exitWithStatus();
        exitWithStatus();
    }
    }
    anyErrors = TRUE;
    anyErrors = TRUE;
 
 
}
}
 
 
INLINE void
INLINE void
writeInput_a_int32( void )
writeInput_a_int32( void )
{
{
 
 
    writeHex_bits32( testCases_a_int32/*, stdout*/ );
    writeHex_bits32( testCases_a_int32/*, stdout*/ );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
INLINE void
INLINE void
writeInput_a_int64( void )
writeInput_a_int64( void )
{
{
 
 
    writeHex_bits64( testCases_a_int64/*, stdout*/ );
    writeHex_bits64( testCases_a_int64/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
INLINE void
INLINE void
writeInput_a_float32( void )
writeInput_a_float32( void )
{
{
 
 
    writeHex_float32( testCases_a_float32/*, stdout*/ );
    writeHex_float32( testCases_a_float32/*, stdout*/ );
 
 
}
}
 
 
static void
static void
writeInputs_ab_float32( void )
writeInputs_ab_float32( void )
{
{
 
 
    writeHex_float32( testCases_a_float32/*, stdout*/ );
    writeHex_float32( testCases_a_float32/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    writeHex_float32( testCases_b_float32/*, stdout*/ );
    writeHex_float32( testCases_b_float32/*, stdout*/ );
 
 
}
}
 
 
INLINE void
INLINE void
writeInput_a_float64( void )
writeInput_a_float64( void )
{
{
 
 
    writeHex_float64( testCases_a_float64/*, stdout*/ );
    writeHex_float64( testCases_a_float64/*, stdout*/ );
 
 
}
}
 
 
static void
static void
writeInputs_ab_float64( void )
writeInputs_ab_float64( void )
{
{
 
 
    writeHex_float64( testCases_a_float64/*, stdout*/ );
    writeHex_float64( testCases_a_float64/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    writeHex_float64( testCases_b_float64/*, stdout*/ );
    writeHex_float64( testCases_b_float64/*, stdout*/ );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
INLINE void
INLINE void
writeInput_a_floatx80( void )
writeInput_a_floatx80( void )
{
{
 
 
    writeHex_floatx80( testCases_a_floatx80/*, stdout*/ );
    writeHex_floatx80( testCases_a_floatx80/*, stdout*/ );
 
 
}
}
 
 
static void
static void
writeInputs_ab_floatx80( void )
writeInputs_ab_floatx80( void )
{
{
 
 
    writeHex_floatx80( testCases_a_floatx80/*, stdout*/ );
    writeHex_floatx80( testCases_a_floatx80/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    writeHex_floatx80( testCases_b_floatx80/*, stdout*/ );
    writeHex_floatx80( testCases_b_floatx80/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
INLINE void
INLINE void
writeInput_a_float128( void )
writeInput_a_float128( void )
{
{
 
 
    writeHex_float128( testCases_a_float128/*, stdout*/ );
    writeHex_float128( testCases_a_float128/*, stdout*/ );
 
 
}
}
 
 
static void
static void
writeInputs_ab_float128( void )
writeInputs_ab_float128( void )
{
{
 
 
    writeHex_float128( testCases_a_float128/*, stdout*/ );
    writeHex_float128( testCases_a_float128/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    writeHex_float128( testCases_b_float128/*, stdout*/ );
    writeHex_float128( testCases_b_float128/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
static void
static void
 writeOutputs_z_flag(
 writeOutputs_z_flag(
     flag trueZ, uint8 trueFlags, flag testZ, uint8 testFlags )
     flag trueZ, uint8 trueFlags, flag testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_flag( trueZ/*, stdout*/ );
    writeHex_flag( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_flag( testZ/*, stdout*/ );
    writeHex_flag( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
static void
static void
 writeOutputs_z_int32(
 writeOutputs_z_int32(
     int32 trueZ, uint8 trueFlags, int32 testZ, uint8 testFlags )
     int32 trueZ, uint8 trueFlags, int32 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_bits32( trueZ/*, stdout*/ );
    writeHex_bits32( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_bits32( testZ/*, stdout*/ );
    writeHex_bits32( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
static void
static void
 writeOutputs_z_int64(
 writeOutputs_z_int64(
     int64 trueZ, uint8 trueFlags, int64 testZ, uint8 testFlags )
     int64 trueZ, uint8 trueFlags, int64 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_bits64( trueZ/*, stdout*/ );
    writeHex_bits64( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_bits64( testZ/*, stdout*/ );
    writeHex_bits64( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
static void
static void
 writeOutputs_z_float32(
 writeOutputs_z_float32(
     float32 trueZ, uint8 trueFlags, float32 testZ, uint8 testFlags )
     float32 trueZ, uint8 trueFlags, float32 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float32( trueZ/*, stdout*/ );
    writeHex_float32( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float32( testZ/*, stdout*/ );
    writeHex_float32( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
static void
static void
 writeOutputs_z_float64(
 writeOutputs_z_float64(
     float64 trueZ, uint8 trueFlags, float64 testZ, uint8 testFlags )
     float64 trueZ, uint8 trueFlags, float64 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float64( trueZ/*, stdout*/ );
    writeHex_float64( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float64( testZ/*, stdout*/ );
    writeHex_float64( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
static void
static void
 writeOutputs_z_floatx80(
 writeOutputs_z_floatx80(
     floatx80 trueZ, uint8 trueFlags, floatx80 testZ, uint8 testFlags )
     floatx80 trueZ, uint8 trueFlags, floatx80 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_floatx80( trueZ/*, stdout*/ );
    writeHex_floatx80( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( "  "/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_floatx80( testZ/*, stdout*/ );
    writeHex_floatx80( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
static void
static void
 writeOutputs_z_float128(
 writeOutputs_z_float128(
     float128 trueZ, uint8 trueFlags, float128 testZ, uint8 testFlags )
     float128 trueZ, uint8 trueFlags, float128 testZ, uint8 testFlags )
{
{
 
 
    printf( trueName/*, stdout*/ );
    printf( trueName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float128( trueZ/*, stdout*/ );
    writeHex_float128( trueZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    writeHex_float_flags( trueFlags/*, stdout*/ );
    printf( "\n\t"/*, stdout*/ );
    printf( "\n\t"/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( testName/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    printf( ": "/*, stdout*/ );
    writeHex_float128( testZ/*, stdout*/ );
    writeHex_float128( testZ/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    putchar( ' '/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    writeHex_float_flags( testFlags/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
    putchar( '\n'/*, stdout*/ );
 
 
}
}
 
 
#endif
#endif
 
 
INLINE flag float32_isNaN( float32 a )
INLINE flag float32_isNaN( float32 a )
{
{
 
 
    return 0x7F800000 < ( a & 0x7FFFFFFF );
    return 0x7F800000 < ( a & 0x7FFFFFFF );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
INLINE flag float64_same( float64 a, float64 b )
INLINE flag float64_same( float64 a, float64 b )
{
{
 
 
    return a == b;
    return a == b;
 
 
}
}
 
 
INLINE flag float64_isNaN( float64 a )
INLINE flag float64_isNaN( float64 a )
{
{
 
 
    return LIT64( 0x7FF0000000000000 ) < ( a & LIT64( 0x7FFFFFFFFFFFFFFF ) );
    return LIT64( 0x7FF0000000000000 ) < ( a & LIT64( 0x7FFFFFFFFFFFFFFF ) );
 
 
}
}
 
 
#else
#else
 
 
INLINE flag float64_same( float64 a, float64 b )
INLINE flag float64_same( float64 a, float64 b )
{
{
 
 
    return ( a.high == b.high ) && ( a.low == b.low );
    return ( a.high == b.high ) && ( a.low == b.low );
 
 
}
}
 
 
INLINE flag float64_isNaN( float64 a )
INLINE flag float64_isNaN( float64 a )
{
{
    bits32 absAHigh;
    bits32 absAHigh;
 
 
    absAHigh = a.high & 0x7FFFFFFF;
    absAHigh = a.high & 0x7FFFFFFF;
    return
    return
        ( 0x7FF00000 < absAHigh ) || ( ( absAHigh == 0x7FF00000 ) && a.low );
        ( 0x7FF00000 < absAHigh ) || ( ( absAHigh == 0x7FF00000 ) && a.low );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
INLINE flag floatx80_same( floatx80 a, floatx80 b )
INLINE flag floatx80_same( floatx80 a, floatx80 b )
{
{
 
 
    return ( a.high == b.high ) && ( a.low == b.low );
    return ( a.high == b.high ) && ( a.low == b.low );
 
 
}
}
 
 
INLINE flag floatx80_isNaN( floatx80 a )
INLINE flag floatx80_isNaN( floatx80 a )
{
{
 
 
    return ( ( a.high & 0x7FFF ) == 0x7FFF ) && a.low;
    return ( ( a.high & 0x7FFF ) == 0x7FFF ) && a.low;
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
INLINE flag float128_same( float128 a, float128 b )
INLINE flag float128_same( float128 a, float128 b )
{
{
 
 
    return ( a.high == b.high ) && ( a.low == b.low );
    return ( a.high == b.high ) && ( a.low == b.low );
 
 
}
}
 
 
INLINE flag float128_isNaN( float128 a )
INLINE flag float128_isNaN( float128 a )
{
{
    bits64 absAHigh;
    bits64 absAHigh;
 
 
    absAHigh = a.high & LIT64( 0x7FFFFFFFFFFFFFFF );
    absAHigh = a.high & LIT64( 0x7FFFFFFFFFFFFFFF );
    return
    return
           ( LIT64( 0x7FFF000000000000 ) < absAHigh )
           ( LIT64( 0x7FFF000000000000 ) < absAHigh )
        || ( ( absAHigh == LIT64( 0x7FFF000000000000 ) ) && a.low );
        || ( ( absAHigh == LIT64( 0x7FFF000000000000 ) ) && a.low );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_a_int32_z_float32(
 test_a_int32_z_float32(
     float32 trueFunction( int32 ), float32 testFunction( int32 ) )
     float32 trueFunction( int32 ), float32 testFunction( int32 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int32 );
    testCases_initSequence( testCases_sequence_a_int32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int32 );
        trueZ = trueFunction( testCases_a_int32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int32 );
        testZ = testFunction( testCases_a_int32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int32();
                writeInput_a_int32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
#if V_SHORT_TESTS==1
#if V_SHORT_TESTS==1
        // early test finish hack
        // early test finish hack
        if (count == 9990) testCases_done = 1;
        if (count == 9990) testCases_done = 1;
#endif
#endif
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_a_int32_z_float64(
 test_a_int32_z_float64(
     float64 trueFunction( int32 ), float64 testFunction( int32 ) )
     float64 trueFunction( int32 ), float64 testFunction( int32 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int32 );
    testCases_initSequence( testCases_sequence_a_int32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int32 );
        trueZ = trueFunction( testCases_a_int32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int32 );
        testZ = testFunction( testCases_a_int32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        report(count); // Indicate that tests are still going!
        report(count); // Indicate that tests are still going!
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int32();
                writeInput_a_int32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_int32_z_floatx80(
 test_a_int32_z_floatx80(
     floatx80 trueFunction( int32 ), floatx80 testFunction( int32 ) )
     floatx80 trueFunction( int32 ), floatx80 testFunction( int32 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int32 );
    testCases_initSequence( testCases_sequence_a_int32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int32 );
        trueZ = trueFunction( testCases_a_int32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int32 );
        testZ = testFunction( testCases_a_int32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int32();
                writeInput_a_int32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_int32_z_float128(
 test_a_int32_z_float128(
     float128 trueFunction( int32 ), float128 testFunction( int32 ) )
     float128 trueFunction( int32 ), float128 testFunction( int32 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int32 );
    testCases_initSequence( testCases_sequence_a_int32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int32 );
        trueZ = trueFunction( testCases_a_int32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int32 );
        testZ = testFunction( testCases_a_int32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int32();
                writeInput_a_int32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef BITS64
#ifdef BITS64
 
 
void
void
 test_a_int64_z_float32(
 test_a_int64_z_float32(
     float32 trueFunction( int64 ), float32 testFunction( int64 ) )
     float32 trueFunction( int64 ), float32 testFunction( int64 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int64 );
    testCases_initSequence( testCases_sequence_a_int64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int64 );
        trueZ = trueFunction( testCases_a_int64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int64 );
        testZ = testFunction( testCases_a_int64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int64();
                writeInput_a_int64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_a_int64_z_float64(
 test_a_int64_z_float64(
     float64 trueFunction( int64 ), float64 testFunction( int64 ) )
     float64 trueFunction( int64 ), float64 testFunction( int64 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int64 );
    testCases_initSequence( testCases_sequence_a_int64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int64 );
        trueZ = trueFunction( testCases_a_int64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int64 );
        testZ = testFunction( testCases_a_int64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int64();
                writeInput_a_int64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_int64_z_floatx80(
 test_a_int64_z_floatx80(
     floatx80 trueFunction( int64 ), floatx80 testFunction( int64 ) )
     floatx80 trueFunction( int64 ), floatx80 testFunction( int64 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int64 );
    testCases_initSequence( testCases_sequence_a_int64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int64 );
        trueZ = trueFunction( testCases_a_int64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int64 );
        testZ = testFunction( testCases_a_int64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int64();
                writeInput_a_int64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_int64_z_float128(
 test_a_int64_z_float128(
     float128 trueFunction( int64 ), float128 testFunction( int64 ) )
     float128 trueFunction( int64 ), float128 testFunction( int64 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_int64 );
    testCases_initSequence( testCases_sequence_a_int64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_int64 );
        trueZ = trueFunction( testCases_a_int64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_int64 );
        testZ = testFunction( testCases_a_int64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_int64();
                writeInput_a_int64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#endif
#endif
 
 
void
void
 test_a_float32_z_int32(
 test_a_float32_z_int32(
     int32 trueFunction( float32 ), int32 testFunction( float32 ) )
     int32 trueFunction( float32 ), int32 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    int32 trueZ, testZ;
    int32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
 
 
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == 0x7FFFFFFF )
            if (    ( trueZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                      || ( testZ == (sbits32) 0x80000000 ) )
                      || ( testZ == (sbits32) 0x80000000 ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
#if V_SHORT_TESTS==1
#if V_SHORT_TESTS==1
        // early test finish hack
        // early test finish hack
        if (count == 9990) testCases_done = 1;
        if (count == 9990) testCases_done = 1;
#endif
#endif
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
void
void
 test_a_float32_z_int64(
 test_a_float32_z_int64(
     int64 trueFunction( float32 ), int64 testFunction( float32 ) )
     int64 trueFunction( float32 ), int64 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    int64 trueZ, testZ;
    int64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_a_float32_z_float64(
 test_a_float32_z_float64(
     float64 trueFunction( float32 ), float64 testFunction( float32 ) )
     float64 trueFunction( float32 ), float64 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_float32_z_floatx80(
 test_a_float32_z_floatx80(
     floatx80 trueFunction( float32 ), floatx80 testFunction( float32 ) )
     floatx80 trueFunction( float32 ), floatx80 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_float32_z_float128(
 test_a_float32_z_float128(
     float128 trueFunction( float32 ), float128 testFunction( float32 ) )
     float128 trueFunction( float32 ), float128 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_az_float32(
 test_az_float32(
     float32 trueFunction( float32 ), float32 testFunction( float32 ) )
     float32 trueFunction( float32 ), float32 testFunction( float32 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float32 );
    testCases_initSequence( testCases_sequence_a_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32 );
        trueZ = trueFunction( testCases_a_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32 );
        testZ = testFunction( testCases_a_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                 && float32_is_signaling_nan( testCases_a_float32 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float32();
                writeInput_a_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
#if V_SHORT_TESTS==1
#if V_SHORT_TESTS==1
        // early test finish hack
        // early test finish hack
        if (count == 9990) testCases_done = 1;
        if (count == 9990) testCases_done = 1;
#endif
#endif
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_ab_float32_z_flag(
 test_ab_float32_z_flag(
     flag trueFunction( float32, float32 ),
     flag trueFunction( float32, float32 ),
     flag testFunction( float32, float32 )
     flag testFunction( float32, float32 )
 )
 )
{
{
    int16 count;
    int16 count;
    flag trueZ, testZ;
    flag trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float32 );
    testCases_initSequence( testCases_sequence_ab_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32, testCases_b_float32 );
        trueZ = trueFunction( testCases_a_float32, testCases_b_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32, testCases_b_float32 );
        testZ = testFunction( testCases_a_float32, testCases_b_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float32_is_signaling_nan( testCases_a_float32 )
                 && (    float32_is_signaling_nan( testCases_a_float32 )
                      || float32_is_signaling_nan( testCases_b_float32 ) )
                      || float32_is_signaling_nan( testCases_b_float32 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float32();
                writeInputs_ab_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
#if V_SHORT_TESTS==1
#if V_SHORT_TESTS==1
        // early test finish hack
        // early test finish hack
        if (count == 9990) testCases_done = 1;
        if (count == 9990) testCases_done = 1;
#endif
#endif
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
void
void
 test_abz_float32(
 test_abz_float32(
     float32 trueFunction( float32, float32 ),
     float32 trueFunction( float32, float32 ),
     float32 testFunction( float32, float32 )
     float32 testFunction( float32, float32 )
 )
 )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float32 );
    testCases_initSequence( testCases_sequence_ab_float32 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float32, testCases_b_float32 );
        trueZ = trueFunction( testCases_a_float32, testCases_b_float32 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float32, testCases_b_float32 );
        testZ = testFunction( testCases_a_float32, testCases_b_float32 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        report(count); // Indicate that tests are still going!
        report(count); // Indicate that tests are still going!
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float32_is_signaling_nan( testCases_a_float32 )
                 && (    float32_is_signaling_nan( testCases_a_float32 )
                      || float32_is_signaling_nan( testCases_b_float32 ) )
                      || float32_is_signaling_nan( testCases_b_float32 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
#define FLAGS_IGNORE (float_flag_overflow|float_flag_underflow|float_flag_inexact)
#define FLAGS_IGNORE (float_flag_overflow|float_flag_underflow|float_flag_inexact)
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                    // Ignore if OUX flags set - known discrepancy between 
                    // Ignore if OUX flags set - known discrepancy between 
                    // FPU100 arith and softfloat
                    // FPU100 arith and softfloat
                    && ( (trueFlags &~(FLAGS_IGNORE)) ==
                    && ( (trueFlags &~(FLAGS_IGNORE)) ==
                          (testFlags & ~(FLAGS_IGNORE)) )
                          (testFlags & ~(FLAGS_IGNORE)) )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else if (((trueFlags&(FLAGS_IGNORE))==(testFlags&(FLAGS_IGNORE))) &
            else if (((trueFlags&(FLAGS_IGNORE))==(testFlags&(FLAGS_IGNORE))) &
                      (trueZ != testZ) )
                      (trueZ != testZ) )
              {
              {
                // Due to limited internal precision of FPU100, this is not a 
                // Due to limited internal precision of FPU100, this is not a 
                // big issue when overflow/underflow or inexact is flagged and
                // big issue when overflow/underflow or inexact is flagged and
                // results differ
                // results differ
              }
              }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float32();
                writeInputs_ab_float32();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
#if V_SHORT_TESTS==1
#if V_SHORT_TESTS==1
        // early test finish hack
        // early test finish hack
        if (count == 9990) testCases_done = 1;
        if (count == 9990) testCases_done = 1;
#endif
#endif
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
void
void
 test_a_float64_z_int32(
 test_a_float64_z_int32(
     int32 trueFunction( float64 ), int32 testFunction( float64 ) )
     int32 trueFunction( float64 ), int32 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    int32 trueZ, testZ;
    int32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == 0x7FFFFFFF )
            if (    ( trueZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                      || ( testZ == (sbits32) 0x80000000 ) )
                      || ( testZ == (sbits32) 0x80000000 ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
void
void
 test_a_float64_z_int64(
 test_a_float64_z_int64(
     int64 trueFunction( float64 ), int64 testFunction( float64 ) )
     int64 trueFunction( float64 ), int64 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    int64 trueZ, testZ;
    int64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_a_float64_z_float32(
 test_a_float64_z_float32(
     float32 trueFunction( float64 ), float32 testFunction( float64 ) )
     float32 trueFunction( float64 ), float32 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_float64_z_floatx80(
 test_a_float64_z_floatx80(
     floatx80 trueFunction( float64 ), floatx80 testFunction( float64 ) )
     floatx80 trueFunction( float64 ), floatx80 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_float64_z_float128(
 test_a_float64_z_float128(
     float128 trueFunction( float64 ), float128 testFunction( float64 ) )
     float128 trueFunction( float64 ), float128 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_az_float64(
 test_az_float64(
     float64 trueFunction( float64 ), float64 testFunction( float64 ) )
     float64 trueFunction( float64 ), float64 testFunction( float64 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float64 );
    testCases_initSequence( testCases_sequence_a_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64 );
        trueZ = trueFunction( testCases_a_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64 );
        testZ = testFunction( testCases_a_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                 && float64_is_signaling_nan( testCases_a_float64 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float64();
                writeInput_a_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_ab_float64_z_flag(
 test_ab_float64_z_flag(
     flag trueFunction( float64, float64 ),
     flag trueFunction( float64, float64 ),
     flag testFunction( float64, float64 )
     flag testFunction( float64, float64 )
 )
 )
{
{
    int16 count;
    int16 count;
    flag trueZ, testZ;
    flag trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float64 );
    testCases_initSequence( testCases_sequence_ab_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64, testCases_b_float64 );
        trueZ = trueFunction( testCases_a_float64, testCases_b_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64, testCases_b_float64 );
        testZ = testFunction( testCases_a_float64, testCases_b_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float64_is_signaling_nan( testCases_a_float64 )
                 && (    float64_is_signaling_nan( testCases_a_float64 )
                      || float64_is_signaling_nan( testCases_b_float64 ) )
                      || float64_is_signaling_nan( testCases_b_float64 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float64();
                writeInputs_ab_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
void
void
 test_abz_float64(
 test_abz_float64(
     float64 trueFunction( float64, float64 ),
     float64 trueFunction( float64, float64 ),
     float64 testFunction( float64, float64 )
     float64 testFunction( float64, float64 )
 )
 )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float64 );
    testCases_initSequence( testCases_sequence_ab_float64 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float64, testCases_b_float64 );
        trueZ = trueFunction( testCases_a_float64, testCases_b_float64 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float64, testCases_b_float64 );
        testZ = testFunction( testCases_a_float64, testCases_b_float64 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float64_is_signaling_nan( testCases_a_float64 )
                 && (    float64_is_signaling_nan( testCases_a_float64 )
                      || float64_is_signaling_nan( testCases_b_float64 ) )
                      || float64_is_signaling_nan( testCases_b_float64 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float64();
                writeInputs_ab_float64();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_floatx80_z_int32(
 test_a_floatx80_z_int32(
     int32 trueFunction( floatx80 ), int32 testFunction( floatx80 ) )
     int32 trueFunction( floatx80 ), int32 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    int32 trueZ, testZ;
    int32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == 0x7FFFFFFF )
            if (    ( trueZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                      || ( testZ == (sbits32) 0x80000000 ) )
                      || ( testZ == (sbits32) 0x80000000 ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
void
void
 test_a_floatx80_z_int64(
 test_a_floatx80_z_int64(
     int64 trueFunction( floatx80 ), int64 testFunction( floatx80 ) )
     int64 trueFunction( floatx80 ), int64 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    int64 trueZ, testZ;
    int64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_a_floatx80_z_float32(
 test_a_floatx80_z_float32(
     float32 trueFunction( floatx80 ), float32 testFunction( floatx80 ) )
     float32 trueFunction( floatx80 ), float32 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_a_floatx80_z_float64(
 test_a_floatx80_z_float64(
     float64 trueFunction( floatx80 ), float64 testFunction( floatx80 ) )
     float64 trueFunction( floatx80 ), float64 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_floatx80_z_float128(
 test_a_floatx80_z_float128(
     float128 trueFunction( floatx80 ), float128 testFunction( floatx80 ) )
     float128 trueFunction( floatx80 ), float128 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_az_floatx80(
 test_az_floatx80(
     floatx80 trueFunction( floatx80 ), floatx80 testFunction( floatx80 ) )
     floatx80 trueFunction( floatx80 ), floatx80 testFunction( floatx80 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_floatx80 );
    testCases_initSequence( testCases_sequence_a_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80 );
        testZ = testFunction( testCases_a_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                 && floatx80_is_signaling_nan( testCases_a_floatx80 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_floatx80();
                writeInput_a_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_ab_floatx80_z_flag(
 test_ab_floatx80_z_flag(
     flag trueFunction( floatx80, floatx80 ),
     flag trueFunction( floatx80, floatx80 ),
     flag testFunction( floatx80, floatx80 )
     flag testFunction( floatx80, floatx80 )
 )
 )
{
{
    int16 count;
    int16 count;
    flag trueZ, testZ;
    flag trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_floatx80 );
    testCases_initSequence( testCases_sequence_ab_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80, testCases_b_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80, testCases_b_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
        testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    floatx80_is_signaling_nan( testCases_a_floatx80 )
                 && (    floatx80_is_signaling_nan( testCases_a_floatx80 )
                      || floatx80_is_signaling_nan( testCases_b_floatx80 ) )
                      || floatx80_is_signaling_nan( testCases_b_floatx80 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_floatx80();
                writeInputs_ab_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
void
void
 test_abz_floatx80(
 test_abz_floatx80(
     floatx80 trueFunction( floatx80, floatx80 ),
     floatx80 trueFunction( floatx80, floatx80 ),
     floatx80 testFunction( floatx80, floatx80 )
     floatx80 testFunction( floatx80, floatx80 )
 )
 )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_floatx80 );
    testCases_initSequence( testCases_sequence_ab_floatx80 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_floatx80, testCases_b_floatx80 );
        trueZ = trueFunction( testCases_a_floatx80, testCases_b_floatx80 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
        testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    floatx80_is_signaling_nan( testCases_a_floatx80 )
                 && (    floatx80_is_signaling_nan( testCases_a_floatx80 )
                      || floatx80_is_signaling_nan( testCases_b_floatx80 ) )
                      || floatx80_is_signaling_nan( testCases_b_floatx80 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_floatx80();
                writeInputs_ab_floatx80();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
#endif
#endif
 
 
#ifdef FLOAT128
#ifdef FLOAT128
 
 
void
void
 test_a_float128_z_int32(
 test_a_float128_z_int32(
     int32 trueFunction( float128 ), int32 testFunction( float128 ) )
     int32 trueFunction( float128 ), int32 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    int32 trueZ, testZ;
    int32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == 0x7FFFFFFF )
            if (    ( trueZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                 && (    ( testZ == 0x7FFFFFFF )
                      || ( testZ == (sbits32) 0x80000000 ) )
                      || ( testZ == (sbits32) 0x80000000 ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef BITS64
#ifdef BITS64
 
 
void
void
 test_a_float128_z_int64(
 test_a_float128_z_int64(
     int64 trueFunction( float128 ), int64 testFunction( float128 ) )
     int64 trueFunction( float128 ), int64 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    int64 trueZ, testZ;
    int64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
            if (    ( trueZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                 && (    ( testZ == LIT64( 0x7FFFFFFFFFFFFFFF ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                      || ( testZ == (sbits64) LIT64( 0x8000000000000000 ) ) )
                 && ( trueFlags == float_flag_invalid )
                 && ( trueFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
                 && ( testFlags == float_flag_invalid )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_int64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_a_float128_z_float32(
 test_a_float128_z_float32(
     float32 trueFunction( float128 ), float32 testFunction( float128 ) )
     float32 trueFunction( float128 ), float32 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    float32 trueZ, testZ;
    float32 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float32_isNaN( trueZ )
                 && float32_isNaN( trueZ )
                 && float32_isNaN( testZ )
                 && float32_isNaN( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ! float32_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_a_float128_z_float64(
 test_a_float128_z_float64(
     float64 trueFunction( float128 ), float64 testFunction( float128 ) )
     float64 trueFunction( float128 ), float64 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    float64 trueZ, testZ;
    float64 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float64_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float64_isNaN( trueZ )
                 && float64_isNaN( trueZ )
                 && float64_isNaN( testZ )
                 && float64_isNaN( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ! float64_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float64( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#ifdef FLOATX80
#ifdef FLOATX80
 
 
void
void
 test_a_float128_z_floatx80(
 test_a_float128_z_floatx80(
     floatx80 trueFunction( float128 ), floatx80 testFunction( float128 ) )
     floatx80 trueFunction( float128 ), floatx80 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    floatx80 trueZ, testZ;
    floatx80 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! floatx80_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( trueZ )
                 && floatx80_isNaN( testZ )
                 && floatx80_isNaN( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ! floatx80_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_floatx80( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
#endif
#endif
 
 
void
void
 test_az_float128(
 test_az_float128(
     float128 trueFunction( float128 ), float128 testFunction( float128 ) )
     float128 trueFunction( float128 ), float128 testFunction( float128 ) )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_a_float128 );
    testCases_initSequence( testCases_sequence_a_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128 );
        trueZ = trueFunction( testCases_a_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128 );
        testZ = testFunction( testCases_a_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                 && float128_is_signaling_nan( testCases_a_float128 ) ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInput_a_float128();
                writeInput_a_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
 
 
}
}
 
 
void
void
 test_ab_float128_z_flag(
 test_ab_float128_z_flag(
     flag trueFunction( float128, float128 ),
     flag trueFunction( float128, float128 ),
     flag testFunction( float128, float128 )
     flag testFunction( float128, float128 )
 )
 )
{
{
    int16 count;
    int16 count;
    flag trueZ, testZ;
    flag trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float128 );
    testCases_initSequence( testCases_sequence_ab_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128, testCases_b_float128 );
        trueZ = trueFunction( testCases_a_float128, testCases_b_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128, testCases_b_float128 );
        testZ = testFunction( testCases_a_float128, testCases_b_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
        if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float128_is_signaling_nan( testCases_a_float128 )
                 && (    float128_is_signaling_nan( testCases_a_float128 )
                      || float128_is_signaling_nan( testCases_b_float128 ) )
                      || float128_is_signaling_nan( testCases_b_float128 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
            if ( ( trueZ != testZ ) || ( trueFlags != testFlags ) ) {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float128();
                writeInputs_ab_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_flag( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
void
void
 test_abz_float128(
 test_abz_float128(
     float128 trueFunction( float128, float128 ),
     float128 trueFunction( float128, float128 ),
     float128 testFunction( float128, float128 )
     float128 testFunction( float128, float128 )
 )
 )
{
{
    int16 count;
    int16 count;
    float128 trueZ, testZ;
    float128 trueZ, testZ;
    uint8 trueFlags, testFlags;
    uint8 trueFlags, testFlags;
 
 
    errorCount = 0;
    errorCount = 0;
    tenthousandsCount = 0;
    tenthousandsCount = 0;
    count = 10000;
    count = 10000;
    testCases_initSequence( testCases_sequence_ab_float128 );
    testCases_initSequence( testCases_sequence_ab_float128 );
    writeTestsTotal();
    writeTestsTotal();
    while ( ! testCases_done || forever ) {
    while ( ! testCases_done || forever ) {
        testCases_next();
        testCases_next();
        *trueFlagsPtr = 0;
        *trueFlagsPtr = 0;
        trueZ = trueFunction( testCases_a_float128, testCases_b_float128 );
        trueZ = trueFunction( testCases_a_float128, testCases_b_float128 );
        trueFlags = *trueFlagsPtr;
        trueFlags = *trueFlagsPtr;
        (void) testFlagsFunctionPtr();
        (void) testFlagsFunctionPtr();
        testZ = testFunction( testCases_a_float128, testCases_b_float128 );
        testZ = testFunction( testCases_a_float128, testCases_b_float128 );
        testFlags = testFlagsFunctionPtr();
        testFlags = testFlagsFunctionPtr();
        --count;
        --count;
        if ( count == 0 ) {
        if ( count == 0 ) {
            checkEarlyExit();
            checkEarlyExit();
            count = 10000;
            count = 10000;
        }
        }
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
        if ( ! float128_same( trueZ, testZ ) || ( trueFlags != testFlags ) ) {
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && (    float128_is_signaling_nan( testCases_a_float128 )
                 && (    float128_is_signaling_nan( testCases_a_float128 )
                      || float128_is_signaling_nan( testCases_b_float128 ) )
                      || float128_is_signaling_nan( testCases_b_float128 ) )
               ) {
               ) {
                trueFlags |= float_flag_invalid;
                trueFlags |= float_flag_invalid;
            }
            }
            if (    ! checkNaNs
            if (    ! checkNaNs
                 && float128_isNaN( trueZ )
                 && float128_isNaN( trueZ )
                 && float128_isNaN( testZ )
                 && float128_isNaN( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ! float128_is_signaling_nan( testZ )
                 && ( trueFlags == testFlags )
                 && ( trueFlags == testFlags )
               ) {
               ) {
                /* no problem */
                /* no problem */
            }
            }
            else {
            else {
                ++errorCount;
                ++errorCount;
                writeErrorFound( 10000 - count );
                writeErrorFound( 10000 - count );
                writeInputs_ab_float128();
                writeInputs_ab_float128();
                printf( "  "/*, stdout*/ );
                printf( "  "/*, stdout*/ );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                writeOutputs_z_float128( trueZ, trueFlags, testZ, testFlags );
                //fflush( stdout );
                //fflush( stdout );
                if ( errorCount == maxErrorCount ) goto exit;
                if ( errorCount == maxErrorCount ) goto exit;
            }
            }
        }
        }
    }
    }
 exit:
 exit:
    writeTestsPerformed( 10000 - count );
    writeTestsPerformed( 10000 - count );
    return;
    return;
 
 
}
}
 
 
#endif
#endif
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.