Strange conditional jumps on the POWER4

David Edelsohn dje@watson.ibm.com
Mon Apr 7 23:03:00 GMT 2003


>>>>> Segher Boessenkool writes:

>> With gcc-3.4 -O2 -ffast-math:
>> N7 assignments         3.00000000000000000                 137.619    7.720

>> With gcc-3.4 -O2 -ffast-math -mcpu=power4
>> N7 assignments         3.00000000000000000                  88.334   12.090

Segher> That last one looks very bad, too.  Could you post source
Segher> and asm snippets for that?

	The N7 performance difference is due to an unfortunate instruction
address alignment.  The default processor model just happens to align the
N7 loop well and the Power4 model aligns it poorly.  The AIX assembler
does not understand .p2align to allow GCC to generate alignment
directives to improve this.  However, using

-ffunction-sections -fdata-sections

allows the AIX linker to lay out the functions more effectively, also
producing better alignments, recovering most of the performance.

David



More information about the Gcc mailing list