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

Re: [Sheflug] c++ & mem



>>>>> "Will" == Will Newton <will [at] misconception.org.uk> writes:

    Will> So what does -march and -mcpu do in gcc? Surely scheduling
    Will> is modified by these params?

ah, ah, ah.  I see why we're talking at cross-purposes.  I'm talking
about memory-mapped IO, not processor instructions.  The former
requires a spec sheet that the compiler writer doesn't have to hand,
whereas obviously the compiler writer has the spec sheet for the CPU.

Attachment of Duff's Explanation of Duff's Device at end.

    Will> A brain damaged architecture like x86 lends itself to hand
    Will> tuned code, whereas a more register-full architecture with
    Will> RISC design (e.g. Ultra SPARC) it's probably best to let the
    Will> compiler do it's thing.

For instruction scheduling and register allocation, yes.  I'm talking
about slightly higher level things where tuning C, not asm, code can
make a difference (ie, not like using explict temporaries to force
computation order or register allocation, but things like optimal loop
unrolling and rearranging structures to optimize object alignment).