This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280039C: Better way to write fast multiply-accumulation codes

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Dear Champs,

I am asking this for our customer.

They found even they use -O2 (optimization level) for such simple C codes like

Pseudo codes below:

int16 X[7]

int16 A[7]

int32 Y

Y = X[0]A[0] + X[1]A[1] + X[2]A[2] + X[3]A[3] + X[4]A[4] + X[5]A[5] + X[6]A[6]          // These code are running from RAM.

But the found the result is still around 0.5 us. (using 120-MHz F280039C CPU)

They are asking if there is any better way to write fast C code without assembly.

Do you have any suggestion?

I notice our FIR16 : Y= a[i]x[i] (Y in int32 and a, x in int16) in

C:\ti\c2000\C2000Ware_5_01_00_00\libraries\dsp\FixedPoint\c28\docs

Can this be viewed as very fast codes for this kind of multiply-accumulation-based codes?

Is calling TI FIR16 library is the only way we suggest or do you have any better idea?

  • Wayne,

    The compiler provides the __dmac intrinsic for dual MAC. However, it seems there is no __mac intrinsic for the MAC instruction.

    They could use __dmac in their C code.

    Please refer to 7.6 and 3.15.3 of spru514.

    The FIR is definitely related and does use the DMAC instruction but it is very specific, and may not be very efficient for a generic use-case like you are asking. I would suggest intrinsics here.

    Thanks,

    Sira