SPRUI04F july 2015 – april 2023
When performing floating point operations on a floating-point architecture or when performing saturating operations, status bits in certain control registers may be set. In particular, status bits may be set in the FADCR, FAUCR, FMCR, CSR, and SSR registers, hereafter referred to as the "status bit control registers". These bits can be set and cleared from C/C++ code by writing to or reading from these registers, as shown in Example8-1.
The compiler may speculate instructions under certain circumstances. Speculation is an optimization technique in which the compiler causes an instruction to execute earlier than may be normally expected in order to improve performance. When the compiler detects that an instruction that may write to a status bit control register is used in the function but the associated control register is not read in the enclosing function (including inlining), the compiler assumes it is free to speculate the instruction.
If the program uses instructions that may write to the status bit control registers and then reads the associated control register later in the function (and not in the function in which the status bit control register is set), you can use the --assume_control_regs_read option to prevent the compiler from speculating instructions that may set status bits in status bit control registers.
If an interrupt service routine modifies (or may modify) any bit in a status bit control register, the interrupt service routine should be written to save and restore that floating point control register.