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.

Int to float conversion intrinsic _intsp missing

Hi

I am looking for an intrinsic to convert int to float.
I looked into 

TMS320C66x DSP
Literature Number: SPRUGH7
November 2010
CPU and Instruction Set manual and found intsp intrinsic.

But when I use this intrinsic, compiler gives undefined error. 
I am using C6000CGT7.3.5, EVM C6670 and could not find this intrinsic in c6x.h.

Kindly help.

Regards

Rahul

  • You should not need an intrinsic to generate this instruction: Simply assign an expression with integral type to an lvalue with "float" type, or use an rvalue with integral type in some other context where the language requires the value be promoted to "float". Why do you expect there to be an intrinsic to do this?
  • Thanks Michael for your reply.
    Traditional Float conversion method takes a lot of cycles, again depending on different scenarios.
    That why I am looking for intrinsic to do the job.

    Regards
    Rahul
  • Rahul,

    If you have specific code that does not run as fast as you think it should, could you provide that? In my experience, the compiler is usually very good at using the simpler instructions (like INTSP) when it is appropriate to do so. Intrinsics are usually only necessary for complicated operations, such as complex multiply, matrix multiply, and some of the vector instructions.

    Please also make sure optimization is turned on for your code. When I am trying to understand why code runs fast or slow, I find that the -k (Keep the generated assembly language (.asm) file) and -mw (Generate verbose software pipelining information) options are useful.

    Michael
  • Hi Micheal

    I understand that compiler can optimize by using simpler intrinsics. But in my case I have profiled it and float conversion takes lot of time.
    Using intrinsic like _dintsp has provided good results in saving significant cycles. But I need to use intsp for my application which I could not find.

    If possible can you please direct me where I can find intsp ?

    Regards
    Rahul Sharma

  • Hi Michael,
    Thank you for your quick reply and support. Your contribution is very much appreciated.
  • RAHUL SHARMA91013 said:
    If possible can you please direct me where I can find intsp ?

    There is no intrinsic for the instruction INTSP for the reasons explained by Michael P in earlier posts.

    If you have a case where you expect INTSP to be used and it isn't, then please post about that.  Include a test case we can build so we can experience the problem directly. We'll need source code, the compiler version, and the build options.

    Thanks and regards,

    -George