This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compile-time optimization of mathfn(CST) ?
- From: Bernd Jendrissek <berndj at prism dot co dot za>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 26 Mar 2004 09:03:06 +0200
- Subject: Re: Compile-time optimization of mathfn(CST) ?
- References: <200403251320.i2PDKq6n021654@caip.rutgers.edu>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Mar 25, 2004 at 08:20:52AM -0500, Kaveh R. Ghazi wrote:
> I'm wondering whether we can safely optimize builtin mathfn(CST) into
> a compile-time value by calling the host's `mathfn' when not
> cross-compiling.
>
> I understand that in the past it's been discussed that we need to use
> GMP's library to calculate the constant results to sufficient digits
> in the case where the target's FP has greater precision. However I
> don't see anyone working on this yet, (including me.)
>
> So I'm wondering if we can simply call the host math functions and
> wrap this in !CROSS_COMPILE so that we catch a vast portion of the
> cases where this transformation is useful.
So you'll produce different object code depending on whether a native or
a cross compiler produced the code? How will the regression testers
like that?
Or maybe you can add __builtin_native_evaluate() that you can put around
__builtin_sin() that will tell GCC that you want the result evaluated
NOW (IOW compile-time). Then you have control over native-vs-cross
inconsistencies where it belongs - in the source.
- --
"IBM has more patent litigation lawyers than SCO has employees." - unknown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQFAY9Wg/FmLrNfLpjMRAlxbAJ0TNGLd46+aZh9Jlc8K5xj/lYJ7igCfRQGk
LmWf3BrwVpuYTEqaUYmofe4=
=YC9D
-----END PGP SIGNATURE-----