Top Banner
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  
32

Rej06j0013 Shc Prog1 An

Apr 10, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 1/31

Page 2: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 2/31

Page 3: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 3/31

Page 4: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 4/31

Page 5: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 5/31

Page 6: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 6/31

Page 7: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 7/31

Page 8: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 8/31

Page 9: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 9/31

Page 10: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 10/31

Page 11: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 11/31

Page 12: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 12/31

Page 13: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 13/31

Page 14: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 14/31

Page 15: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 15/31

Page 16: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 16/31

Page 17: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 17/31

Page 18: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 18/31

Page 19: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 19/31

Page 20: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 20/31

Page 21: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 21/31

Page 22: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 22/31

Page 23: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 23/31

Page 24: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 24/31

Page 25: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 25/31

Page 26: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 26/31

Page 27: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 27/31

Page 28: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 28/31

Page 29: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 29/31

Page 30: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 30/31

Page 31: Rej06j0013 Shc Prog1 An

8/8/2019 Rej06j0013 Shc Prog1 An

http://slidepdf.com/reader/full/rej06j0013-shc-prog1-an 31/31