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.

Compiler/K2GICE: MATLIB inlining

Part Number: K2GICE
Other Parts Discussed in Thread: MATHLIB

Tool/software: TI C/C++ Compiler

Hi

On MATLIB test report there are listed values for C and inline implementation. Anyhow i could not find information how to use inline for this library. How inlining with this library works?

Br

Tommi Mehtonen

  • Hi, Tommi,

    I think you meant the MATHLIB for C66x. Please take a look in the src directory. Let's take acosdp for example. in mathlib/src/acosdp/acosdp_d.c, 

    /* Obtain results using predefined test vectors */
    for (i = 0; i < NUM_INPUTS ; i++) {
    output[MTH_FCN_RTS][i] = acos (a[i]);
    }
    for (i = 0; i < NUM_INPUTS ; i++) {
    output[MTH_FCN_ASM][i] = acosdp (a[i]);
    }
    for (i = 0; i < NUM_INPUTS; i++) {
    output[MTH_FCN_CI][i] = acosdp_c (a[i]);
    }
    for (i = 0; i < NUM_INPUTS ; i++) {
    output[MTH_FCN_INL][i] = acosdp_i (a[i]);
    }
    acosdp_v (a, output[MTH_FCN_VEC], NUM_INPUTS);

    and acosdp_i() is defined in acosdp_i.h

    You may also want to find info in the User's Manual in docs directory, MATHLIB_Users_Manual.html

    Rex

  • Hi

    Thanks, this helped a lot. Id still like to have description of differences in acosdp, acosdp_c and acosdp_i. I have now some idea, but unfortunately it seems to be unfinished on Function Documentation.

    Tommi

  • Hi, Tommi,

    Unfortunately, there isn't document for them, but they are supposedly self-explanatory. If you take a look at the functions of acosdp and acosdp_c, they all call into acosdp_i. The only difference between them and acosdp_i is acosdp_i is inline and expanded in the for loop. The acosdp and acosdp_c have an extra function call.

    Rex