C/C++ compiler and optimization with ARM processors

Make it to the Right and Larger Audience

White Paper

C/C++ compiler and optimization with ARM processors

In this tutorial, we talk about C/C++ compiler and optimization with ARM processors.

We first briefly talk about ARM architecture and then quickly move into C/C++ compiling and linking technologies and optimizations.
This tutorial has a heavy focus on arm processors which is the most popular processor family in mobile, embedded, and low power domain.

It is a 101 page slides.

 

The following are some of the topics touched.

What is tail-call optimization to avoid the use of unnecessary returns in function hierarchies?

tail-call

 

How to estimate Stack size?
1. Linking with -callgraph produces a static callgraph in html showing information on all functions, including stack usage
2. Set a watchpoint on the last available location in the stack and see if the watchpoint is ever hit (severe performance penalty with ARMulator or Angel).
3. Define a stack which is much larger than you expect you need, then fill it with a known value (e.g. zero or 0xDEADDEAD). Run your application. After your application has finished running, examine the stack area of memory to see how many of the zeros (or 0xDEADDEAD) have been overwritten by stack accesses. This will show how far the stack has grown in memory. You can then adjust the size of the stack to (a little above) this known size.
4. If using ARMulator, use a map file to define a region of memory where access is not allowed (with ‘-‘). Place this region directly below your stack in memory. If the stack overflows into the forbidden region, a data abort will occur, which can be trapped by the Debugger.
5. Can do a similar thing with an MMU or MPU by marking an area as no access.

 

Concerns in alignment of pointers:

pointer_align

 

How to optimize base pointer:

base_pointer_opt

 

Here is the full 101-page slides:

The following is site premium content.
Use points to gain access. You can either purchase points or contribute content and use contribution points to gain access.
Highlights: 87 words, 1 images, 1 docs
Preview:
 
Lakeside Embedded Technologies is an embedded system design firm. We offer first class firmware design service based on our deep understanding of ARM processors and its hardware/software architectures. We also offer online and onsite ARM firmware trainings.
5 Comments
  1. alexsdsd69 11 months ago
    0
    -0

    nice

    0
  2. rao_mallikarjun 1 year ago
    0
    -0

    good article lot of details

    0
  3. Ouranos 2 years ago
    0
    -0

    Nice slides.

    5
  4. jQiu 5 years ago
    0
    -0

    Very good explaining of ARM registers and their usage in function calls, inline assembly, etc.

    5
  5. blairshih 5 years ago
    0
    -0

    Good and a lot of details. It does challenge my understanding of c programming, compiler, and linker.

    5

Contact Us

Thanks for helping us better serve the community. You can make a suggestion, report a bug, a misconduct, or any other issue. We'll get back to you using your private message ASAP.

Sending

©2021  ValPont.com

Forgot your details?