[Patch, fortran] PR24518 and PR24520 - Improvements to MOD and

Tim Prince tprince@myrealbox.com
Tue Nov 15 15:36:00 GMT 2005


Paul Thomas wrote:
> Tim,
> 
>>
>> The code generated by a simple sum(a*b) for Itanium does not pipeline. 
>> It consists of purely serial operations with the same 3 registers 
>> repeated by the loop unrolling.  So, it will be limited to one 
>> addition per 4 clock cycles, at best, only 13% of peak floating point 
>> performance.  I don't think this should influence your decisions about 
>> implementation of sum() and dot_product().  It's one of the basic 
>> deficiencies of gnu compilers for this CPU.
>>
> Does the library dot product pipeline or do we have to do pairs of 
> multiply/add, within the loop?
> 
> Paul
> 
> 
The library version, as it is currently set up, is not much better. 
The source registers have been renamed and scheduled before the 
preceding fma, so that the 2nd through 8th fma operations in the 
unrolled loop could proceed at the latency of serial addition.  In the 
in-lined version, performance would be paced by the latency of the moves 
into the source registers, a minimum of 1 more cycle for each operation. 
  That is not normally enough to overcome the advantage of in-lining, 
but it opens the possibility that the library version could be 5% faster 
for long loops.  I didn't see that difference when I tested it.



More information about the Fortran mailing list