ns32k fixes
Andrew Pinski
pinskia@physics.uc.edu
Mon Jul 29 19:44:00 GMT 2002
Your patch does not follow C alias rules, you should use an union.
Thanks,
Andrew Pinski
>
>
> --pG7rHtfCel
> Content-Type: text/plain; charset=us-ascii
> Content-Description: message body text
> Content-Transfer-Encoding: 7bit
>
> Richard Henderson writes:
> > On Mon, Jul 29, 2002 at 11:43:20PM +0930, Ian Dall wrote:
> > > + # define ISNAN(x) ( \
> > > + { \
> > > + unsigned int t = (x); \
> >
> > This isn't right. You want the bit pattern for X, not
> > the float->int conversion of X.
>
> Well spotted. It turns out that there isn't a test case for this
> single precision case. I have created one and will send it in a
> following message.
>
> Here is an additional patch (rather than a replacement one, is that OK?)
>
> 2002-07-30 Ian Dall <ian@sibyl.beware.dropbear.id.au>
>
> * config/ns32k/__unordsf2.c (ISNAN): Avoid converting float to int.
>
>
>
> --pG7rHtfCel
> Content-Type: text/x-patch
> Content-Disposition: inline;
> filename="gcc.diffs"
> Content-Transfer-Encoding: 7bit
>
> Index: config/ns32k/__unordsf2.c
> ===================================================================
> RCS file: /usr/local/cvs-rep/gcc/gcc/config/ns32k/__unordsf2.c,v
> retrieving revision 1.1
> diff -c -3 -p -r1.1 __unordsf2.c
> *** config/ns32k/__unordsf2.c 29 Jul 2002 15:12:23 -0000 1.1
> --- config/ns32k/__unordsf2.c 30 Jul 2002 01:38:11 -0000
> *************** Boston, MA 02111-1307, USA. */
> *** 22,28 ****
>
> # define ISNAN(x) ( \
> { \
> ! unsigned int t = (x); \
> ((t & 0x7f800000) == 0x7f800000) && \
> ((t & 0x7fffff) != 0); \
> })
> --- 22,28 ----
>
> # define ISNAN(x) ( \
> { \
> ! unsigned int t = * (unsigned int *) &(x); \
> ((t & 0x7f800000) == 0x7f800000) && \
> ((t & 0x7fffff) != 0); \
> })
>
> --pG7rHtfCel--
>
>
More information about the Gcc-patches
mailing list