This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: The "right way" to handle alignment of pointer targets in the compiler?
- From: Tim Prince <n8tm at aol dot com>
- To: Benjamin Redelings I <benjamin_redelings at ncsu dot edu>
- Cc: tprince at computer dot org, gcc at gcc dot gnu dot org
- Date: Sat, 02 Jan 2010 19:48:52 -0800
- Subject: Re: The "right way" to handle alignment of pointer targets in the compiler?
- References: <4B3E8F68.30605@ncsu.edu> <7632_1262400737_o022qGlj008167_4B3EB4C6.8020606@aol.com> <4B3F8980.9010808@ncsu.edu>
- Reply-to: tprince at computer dot org
Benjamin Redelings I wrote:
Thanks for the information!
Here are several reasons (there are more) why gcc uses 64-bit loads by
default:
1) For a single dot product, the rate of 64-bit data loads roughly
balances the latency of adds to the same register. Parallel dot products
(using 2 accumulators) would take advantage of faster 128-bit loads.
2) run-time checks to adjust alignment, if possible, don't pay off for
loop counts < about 40.
3) several obsolete CPU architectures implemented 128-bit loads by pairs
of 64-bit loads.
4) 64-bit loads were generally more efficient than movupd, prior to
barcelona.
In the case you quote, with parallel dot products, 128-bit loads would
be required so as to show much performance gain over x87.