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.

ldotp2_intrinsic

Hi:

I have  questions about the dotp2 and ldotp2 intrinsics. Below is the description from Table 2.7 (Table 27. TMS320C64x/C64x+ C/C++ Compiler Intrinsics (Continued)) of SPRU198K.

Based of the description of dotp2, is it correct to say that the accumulation is 32 bits.

Silimalry, based on the description of ldotp2, the accumulation is 64 bits.

In both cases we have products of 16 bit numbers.

Thanks a lot!

Cheers,

Mushtaq

int _dotp2(int src1, int src2); DOTP2

double _ldotp2(int src1, int src2); LDOTP2

The product of the signed lower 16-bit values of

src1 and src2 is added to the product of the

signed upper 16-bit values of src1 and src2.

The _lo and _hi intrinsics are needed to access

each half of the 64-bit integer result.

 

  • Intrinsic's are direct DSP instructions called in C.  The best place to review the functionality of an intrinsic is in the C64x CPU and Instruction Reference Guide.

    Here's the description for DOTP2

    Description:

    Returns the dot-product between two pairs of signed, packed 16-bit values. The values
    in src1 and src2 are treated as signed, packed 16-bit quantities. The signed result is
    written either to a single 32-bit register, or sign-extended into a 64-bit register pair.
    The product of the lower halfwords of src1 and src2 is added to the product of the upper
    halfwords of src1 and src2. The result is then written to the dst.
    If the result is sign-extended into a 64-bit register pair, the upper word of the register
    pair always contains either all 0s or all 1s, depending on whether the result is positive
    or negative, respectively.

  • Hi Chad:

    I just want to confim that with the 64 bit destination, the accumulation of the products will also be 64 bits. This is important for us because we need 40 bit accumulation.

    Thanks a lot!

    Cheers,

    Mushtaq