SPRU514Z July 2001 – October 2023 SM320F28335-EP
In addition to the --cla_support command-line option, the following command line options apply specifically to the CLA compiler:
--cla_background_task={on|off}
Enables or disables support for interrupt service routines identified as background tasks. The default setting is off. When --cla_background_task=on, the MR0, MR1, MR2, MAR0, and MSTF registers are saved and restored for non-background ISRs. For information about creating background tasks, see Section 6.9.15, Section 10.2.2, and Section 10.2.4.
If background tasks are disabled (the default) and:
If background tasks are enabled and:
Since only CLA2 supports background tasks, attempting to create a background task or to enable background tasks using --cla_background_task=on results in an error if --cla_support is set to some value other than cla2.
--cla_default
Causes files with an extension of .c to also be compiled as CLA files.
--cla_signed_compare_workaround={on|off}
Enables the automatic use of a workaround for a CLA hardware flaw that affects integer comparisons. This is necessary because certain types of integer comparisons may produce incorrect results due to integer overflows, for example when the values compared have opposite signs and are near the extreme values. This option is off by default.
If you enable this option, a floating-point comparison is used internally to check the upper bits of the integer values being compared. This comparison detects whether an integer overflow may occur if the difference between the values being compared is too large. If an integer comparison may have an incorrect result, a floating-point comparison is performed instead. For a comparison like
if (x < y)
, the modified comparison performed is as follows:
(float)x < (float)y || (float)x == (float)y && (x <= y)
Enabling this option increases code size and execution time if your code performs many 32-bit integer comparisons.
The following types of integer comparisons are always safe from integer overflows. The workaround is not used for such comparisons even if this option is enabled.
Note than comparisons between unsigned integers are still subject to incorrect results, because the comparisons are performed internally in terms of signed integers.
If you do not want to use the workaround because of its effects on code size and execution time, you can use any of these manual coding alternatives:
if (__mlt(x, y))
if ((short)x < (short)y)
for (short i = 0; i < (short)y); i++)
if ((float)x < (float)y)
for (float i = 0; i < (float)y); i++)
for (int i = y-1; i >= 0; i--)