Compiler tricks to improve speed

May 15, 2006 5 Replies

Hello All,



I am using C51 and my code runs on Infineon controller. For company policy reason I am not revealing the exact controller and sorry about that. I would like to improve the speed. I was using the large memory model for this compiler and now I use small memory model. This has improved speed a lot. I would like to know if there are some more such settings for this compiler to improve the speed. Thank you in advance.



Best regards, Shailendra


Sure.

1) throw out floating point 2) use smaller datatypes, eg byte instead of integer where appropriate

Rene

Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net

Using statics may make it faster.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

# Read the assembler output, and start to learn the code the compiler creates for given constructs. ie understand your tools # Focus on the code blocks, where you know speed matters. # Use in-line assembler, but only as a last resort. # Increase the CPU clock speed, or move to a newer infineon model, like the 868 or 888 variants ?

-jg

you may use intrinsics which map c statements to asm instructions this can improve speed in modules which r cycle instensive e.g. most processor haver leading count zero instruction ( there will be a corresponding multi nstructiont for the same ) u can use intrinsic to replace this code . this will give u codesize as well as speed

read the section of the manual on making the code smaller and faster.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required