
Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).
Hi! all, i m using TMS3206713 DSP. i write a programm for convolution in assembly language.i have checked,programm is right but it is too larg.can anybody help me to reduce this program. ;program for Convolution algorithms for integer value .data X .int 2,3,4 Y .int 1,2,3 R .int 0,0,0,0,0 .def _main .text _main MVK .S1 3,A1 MVKL .S2 R,B8 MVKH .S2 R,B8 || MVKL .S1 X,A4 MVKH .S1 X,A4 LOOP1: LDW .D1 *A4++,A7 NOP 4 || MVKL .S2 Y,B4 MVKH .S2 Y,B4 MVK .S2 3,B1 || ZERO .L1 A2 LOOP2: ZERO .L2 B6 LDW .D2 *B4++,B7 NOP 4 MPY .M2X A7,B7,B5 NOP 3 ADD .L2 B5,B6,B6 LDW .D2 *B8++,B10 NOP 4 LDW .D2 *--B8,B12 NOP 4 || ADD .L2 B6,B10,B2 STW .D2 B2,*B8++ SUB .L2 B1,1,B1 || ADD .L1 A2,1,A2 [B1]B .S2 LOOP2 NOP 5 SUB .L1 A2,1,A2 LOOP3: LDW .D2 *B8--,B9 NOP 4 || SUB .L1 A2,1,A2 [A2]B .S1 LOOP3 NOP 5 SUB .L1 A1,1,A1 [A1]B .S1 LOOP1 NOP 5 IDLE .end please write it in C language. with best regards: vijay k
Vijay,
Can you explain a little more about what you are trying to do ?
Normally people start with C and then move to linear asm if more speed is required. Actual asm
code is a final step that should only be undertaken when the C and linear asm steps have been
proven not to work.
I'm sure TI have a convolution operation in their DSP library that you could use.
If you are doing this as an exercise, you should read spru198i.pdf
<http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=spru198i>
- Andrew E
----- Original Message ----
From: "v...@yahoo.com" <v...@yahoo.com>
To: c...@yahoogroups.com
Sent: Thursday, January 3, 2008 7:28:59 AM
Subject: [c6x] please reduce this program and also write in C
Hi! all,
i m using TMS3206713 DSP. i write a programm for convolution in
assembly
language.i have checked,programm is right but it is too larg.can
anybody help me to reduce this program.
;program for Convolution algorithms for integer value
.data
X .int 2,3,4
Y .int 1,2,3
R .int 0,0,0,0,0
.def _main
.text
_main
MVK .S1 3,A1
MVKL .S2 R,B8
MVKH .S2 R,B8
|| MVKL .S1 X,A4
MVKH .S1 X,A4
LOOP1:
LDW .D1 *A4++,A7
NOP 4
|| MVKL .S2 Y,B4
MVKH .S2 Y,B4
MVK .S2 3,B1
|| ZERO .L1 A2
LOOP2:
ZERO .L2 B6
LDW .D2 *B4++,B7
NOP 4
MPY .M2X A7,B7,B5
NOP 3
ADD .L2 B5,B6,B6
LDW .D2 *B8++,B10
NOP 4
LDW .D2 *--B8,B12
NOP 4
|| ADD .L2 B6,B10,B2
STW .D2 B2,*B8++
SUB .L2 B1,1,B1
|| ADD .L1 A2,1,A2
[B1]B .S2 LOOP2
NOP 5
SUB .L1 A2,1,A2
LOOP3:
LDW .D2 *B8--,B9
NOP 4
|| SUB .L1 A2,1,A2
[A2]B .S1 LOOP3
NOP 5
SUB .L1 A1,1,A1
[A1]B .S1 LOOP1
NOP 5
IDLE
.end
please write it in C language.
with best regards:
vijay k
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
I had to check my calendar just now. No, it's not April 1. I have a great way of making money. Can someone give me $1,000,000.00 to get started? While I've picked up a lot about DSPs in the past couple of years, I'm definitely not fluent in reading assembly. Normally you would start with something in C, see what the compiler produces, and then either optimize the C and look at the compiler output again, or optimize the assembly. In my case I'd stick with programming in C/C++ and looking at the assembly output to see how efficient it looks, and then search for a prebuilt library that may be better optimized than I can produce. Wim. v...@yahoo.com wrote: > Hi! all, > i m using TMS3206713 DSP. i write a programm for convolution in assembly > language.i have checked,programm is right but it is too larg.can anybody help me to reduce this program. > > ;program for Convolution algorithms for integer value > .data > X .int 2,3,4 > Y .int 1,2,3 > R .int 0,0,0,0,0 > .def _main > .text > _main > MVK .S1 3,A1 > MVKL .S2 R,B8 > MVKH .S2 R,B8 > || MVKL .S1 X,A4 > MVKH .S1 X,A4 > LOOP1: > LDW .D1 *A4++,A7 > NOP 4 > || MVKL .S2 Y,B4 > MVKH .S2 Y,B4 > MVK .S2 3,B1 > || ZERO .L1 A2 > LOOP2: > ZERO .L2 B6 > LDW .D2 *B4++,B7 > NOP 4 > MPY .M2X A7,B7,B5 > NOP 3 > ADD .L2 B5,B6,B6 > LDW .D2 *B8++,B10 > NOP 4 > LDW .D2 *--B8,B12 > NOP 4 > || ADD .L2 B6,B10,B2 > STW .D2 B2,*B8++ > SUB .L2 B1,1,B1 > || ADD .L1 A2,1,A2 > [B1]B .S2 LOOP2 > NOP 5 > SUB .L1 A2,1,A2 > LOOP3: > LDW .D2 *B8--,B9 > NOP 4 > || SUB .L1 A2,1,A2 > [A2]B .S1 LOOP3 > NOP 5 > SUB .L1 A1,1,A1 > [A1]B .S1 LOOP1 > NOP 5 > IDLE > .end > > please write it in C language. > > with best regards: > vijay k > >