EmbeddedRelated.com
Forums

Qestion about cycle count in ARM Cortex-A8?

Started by Unknown January 27, 2014
On 04/02/14 10:15, Tauno Voipio wrote:
> On 3.2.14 23:37, David Brown wrote: >> >> I have only 30 years of assembly experience, but I have the same >> attitude. The gcc inline assembly is so well integrated with the >> compiler that if you need to use it for a particular odd instruction, it >> can happily optimise the rest of the code around it. >> >> I still think it is very important to be able to /understand/ the >> assembly generated by the compiler, although it can be hard with >> complicated RISC cpus with lots of registers. But sometimes for >> critical code it is good to look closely at the assembly to see what is >> happening, and it can affect the way you write the C code (especially >> for less powerful processors). > > > That is why I always make the compiler (or actually the toolkit) > generate an assembly listing of a compilation. Just add > > -Wa,-ahlms=my_filename.lst > > to the GCC command line. >
I have the same thing in every Makefile (except that I put the lst files in a different directory). It is highly recommended.
On Tue, 04 Feb 2014 10:37:26 +0100, David Brown wrote:

> On 04/02/14 10:15, Tauno Voipio wrote: >> On 3.2.14 23:37, David Brown wrote: >>> >>> I have only 30 years of assembly experience, but I have the same >>> attitude. The gcc inline assembly is so well integrated with the >>> compiler that if you need to use it for a particular odd instruction, >>> it can happily optimise the rest of the code around it. >>> >>> I still think it is very important to be able to /understand/ the >>> assembly generated by the compiler, although it can be hard with >>> complicated RISC cpus with lots of registers. But sometimes for >>> critical code it is good to look closely at the assembly to see what >>> is happening, and it can affect the way you write the C code >>> (especially for less powerful processors). >> >> >> That is why I always make the compiler (or actually the toolkit) >> generate an assembly listing of a compilation. Just add >> >> -Wa,-ahlms=my_filename.lst >> >> to the GCC command line. >> >> > I have the same thing in every Makefile (except that I put the lst files > in a different directory). It is highly recommended.
I do that too. It regularly saves my ass, sometimes by forcing me to realize than yes, the compiler just did exactly what I told it to. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com