Ejemplo n.º 1
0
void
 test_a_f128_z_ui32_rx(
     uint_fast32_t trueFunction( const float128_t *, uint_fast8_t, bool ),
     uint_fast32_t subjFunction( const float128_t *, uint_fast8_t, bool ),
     uint_fast8_t roundingMode,
     bool exact
 )
{
    int count;
    uint_fast32_t trueZ;
    uint_fast8_t trueFlags;
    uint_fast32_t subjZ;
    uint_fast8_t subjFlags;

    genCases_f128_a_init();
    genCases_writeTestsTotal( testLoops_forever );
    verCases_errorCount = 0;
    verCases_tenThousandsCount = 0;
    count = 10000;
    while ( ! genCases_done || testLoops_forever ) {
        genCases_f128_a_next();
        *testLoops_trueFlagsPtr = 0;
        trueZ = trueFunction( &genCases_f128_a, roundingMode, exact );
        trueFlags = *testLoops_trueFlagsPtr;
        testLoops_subjFlagsFunction();
        subjZ = subjFunction( &genCases_f128_a, roundingMode, exact );
        subjFlags = testLoops_subjFlagsFunction();
        --count;
        if ( ! count ) {
            verCases_perTenThousand();
            count = 10000;
        }
        if ( (trueZ != subjZ) || (trueFlags != subjFlags) ) {
            if (
                ! verCases_checkNaNs
                    && f128M_isSignalingNaN( &genCases_f128_a )
            ) {
                trueFlags |= softfloat_flag_invalid;
            }
            if (
                   (trueZ != 0xFFFFFFFF)
                || (subjZ != 0xFFFFFFFF)
                || (trueFlags != softfloat_flag_invalid)
                || (subjFlags != softfloat_flag_invalid)
            ) {
                ++verCases_errorCount;
                verCases_writeErrorFound( 10000 - count );
                writeCase_a_f128M( &genCases_f128_a, "  " );
                writeCase_z_ui32( trueZ, trueFlags, subjZ, subjFlags );
                if ( verCases_errorCount == verCases_maxErrorCount ) break;
            }
        }
    }
    verCases_writeTestsPerformed( 10000 - count );

}
void
 test_a_f128_z_extF80(
     void trueFunction( const float128_t *, extFloat80_t * ),
     void subjFunction( const float128_t *, extFloat80_t * )
 )
{
    int count;
    extFloat80_t trueZ;
    uint_fast8_t trueFlags;
    extFloat80_t subjZ;
    uint_fast8_t subjFlags;

    genCases_f128_a_init();
    genCases_writeTestsTotal( testLoops_forever );
    verCases_errorCount = 0;
    verCases_tenThousandsCount = 0;
    count = 10000;
    while ( ! genCases_done || testLoops_forever ) {
        genCases_f128_a_next();
        *testLoops_trueFlagsPtr = 0;
        trueFunction( &genCases_f128_a, &trueZ );
        trueFlags = *testLoops_trueFlagsPtr;
        testLoops_subjFlagsFunction();
        subjFunction( &genCases_f128_a, &subjZ );
        subjFlags = testLoops_subjFlagsFunction();
        --count;
        if ( ! count ) {
            verCases_perTenThousand();
            count = 10000;
        }
        if ( ! extF80M_same( &trueZ, &subjZ ) || (trueFlags != subjFlags) ) {
            if (
                ! verCases_checkNaNs
                    && f128M_isSignalingNaN( &genCases_f128_a )
            ) {
                trueFlags |= softfloat_flag_invalid;
            }
            if (
                   verCases_checkNaNs
                || ! extF80M_isNaN( &trueZ )
                || ! extF80M_isNaN( &subjZ )
                || extF80M_isSignalingNaN( &subjZ )
                || (trueFlags != subjFlags)
            ) {
                ++verCases_errorCount;
                verCases_writeErrorFound( 10000 - count );
                writeCase_a_f128M( &genCases_f128_a, "  " );
                writeCase_z_extF80M( &trueZ, trueFlags, &subjZ, subjFlags );
                if ( verCases_errorCount == verCases_maxErrorCount ) break;
            }
        }
    }
    verCases_writeTestsPerformed( 10000 - count );

}