Linux-kernel mailing list archive 1998-31,: Re: floating-point abuse in 2.1.113

# Re: floating-point abuse in 2.1.113

Andi Kleen (ak@muc.de)
06 Aug 1998 02:32:58 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Henrik Olsen: "Re: gcc 2.7.1"
- Previous message: Marty Leisner: "was 2.1.114 supposed to fix the pci bios problems?"
- In reply to: H. Peter Anvin: "Re: floating-point abuse in 2.1.113"
- Next in thread: Mikael Pettersson: "Re: floating-point abuse in 2.1.113"

hpa@transmeta.com (H. Peter Anvin) writes:

> Followup to: <199808042250.SAA24173@jupiter.cs.uml.edu>
> By author: "Albert D. Cahalan" <acahalan@cs.uml.edu>
> In newsgroup: linux.dev.kernel
> >
> > Yes, of course. You have a literal float multiplied by a literal int.
> > The compiler should promote the int and multiply. After that, the compiler
> > should convert the result to an int, eliminating the cast. Then the compiler
> > should store that int value in the object file. Why not?
> >
> > If this has anything to do with IEEE rounding modes, gross!
> > In that case, gcc needs a -flinux-kernel option. Maybe one of the
> > existing flags will make gcc optimize away the floating point math.
> > How about -ffast-math?
> >
>
> Very few compilers will do *ANY* arithmetic on floating-point
> constants, mostly because it is so incredibly painful to do when
> cross-compiling. Since gcc is designed that it can be run as a
> cross-compilier if desired...

I don't think this is a big problem anymore with mostly all CPUs supporting
standard IEEE floating point arithmetic. Is there any Linux target that has
non-IEEE FP? I doubt it.

Gcc combines floating point constants in constant expressions, even when
cross compiling.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

- Next message: Henrik Olsen: "Re: gcc 2.7.1"
- Previous message: Marty Leisner: "was 2.1.114 supposed to fix the pci bios problems?"
- In reply to: H. Peter Anvin: "Re: floating-point abuse in 2.1.113"
- Next in thread: Mikael Pettersson: "Re: floating-point abuse in 2.1.113"