This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] implement log10 and log2 functions as x87 builtins
- From: Uros Bizjak <uros at kss-loka dot si>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Feb 2004 17:09:29 +0100
- Subject: Re: [PATCH] implement log10 and log2 functions as x87 builtins
- References: <Pine.LNX.4.44.0402100456160.21474-100000@www.eyesopen.com>
Roger Sayle wrote:
The patch itself looks fine. However to large accept contributions to
GCC we need to have a FSF copyright assignment on file. You'll need to
send an e-mail to assignments@gnu.org requesting the relevant forms.
Thanks for reviewing this patch! As this is mainly cut'n'paste work, I
didn't
consider it a big contribution, but following your instructions, I have
sent a request for
copyright assignment.
For this patch, its also a good idea to include a new testcase or two.
All that's required is a simple check that "log2" and "log10" can be
called (probably both with compile-time constants or with variables) in
their float, double and long double forms with -ffast-math on x86. You
don't even need to check the return values. This ensures that all of
the new code added by your patch is executed atleast once in gcc's
testsuite, and prevents someone from breaking it in the future.
Thanks for instructions, I will make an appropriate testcase.
Once the paperwork is sorted out, there should be no problem getting
this patch approved and committed to mainline for gcc 3.5.
BTW: From existing code, builtins for exp10() and exp2() functions can
be written the same way
as builtins for logN. With these functions, it is possible to provide
following transformations
with -ffast-math:
pow(10.0, x) -> exp10(x)
pow(2.0,x) -> exp2(x)
pow(e,x) -> exp(x) // this one is somehow funny...
Uros.