|Finding MAC instructions firstname.lastname@example.org (Christian Christmann) (2006-07-16)|
|Re: Finding MAC instructions email@example.com (Amit Gupta) (2006-07-18)|
|Re: Finding MAC instructions firstname.lastname@example.org (Jeff Kenton) (2006-07-22)|
|Re: Finding MAC instructions email@example.com (2006-07-23)|
|From:||"Amit Gupta" <firstname.lastname@example.org>|
|Date:||18 Jul 2006 01:16:44 -0400|
Your problem falls into two categories:
1. Expression Restructuring
2. Mapping to MAC operations.
A naive (but useful) preprocessing step would be to greedily select
obvious mac operations. This is easier done at high-level language
flow graph before it is converted to IR representation. The useful
thing is here is, you can catch the designer intent, before conversion
to IR modifies the control graph. You can probably go through some
papers on tree-height-reduction(THR) or operator strength reduction
algorithms to get an idea about it ( I am speaking from the vlsi-cad
background, where mapping to specific architecture/instruction is
An important part of your scheme would be, how to do expression
restructuring. e.g., if you have (d = ac + cb + d), you can
restructure it to (d = (a+ b)*c + d)), where you can use the mac
operation. If you have lots of time in hand, I believe a simulated
annealing framework can do good restructuring. Otherwise, you can
devise some algorithm based on windowing which tries to change maximum
number of operations into mac instruction.
I believe, your problem falls into NP or higher class, and therefore it
is difficult to get an exact algorithm for this problem.
Christian Christmann wrote:
> for a project I want to extend our comiler (more accurately, our
> code generator) for a DSP by generating optimized code using
> DSP-specific instructions like the MAC (multiply accumulte).
Return to the
Search the comp.compilers archives again.