- Timestamp:
- Apr 22, 2022 8:23:10 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/softfloat-3e/source/s_roundPackToExtF80.c
r94677 r94681 325 325 softfloat_exceptionFlags = 0; 326 326 extFloat80_t r80Result = softfloat_roundPackToExtF80Inner( sign, exp, sig, sigExtra, roundingPrecision, pState ); 327 328 327 if ( !(softfloat_exceptionFlags & ~pState->exceptionMask & (softfloat_flag_underflow | softfloat_flag_overflow)) ) { 329 /* likely */ 330 } 328 /* Denormals are fun, because they don't cause #U when masked, and the inner 329 code here assume it's always masked. So, detect denormals and check if it 330 was masked or not, in the latter case do bias adjust. */ 331 if ( (r80Result.signif & RT_BIT_64( 63 )) 332 || !r80Result.signif 333 || (pState->exceptionMask & softfloat_flag_underflow) ) { 334 softfloat_exceptionFlags |= exceptionFlagsSaved; 335 return r80Result; 336 } 337 338 /* Denormal and underflow not masked, need to adjust the exponent bias 339 to match 387 behaviour. */ 340 Assert( expExtF80UI64( r80Result.signExp ) == 0 ); 341 softfloat_exceptionFlags |= softfloat_flag_underflow; 342 } 343 331 344 /* On Intel 10980XE the FSCALE instruction can cause really large exponents 332 345 and the rounding changes when we exceed the bias adjust. */ 333 elseif (exp >= RTFLOAT80U_EXP_BIAS_ADJUST + RTFLOAT80U_EXP_MAX) {346 if (exp >= RTFLOAT80U_EXP_BIAS_ADJUST + RTFLOAT80U_EXP_MAX) { 334 347 Assert( softfloat_exceptionFlags & softfloat_flag_overflow ); 335 348 softfloat_exceptionFlags |= softfloat_flag_inexact | softfloat_flag_c1; … … 352 365 r80Result = softfloat_roundPackToExtF80Inner( sign, exp, sig, sigExtra, roundingPrecision, pState ); 353 366 } 354 355 367 softfloat_exceptionFlags |= exceptionFlagsSaved; 356 368 return r80Result;
Note:
See TracChangeset
for help on using the changeset viewer.