This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: Convert 1.0/sqrtf (x) into rsqrtf even without -mrecip
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 05 Jan 2008 10:10:43 -0500
- Subject: Re: [RFC PATCH, i386]: Convert 1.0/sqrtf (x) into rsqrtf even without -mrecip
- References: <477F7FEA.9040505@gmail.com>
Be careful about over-optimizing that particular benchmark or
isolated statement. If the costs on Core2 make it a general win, great.
I eventually want to enhance the TARGET_BUILTIN_RECIPROCAL
interface to have a cost parameter that counts the number of other FP
instructions in the basic block or function to know if there is enough
other work that can be inter-scheduled with the NR iterations. On
PowerPC, at least, the benefit is more about intermingling other
computations instead of occupying the FPU with a long latency instruction.
If there is no other FP work, one might as well not bloat the I-cache and
use the single instruction.
In the long run, the subtlety of a cost model probably would help
x86 as well.
David