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.

Problem with the library "FastMath" function "rsqrtsp ()".

3568.NewProject.zip

Hello

I am doing some simulations with the C6000 DSP family.  I am using the simulator CCS V4 (C674x CPU Cycle Accurate Simulator, Little Endian).

I am using the library "FastMath” (c67xmathlib_2_01_00_00) function “rsqrtsp_c()" to make the calculations of square roots.  But the calculations are incorrect.

The result of √100 = 10.  Using the "rsqrtsp_c ()" the result is: √100 = 0.1.

The result of √625 = 25.  Using the "rsqrtsp_c ()" the result is: √625 = 0.04.

Am I doing something wrong?

Attached there is a design example where this error happens.

Thanks

Rafael.

  • Hello, the function is working correctly. Note, the function you are using gives reciprocal of sqrt (1/10 = 0.1; 1/25 = 0.04). 
    If you just want to get sqrt, use the function sqrtsp

    C:\c67xmathlib_2_01_00_00\src\sp\sqrtsp

    Cheers,
    Gagan 

  •  

    3362.NewProject.zip

     

    Hello Gagan.

    Thanks for your reply.

    I'm trying to use the function "sqrtsp” (. asm) but there is an error occurring.  This gives the following error on compilation:

    [E0200] Operation can not be Performed on Given operands                                                  line 0                                                        NewProject

    See the project attached.

    If I use the "sqrtsp_c ()" have no problem.

    What do I need to use the "sqrtsp.asm"?

    Thanks

    Rafael.

     

  • You need to add the below definition to your project options:

    __TI_EABI__=0

    Why don't you link in with the pre compiled libraries that are provided here:

    C:\c67xmathlib_2_01_00_00\lib

     

    Regards,
    Gagan