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.

C66X 32-bit intrinsic functions

Hello,

I am new to C66x.  Can anybody tell me where can I find the 32-bit intrinsic functions like  min and max , for both integer and floating point?

I can only find 16- and 8-bit version ( _min2, _max2, _min4 and _max4), both declared for "integer".

There seems quite a few of those intrinsic that are for 8 and 16 bits, rather than for C66x's native word length.

Regards

Wood

  • Please see the section titled Using Intrinsics to Access Assembly Language Statements in the C6000 Compiler book.

    Thanks and regards,

    -George

  • Hi George,

    In table 7.3 and 7.4 of this manual, I can only find _min2, _min4 intrinsic functions which are for 16 and 8 bits respectively, as stated before.

    I also searched the instruction set reference (sprugh7), neither there exist any 32 bit version of min and max instructions, integer or floating point.

    Not sure whether these instructions/intrinsics are given some other namings, if they exist.

    Otherwise it implies a lot of porting jobs for us as our existing design assumes full range of 32 bits.  It also mean quite a few minor nuances or pitfalls, just like now the fprintf() function overwrite some of my variables.  I have no idea why and do not know how to fix as it is not the case in the other platforms.

    Regards

    Wood

  • There is no 32-bit "min" intrinsic.  Just write "(a < b) ? a : b" (or "std::min(a, b)" in C++).

    Intrinsics generally exist to express things that are difficult to express in C but easily implemented in the hardware.  _min2, for example, does two 16-bit "min" operations in parallel on packed data.

  • For the time being, it is ok for me to write a macro to replace the intrinsic.  We will move on to check out other aspects.

    For the fprinf(), I now comment out all other functions, but it still overwrites some variables.  Also, I find that the address for the main function is 0x58EE8, stack begins at 0x65690.  Both fall within the "Reserved" area as per C6657 data manual.  In addition, discrete data variables seem start from address 0, whereas structures/arrays start at 0x8000.

    Should all these start from 0x800000 (Local L2 SRAM) instead, or anything missing?

    Regards

    Wood

  • The linker command file (usually has the extension .cmd) specifies where things are allocated in memory.  Questions about how to use processor memory are better handled in the processor forum.

    Thanks and regards,

    -George