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.

TMS320C6678: __c6xabi_fltuf (uint)

Part Number: TMS320C6678

Hi,

Please help check __c6xabi_fltuf (uint). The test result is incorrect.

TMS320C6000 Optimizing Compiler User's Guide

Table 8-9. Summary of Run-Time-Support Arithmetic Functions

__c6xabi_fltuf (uint) Convert unsigned integer to float

  • Nancy,

    Can you elaborate details how this run-time function failed? E.g., what CGT tools used and compiler options? Do you have a simple code/CCS project calling this function and got unexpected results?

    Regards, Eric

  • Hi,

    CCSV8

    TI v7.4.24

    Just creat a new project and call __c6xabi_fltuf.

    unsigned int i=2;
    float a;
    a=__c6xabi_fltuf(i);

    result: a= 1.07374182e+09

    Is there any problem with my usage?

  • Hi,

    Thanks for the info! I saw the same issue with a different compiler 8.3.2. There may be some calling convention needed. Let me check with the C6x compiler team.

    Regards, Eric

  • There is no need to call __c6xabi_fltuf directly.  You can just write code similar to ...

    float_variable = unsigned_int_variable;

    However, if you want to experiment with calling it from C code, then be sure this prototype is visible ...

    float __c6xabi_fltuf(unsigned int);

    Otherwise, the compiler presumes the function returns an int.  

    Thanks and regards,

    -George

  • Hi,

    Thanks!

    The customer found that the time for converting int data to float is much longer than FFT. And there are several NOP operations in assembly. 
    Are there any sulotion to improve that?

  • Nancy Wang said:
    The customer found that the time for converting int data to float is much longer than FFT.

    I'm probably the wrong person to discuss that issue.  The best solution is to avoid the conversion in the first place.  Either change the code to not need float type variables, or change the CPU to one that has floating point instructions.  

    Nancy Wang said:
    there are several NOP operations in assembly. 

    The C6000 has an unprotected pipeline.  NOP's are used to wait on the results of earlier instructions.  The compiler schedules the instructions to avoid NOP's.  But sometimes they cannot be avoided.

    Thanks and regards,

    -George