refactors zeroProd branch to allow for better case handling

This commit is contained in:
Eyck-Alexander Jentzsch 2024-07-30 12:02:40 +02:00
parent 7ffa7667b6
commit 2edd68d1bd
1 changed files with 12 additions and 7 deletions

View File

@ -212,13 +212,18 @@ float32_t
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
zeroProd:
uiZ = (uiC & ~(1UL << 31)) | ((unsigned long)signC << 31); //set sign bit
if ( ! (expC | sigC) && (signProd != signC) ) {
if(expC | sigC){
//3rd operand != 0
uiZ = (uiC & ~(1UL << 31)) | ((unsigned long)(signC) << 31); //set sign bit
}
else {
//3rd operand == +-0
if (signProd != signC) {
completeCancellation:
uiZ =
packToF32UI(
(softfloat_roundingMode == softfloat_round_min), 0, 0 );
uiZ = (uiZ & ~(1UL << 31)) | ((unsigned long)(signC|signProd) << 31); //set sign bit
uiZ = packToF32UI((softfloat_roundingMode == softfloat_round_min), 0, 0 );
goto uiZ;
}
uiZ = (uiC & ~(1UL << 31)) | ((unsigned long)signC << 31); //set sign bit
}
uiZ:
uZ.ui = uiZ;