tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Adding asm examples



On Sun, Nov 13, 2011 at 11:19:44PM +0000, Valeriy E. Ushakov wrote:
> 
> > Some other people in this thread have expressed why they think this
> > would be valuable to them.  Granted, in the current form, the code does
> > not cover their "use cases" yet.  The most obvious of these is having an
> > example that shows how to write an asm function that can be called from C.
> 
> As I said, cc -S is your friend here.  It will give you infinite
> examples of exactly what you want, where you use C to express what you
> want.  Throw in -fpic, -fomit-frame-pointer etc for more fun.

And -fverbose-asm
I've often used compiler genereated code to help understand how
an instruction set works.
Generally the code is easier to read with -O2 or -O3.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index