Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).
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
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