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.

Ti compiler (15.12.0.LTS) ) options --float_operations_allowed and --fp_mode gives compile error in math.h

Hello,

For my RM48 project I tried to combine the compiler options :

"--float_operations_allowed==32" (to stay with single precision operations) and
"--fp_mode=relaxed" (to get a direct call to VSQRT).

Including the math.h file I get errors for this header file like: "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.0.LTS/include/math.h", line 200 (col. 17): error #1558-D: 64-bit floating point operations are not allowed Is

it "legal"/sane to combine those two options or am I doing something wrong here ?

Regards

  • My guess is that you code calls sqrt when it should call sqrtf instead.  Is that it?

    Thanks and regards,

    -George

  • Hello George,

    sorry but it does not seem to be that simple.

    I definitely used the sqrtf function / also tried the compiler Intrinsics __sqrtf call.

    Even when completely removing the call to sqrtf I get the error messages just by including math.h.

    A simple main..c like this also fails:

    #include <stdio.h>
    #include <math.h>
    /*
     * main.c
     */
    int main(void)
    {
    	printf("Hello World!\n");
    	
    	return 0;
    }
    

    Thanks and regards,

    Josef

  • I continue to be unable to reproduce the same error messages. Please show all the build options exactly as the compiler sees them.

    Thanks and regards,

    -George

  • George Mock said:
    I continue to be unable to reproduce the same error messages. Please show all the build options exactly as the compiler sees them.

    The attached project RM48_fp_mode.zip demonstrates the errors, using the following code:

    #include <stdio.h>
    #include <math.h>
    /*
     * main.c
     */
    int main(void)
    {
        printf("Hello World!\n");
    
        return 0;
    }
    

    The CCS console build output is:

    **** Build of configuration Debug for project RM48_fp_mode ****
    
    "C:\\ti_ccs6_1\\ccsv6\\utils\\bin\\gmake" -k all 
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv7R4 --code_state=32 --float_support=VFPv3D16 -me --fp_mode=relaxed --include_path="C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" -g --float_operations_allowed=32 --diag_wrap=off --diag_warning=225 --display_error_number --enum_type=packed --abi=eabi --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 200 (col. 17): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 200 (col. 17): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 202 (col. 18): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 202 (col. 18): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 206 (col. 22): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 206 (col. 22): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 208 (col. 18): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 208 (col. 18): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 208 (col. 18): error #1558-D: 64-bit floating point operations are not allowed
    "C:/ti_ccs6_1/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include/math.h", line 208 (col. 19): error #1558-D: 64-bit floating point operations are not allowed
    10 errors detected in the compilation of "../main.c".
    
    >> Compilation failure
    gmake: *** [main.obj] Error 1
    gmake: Target `all' not remade because of errors.
    
    **** Build Finished ****
    

    The errors are coming from inline functions in math.h, such as the following:

    /*---------------------------------------------------------------------------*/
    /* The FPv4SP supported on Cortex-M4 does not have double precision hardware */
    /* so avoid using the intrinsic.                                             */
    /*---------------------------------------------------------------------------*/
    #if !defined(__TI_FPv4SPD16_SUPPORT__)
    #define sqrt  __relaxed_sqrt
    __inline double __relaxed_sqrt(double x)
    {
        return __sqrt(x);
    }
    

  • Thank you for the test case.  I can reproduce the same diagnostics.  I filed SDSCM00052799 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    I'm less confident than usual that this is a bug in the tools.  There may be a good explanation that I am overlooking.

    Thanks and regards,

    -George