Hi Nils,

On 02.01.2013 10:19, Nils Wallménius wrote:
> I have been contributing some patches with
> optimizations in this area upstream and hope that soon we will be able
> to merge in the upstream codec to rockbox. It also has some other
> optimizations and other improvements that might help us.
That sounds truely great!

> Gcc doesn't handle the coldfire EMAC at all so you can only use the
> special regs in asm, not bind them to c vars. Take a look at how this
> is done in other functions, there are lots of them, an example is
> MULT16_32_Q15 in the fixed_generic.h file you were editing.
I've seen that function. The problem with the
Multiply-And-Accumulate-Function (MAC16_16 it's called iirc), is that it
takes three arguments, the accumulation variable c and the two
multiplication operands a and b. The syntax for the ASM mnemonic is (±
characters):

    mac.l %dX, %dY, %RaccX

%RaccX is required to be an accumulation register. So the only way to
handle this is to move the variable c into the %RaccX, run the
mac-instruction, and copy it out again. This sounds horribily
inefficient and I doubt that there's still any benefit over just adding
and multiplying (I wish I had the PDF with the instruction timings at hand).

-- Jonas

Reply via email to