Re: floating-point abuse in 2.1.113

H. Peter Anvin (hpa@transmeta.com)
5 Aug 1998 21:13:58 GMT


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...

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- 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