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.

Cannot perform 32x32 multiply with full 64-bit result on C6713



I am trying to perform a fixed-point 32x32 multiply and get the full 64-bit result on the C6713.  The C compiler does not seem to do this.  I can only get either a 32x32->32 multiply, or a 64x64->64 multiply.  I've tried to use the _mpyidll intrinsic, but the symbol cannot be found when building the project.  I am using CCS v3.1.  I've noticed that the _mpyidll intrinsic is not listed in C6x.h for this version of CCS.  I also have CCS v3.3, which does list _mpyidll as an intrinsic, but it also cannot find the symbol when I build.

Thanks,

Matt

  • Matt,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages. Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.

    This is really a question for the compiler team to confirm instead of this C67x Single Core DSP Forum. This thread will be moved there this time for your convenience.

    From an old readme.txt that I found for one of the Compiler v6.0 releases, it looks like _mpyidll was added for the C Compiler v6.0.1 and newer.

    Which version of the compiler are you using? I assume it is older than that, but I am not sure whether we made that update before moving to CCSv4 or not.

    Please consider upgrading to CCSv5.4, if possible.

    Regards,
    RandyP

  • RandyP,

    Thanks.  I'm primarily using CCS v3.1, which has compiler version 5.1, I think.  I've also tried compiler v6.0.8, which is what came with CCS v3.3.  Even with v6.0.8, I get the same problem, where _mpyidll is not found.

    Matt

  • This works:

    long long func(int x, int y) { return _mpyidll(x, y); }

    Make sure you are setting the CPU version to the proper value for C67x.  What version of the compiler (not the same as the CCS version) do you have?

  • Matt Barnhill said:
    Even with v6.0.8, I get the same problem, where _mpyidll is not found.

    Use -mv6740 to select the silicon version.  With that option, version 6.0.8 works for me.

    Thanks and regards,

    -George

  • @Archeologist,

    Matt mentioned compiler versions 5.1 and 6.0.8.

    @George,

    Should the _mpyidll intrinsic show up for -mv6700 also? Or is there a different intrinsic for the C6713 that Matt is using? The MPYID instruction looks to be valid for the C6713 according to the C67x/C67x+ CPU & Instruction Set document. Could this be a problem with long long not being defined for the C6713, or something like that?

    @Matt,

    Can you try a newer version than 6.0.8, like the latest 6.1.x?

    Regards,
    RandyP

  • RandyP said:
    Should the _mpyidll intrinsic show up for -mv6700 also?

    It should, but version 6.0.8 doesn't support it.  I found that version 6.0.31 does support the _mpyidll instrinsic with -mv6700.  I chose version 6.0.31 because it is the latest version on the 6.0.x release stream, which means it is trivial for Matt to update to it.  All the 6.0.x releases support the same features; the only difference is later releases have more bug fixes.  See this page to download version 6.0.31.

    Thanks and regards,

    -George

  • That did it.  Ultimately, it looks to me like the compiler was the problem.  My original v5.1 does not support the _mpyidll intrinsic.  v6.0.8 is supposed to support it, but in reality it does not.  But v6.0.31 really does support it.

    Thanks George, RandyP and Archaeologist for your help!

    Matt