The TriCore CPU core versions v1.3.1 up to v1.6.2 (AURIX 2G) include a hardware FPU unit for floating-point calculations. This makes float calculations very efficient because there are dedicated assembly instructions, for example, for floating-point multiplication, division, addition, or subtraction. The hardware FPU does not support double calculations. Due to this limitation, the C compiler option --fp-model=+float or --fp-model=f can be set to have the compiler treat double values like float values, to the chagrin of accuracy.
The Infineon EABI specification for the TriCore CPU does not permit treating a double like a float value. Thus, to be EABI-compliant, the C compiler option --eabi-compliant or --eabi=-float / --eabi=F must be set. If the control program is used to invoke the individual executables like the C++ compiler, C compiler, assembler, or linker, the --eabi-compliant or --eabi options can be passed to the control program.
Regarding the Infineon EABI compliance option usage, the control
program does not automatically adjust the settings for the --fp-model option. The default setting for the --fp-model option when a TriCore CPU core with hardware FPU is used is --fp-model=+float / --fp-model=f,
which enables the Treat 'double' as 'float' optimization. This default
setting conflicts with the EABI requirement. As a result, the C compiler
generates the following E490 error message, which might be confusing:
ctc E490: Only 64-bit double is allowed for EABI compliance
For example, if the control program invocation looks like:
cctc --core=tc1.6.2 --eabi-compliant -c -t file_1.c
the E490 error is provoked as the --fp-model option is not included in the invocation.
If the verbose mode of the control program is enabled (-v option), the individual C compiler invocation is displayed, including all the options used and this indicates the troublespot:
cctc --core=tc1.6.2 --eabi-compliant -c -t -v file_1.c
+ C:\Program Files\TASKING\TriCore v6.3r1\ctc\bin\ctc -D__CPU__=userdef162 -D__CPU_USERDEF162__ --core=tc1.6.2 --fp-model=+float --eabi-compliant -o file_1.src file_1.c
ctc E490: Only 64-bit double is allowed for EABI compliance
To mitigate the E490 error message, you need to change the control program invocation by including the --fp-model option as shown below:
cctc --core=tc1.6.2 --eabi-compliant -c -t -v --fp-model=-float file_1.c
+ C:\Program Files\TASKING\TriCore v6.3r1\ctc\bin\ctc -D__CPU__=userdef162 -D__CPU_USERDEF162__ --core=tc1.6.2 --fp-model=-float --eabi-compliant -o file_1.src file_1.c
+ C:\Program Files\TASKING\TriCore v6.3r1\ctc\bin\astc -D__CPU__=userdef162 -D__CPU_USERDEF162__ --core=tc1.6.2 -o file_1.o file_1.src