This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for Bug#12955


#if 0 is never the right way to fix this. If the code is wrong then just
delete and replace.

-eric

On Fri, 2003-11-07 at 16:14, Michael Eager wrote:
> --
> Michael Eager     eager@mvista.com	408-328-8426	
> MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085
> 
> ______________________________________________________________________
> 2003-11-07  Michael Eager <eager@mvista.com>
> 	* fp-bit.c: Fix errors in rounding 
> 
> Index: fp-bit.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/fp-bit.c,v
> retrieving revision 1.43
> diff -u -r1.43 fp-bit.c
> --- fp-bit.c	22 Aug 2003 09:33:25 -0000	1.43
> +++ fp-bit.c	7 Nov 2003 23:57:11 -0000
> @@ -888,6 +888,7 @@
>  	}
>      }
>  #endif
> +#if 0
>    if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB)
>      {
>        if (high & (1 << NGARDS))
> @@ -901,6 +902,10 @@
>  	  high += GARDROUND + 1;
>  	}
>      }
> +#else 
> +  /* LSB of high is proxy for all bits in low */
> +  if (low) high |= 0x1;
> +#endif
>    tmp->fraction.ll = high;
>    tmp->class = CLASS_NUMBER;
>    return tmp;
> @@ -998,6 +1003,7 @@
>  	numerator *= 2;
>        }
>  
> +#if 0
>      if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
>        {
>  	if (quotient & (1 << NGARDS))
> @@ -1011,6 +1017,10 @@
>  	    quotient += GARDROUND + 1;
>  	  }
>        }
> +#else
> +    /* LSB of quotient is proxy for all low order bits in numerator */
> +    if (numerator) quotient |= 0x1;
> +#endif
>  
>      a->fraction.ll = quotient;
>      return (a);
-- 
Eric Christopher <echristo@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]