lkml.org 
[lkml]   [1998]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: floating-point abuse in 2.1.113
From
Date
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

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.058 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site