Re: Multiply and Accumulate



David schrieb:
I am working on some filter calculations which can be quite lengthy and
wondered if anyone knew if the Intel Pentium has a "MultiplyAndAccumlate"
instruction as found in DSP chips.
Yes they do. Take a look at the MMX (for fixed point calculations) and
AFAIK the SSEx for the floating point calculations:

If you calculate on words or integers then have a look at
the movq
and the pmaddwd (and others).

P.S.: You can already achieve a boost if you vectorize your
loop manually (e.g.:

i := 0;
repeat
inc(Result, A[i]*B[j+1]);
inc(Result, A[i+1]*B[j+1]);
...
inc(i, amount);
until yourCondition;

// don't forget here the last few operations which did not fit into
// the vectorization loop
// it's even faster if you only use pointer arithmetic!
.



Relevant Pages

  • Re: Use DSP for heavy floating-point calculation
    ... I'm writing a program for stock trading simulation to verify something. ... You mentioned that you are doing a bit of math and then a compare -- DSP chips are no better than 'regular' chips if the algorithm has a lot of branching. ... If you could vectorize the calculations, and separate the decisions from them, then doing the problem in SciLab or MatLab would probably be orders of magnitude faster than in VB -- both of those programs are optimized for vector operations but suck at 'for' loops. ... Wescott Design Services ...
    (comp.dsp)
  • Re: Common Ancestor?
    ... An instruction is something which a CPU executes. ... NOP is an instruction involving 0 calculations. ...
    (talk.origins)
  • Re: Instruction Cycle of a 8086 statement
    ... the Intel docs said, except for really slow instructions like MUL ... The true instruction count is this: ... If you use an opcode which takes longer than this, then the cpu can use the slack time to prefech upcoming opcode bytes, and the next instructioncan/will run a little faster, since the opcode bytes can be skipped from the bus transfer calculations. ...
    (comp.lang.asm.x86)
  • Re: Common Ancestor?
    ... (at least not on architectures which I'm familiar with). ... NOP is an instruction involving 0 calculations. ... MOVE is an instruction involving 0 calculations. ...
    (talk.origins)