AnsweredAssumed Answered

compiled code (pragma optimize_for_speed) not optimal

Question asked by pfeifferc on Sep 3, 2014
Latest reply on Sep 12, 2014 by MikeP

Hi !

after some asm work in the past I look at some code parts generated by the compiler.

For performance optimizations I look at the loops and therefore I see that

       for(i=0; i < audioSetting.samplesPerEtherFrame; i++) iMixedChannel1[i]=0;


not always result in an optimized hardware loop

my general setting for the given function is pragma optimize_for_speed

this result in a code like

[FFA04018] R1 = W [ P5 ] ( X ) ;

[FFA0401A] LSETUP ( __BEGIN__.P81L178L , 14 /*0xFFA04028*/ ) LC0 = P0 ;

[FFA0401E] [ P1 ++ ] = R5 ;

[FFA04020] R0 += 1 ;

[FFA04022] NOP ;

[FFA04024] R1 = W [ P5 ] ( Z ) ;

[FFA04026] CC = R0 < R1 ;

[FFA04028] IF ! CC JUMP __END__.P81L178L ;


so I want to optimize and eliminate the conditional branches

I tried

pragma loop_count(32,128,32)  or

#pragma no_alias

with no effect

so what Is wrong or what is the correct way to get a Hardwareloop without this conditional branches and with

LC0 set to the given loop value ???


kind regards