Sign in

username:

password:



Not a member?

Search c55x



Search tips

Subscribe to c55x



c55x by Keywords

AIC23 | C5509 | CCS | CSL | EMIF | EVM | GEL | GPIO | HPI | Interfacing | JTAG | McBSP | OMAP | Omap15 | OMAP59 | RTDX | SDRAM | TMS320VC5509 | USB | XDS5

Discussion Groups

Discussion Groups | TMS320C55x | Integer division

Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).

  

Post a new Thread

Integer division - john_smith_901 - Apr 4 7:29:35 2008



Hi all,

I'm trying to write a program for a C5510 target using Code Composer
Studio.  When my code includes a division operation, I get a
compilation failure (the symbol __divi is not defined).  It seems that
C55x doesn't support integer division?

I tried including the stdlib.h header and using the div function
provided, but it still gives me a compilation failure (_div is not
defined). 

How do I division to work without a lot of hassle?

Thanks
------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )

Re: Integer division - Jeff Brower - Apr 4 10:41:51 2008

Dung-

> I'm trying to write a program for a C5510 target using Code Composer
> Studio.  When my code includes a division operation, I get a
> compilation failure (the symbol __divi is not defined).  It seems that
> C55x doesn't support integer division?
> 
> I tried including the stdlib.h header and using the div function
> provided, but it still gives me a compilation failure (_div is not
> defined).
> 
> How do I division to work without a lot of hassle?

My understanding is that division in C code translates into a function call into the
5510 rts (run-time support) library (i.e. a function call made by asm code generated
by the compiler).  So if you add rts.lib to your project, it should compile.

As for "native" integer division, the 5510 (like other TI DSPs) does not have
single-instruction divide.  Many TI DSPs have instructions useful in supporting
division, such as SUBC, NORM, RCPF (reciprocal floating-point), etc, but it typically
takes some type of short loop of instructions to get a division result.

-Jeff

------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )