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.

Why host intrinsics package doesn't use stdint?

Hi, guys

I ran into one of the common problems of using host intrinsics today, the "32-bit long integer"  of gcc.

The solution is simple, replace "long" with "int40".

So I changed all "long"s to "int40_t"s and defined "int40_t" as "int40".

So, question is, why it has to be 'int40" in the header of host intrinsics package, why not "int40_t"?

Thanks

Dehuan

  • I'm a little confused.  The host intrinsics package is intended to be used in combination with code that is built for execution on a host system like a Windows PC.  Those host compilers do not have any 40-bit type like int40_t.

    However, the C6000 compiler, does support an int40_t type.  This means you are using the host intrinsics package with the C6000 compiler.  But why?  When building for execution on C6000, you can use the compiler intrinsics directly.  There is no need for the host intrinsics package.

    Thanks and regards,

    -George

  • Hi, George,

    Host intrinsics actually have implemented int40_t using int64_t. That's why they included types like int40

    in the header.

    However, if I use int40 instead of int4-_t in the code, I won't be able to exclude the host intrinsics header

    from my c6000 build.

    Although that header has little effect to the c6000 build, I just like it to keep things simple.

    Dehuan