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.
Hello,
I have studied documents related to floating point operation in TMS320C6748. In 2.4.2.3 of SPRU198K, there is a example of dot product of two floating point array for peak performance. But I want to dot product of one floating point array and other one is signed int array. I could align floating point array for 64 bit (double word). For signed int array, I have fixed constant values , so i initialized it globally in the file. Now how can i align the signed int array to 64 bit. Is there any other intrinsic like _dotp2 which does dot product of different types of array (one is floating point and other one if signed int array with fixed value. I want result value in long int format.
In short ,I want peak performance of a function with below requirement in c6748 .
long int function (float *a, signed int *b)
Any suggestions would be sincerely appreciated!
Rushina,
We currently do not provide a function for dot product of mixed data types. However if you check the code for the DSPF_sp_dotprod, it is mostly optimized using the software pipeling using C6000 Compiler and not hand assembly optimized, you should easily be able to modify this to use for your usecase:
I am providing the source for your reference. you can find it in dsplib_c674x_3_4_0_0\packages\ti\dsplib\src\DSPF_sp_dotprod\c674
#pragma CODE_SECTION(DSPF_sp_dotprod, ".text:optimized"); #include "DSPF_sp_dotprod.h" float DSPF_sp_dotprod(const float * x, const float * y, const int nx) { int i; float sum = 0; _nassert(nx > 0); _nassert(nx % 8 == 0); _nassert((int)x % 8 == 0); _nassert((int)y % 8 == 0); for(i = 0; i < nx; i++) sum += x[i]*y[i]; return (sum); }
Regards,
Rahul
Thanks Rahul.
I have already tried the library function with my parameters of mixed data types, but it is not optimized with software pipelined. I checked it in .asm file. When I use all the parameters as float, it is optimized with software pipelined.
So I believe this the best library routine to optimize the dot product of mixed data types also, Right?
Regards,
Rushina