Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).
Hi all, I'm optimizing code for C64x which was optimized for x86. In that code lot of lookups were used. I optimized some code by removing those lookups with the math (reads need 5 cycles). Are there any other things that should be kept in mind? like var types static, const. Thanks, Giridhar.
Giridhar- > I'm optimizing code for C64x which was optimized for x86. > In that code lot of lookups were used. I optimized some code by > removing those lookups with the math (reads need 5 cycles). > > Are there any other things that should be kept in mind? > like var types static, const. 1) Try to adjust loops so size of critical loop code fits in cache -- that includes any function calls made by the loop, arrays or other structures used, etc. You have to look at the .map file to be sure. One little step outside cache during a crucial loop and you will take a major hit. 2) Any floating-point operations? 3) x86 code often is wasteful with memory. Just a few bits used in arrays of 32-bit words, tables of pointers to more pointers, etc. Memory is cheap on a PC but not an embedded DSP board. Suggest to take a close look at use of mem. -Jeff PS. You should post this question on c...@yahoogroups.com.