Exemple #1
0
void
testFunction(
	     uint8 functionCode, int8 roundingPrecisionIn, int8 roundingModeIn )
{
  int8 roundingPrecision, roundingMode;
  
  roundingPrecision = 32;
  for (;;) {

    if ( ! functions[ functionCode ].roundingPrecision ) {
      roundingPrecision = 0;
    }
    else if ( roundingPrecisionIn ) {
      roundingPrecision = roundingPrecisionIn;
    }
 
    for ( roundingMode = 1;
	  roundingMode < NUM_ROUNDINGMODES;
	  ++roundingMode
	  ) 
      {
	if ( ! functions[ functionCode ].roundingMode ) {
	  roundingMode = 0;
	}
	else if ( roundingModeIn ) {
	  roundingMode = roundingModeIn;
	}
	testFunctionVariety(
			    functionCode, roundingPrecision, roundingMode );
	
	if ( roundingModeIn || ! roundingMode ) 
	  break;
      }
    
    if ( roundingPrecisionIn || ! roundingPrecision ) 
      break;
    
    if ( roundingPrecision == 80 ) {
      break;
    }
    else if ( roundingPrecision == 64 ) {
      roundingPrecision = 80;
    }
    else if ( roundingPrecision == 32 ) {
      roundingPrecision = 64;
    }
  }  
}
Exemple #2
0
static void
 testFunction(
     uint8 functionCode,
     int8 roundingPrecisionIn,
     int8 roundingModeIn,
     int8 tininessModeIn
 )
{
    int8 roundingPrecision, roundingMode, tininessMode;

    roundingPrecision = 32;
    for (;;) {
        if ( ! functions[ functionCode ].roundingPrecision ) {
            roundingPrecision = 0;
        }
        else if ( roundingPrecisionIn ) {
            roundingPrecision = roundingPrecisionIn;
        }
        for ( roundingMode = 1;
              roundingMode < NUM_ROUNDINGMODES;
              ++roundingMode
            ) {
            if ( ! functions[ functionCode ].roundingMode ) {
                roundingMode = 0;
            }
            else if ( roundingModeIn ) {
                roundingMode = roundingModeIn;
            }
            for ( tininessMode = 1;
                  tininessMode < NUM_TININESSMODES;
                  ++tininessMode
                ) {
                if (    ( roundingPrecision == 32 )
                     || ( roundingPrecision == 64 ) ) {
                    if ( ! functions[ functionCode ]
                               .tininessModeAtReducedPrecision
                       ) {
                        tininessMode = 0;
                    }
                    else if ( tininessModeIn ) {
                        tininessMode = tininessModeIn;
                    }
                }
                else {
                    if ( ! functions[ functionCode ].tininessMode ) {
                        tininessMode = 0;
                    }
                    else if ( tininessModeIn ) {
                        tininessMode = tininessModeIn;
                    }
                }
                testFunctionVariety(
                    functionCode, roundingPrecision, roundingMode, tininessMode
                );
                if ( tininessModeIn || ! tininessMode ) break;
            }
            if ( roundingModeIn || ! roundingMode ) break;
        }
        if ( roundingPrecisionIn || ! roundingPrecision ) break;
        if ( roundingPrecision == 80 ) {
            break;
        }
        else if ( roundingPrecision == 64 ) {
            roundingPrecision = 80;
        }
        else if ( roundingPrecision == 32 ) {
            roundingPrecision = 64;
        }
    }

}