APPLICATION NOTE REJ06J0013-0100 /Rev.1.00 June 2007 Page 1 of 31 SuperH RISC engine C/C++ Compiler Package APPLICATION NOTE: [Compiler use guide] Efficient programming techniques This document introduces efficient programming techniques for SuperH RISC engine C/C++ Compiler V.9. Table of contents 1. Summary ........................................................................................................................................... 2 2. Data Specification ............................................................................................................................. 4 2.1 Local Variable(Data Size) ................................................................................................................. 5 2.2 Global Variable(Signs) ...................................................................................................................... 6 2.3 Data Structures ................................................................................................................................. 7 2.4 Data Alignment............................................................................................................................... ... 8 2.5 Initial Values and the Const Type ..................................................................................................... 9 2.6 Local Variables and Global Variables ............................................................................................. 10 2.7 Referencing Constans..................................................................................................................... 11 2.8 Optimization of Division by Constant .............................................................................................. 12 2.9 Offset of Member in Structure Declaration...................................................................................... 13 2.10 Allocation of Bit Fields..................................................................................................................... 14 2.11 Loop Control Variables.................................................................................................................... 15 3. Function Calls.................................................................................................................................. 17 3.1 Incorporation of Functions in Modules ............................................................................................ 18 3.2 Function Interface.............................. .............................................................................................. 20 4. Operations ....................................................................................................................................... 22 4.1 Reducing the Number of L oops ...................................................................................................... 23 4.2 Use of Tables .................................................................................................................................. 25 4.3 Conditionals............................................................................................. ........................................ 27 5. Branching ........................................................................................................................................ 28 Website and Support <website and support,ws> .............................................................................. 30