|Compiling for DSP chips email@example.com (1990-09-07)|
|Re: Compiling for DSP chips firstname.lastname@example.org (1990-09-11)|
|Re: Compiling for DSP chips email@example.com (1990-09-24)|
|Re: Compiling for DSP chips firstname.lastname@example.org (1990-09-26)|
|Re: Compiling for DSP chips seanf@sco.COM (Sean Fagan) (1990-09-30)|
|Re: Compiling for DSP chips email@example.com (1990-10-02)|
|From:||firstname.lastname@example.org (David Keppel)|
|Keywords:||C, optimize, DSP|
|Organization:||University of Washington, Computer Science, Seattle|
|References:||<9009071606.AA22759@m2.csc.ti.com> <1990Sep11.email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org.COM>|
|Date:||2 Oct 90 01:40:00 GMT|
>email@example.com (David Keppel) writes:
>>[Tell gcc hard regs clobbered -> optimize around them.]
>>[If md knows about magic instructions can optimize over them,
>> even the compiler doesn't kow how to emit them.]
In article <firstname.lastname@example.org.COM> Sean Fagan <seanf@sco.COM> writes:
>[For example, `_inline_memcpy', `__inline_sin'.]
Gcc has the capability to do two things:
* Register allocation and code motion of `asm'-ed stuff. That's
what Sean described.
* Optimization of instructions that the compiler doesn't know
how to emit, provided the instructions are in the machine
I'm much fuzzier on the latter, but I think it works something
* The machine description contains information about how to
emit the "div" and "mod" instructions.
* The machine description contains a description of a peephole
optimization that says something like ``if there's a "div"
instruction next to a "rem" instruction, and they operate on
the same operands, then trash the "div" instruction and get
the results from the "rem" which computes "div" as a side-
* The compiler has no way of producing a "rem" instruction.
* The user defines an "asm" that emits a "rem" instruction.
* If the peephole matches, the optimization occurs, even tho'
the compiler never emitted the "rem".
I don't think this feature is used often on most targets because C
and the gcc IR are pretty well matched. However, I could immagine
the optimizations to be useful on e.g., DSP machines where there are
some machine primitives that match poorly with C semantics but for
which various optimizations could be done with neighboring
;-D on ( Looking for a few good digital signals ) Pardo
Return to the
Search the comp.compilers archives again.