sparc: Prevent stfsr from directly following floating-point instruction
commit82a35070ec35616074343b8c4ffe6b1cff7e2793
authorDaniel Cederman <cederman@gaisler.com>
Mon, 15 Jan 2024 14:53:45 +0000 (15 15:53 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 18 Jan 2024 11:27:44 +0000 (18 08:27 -0300)
tree652eb6108868dbca0c1156b1ed40a15046f55ca8
parent3bb1350c3681c5ca330dd92500dc59fba94b37eb
sparc: Prevent stfsr from directly following floating-point instruction

On LEON, if the stfsr instruction is immediately following a floating-point
operation instruction in a running program, with no other instruction in
between the two, the stfsr might behave as if the order was reversed
between the two instructions and the stfsr occurred before the
floating-point operation.

Add a nop instruction before the stfsr to prevent this from happening.

Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/sparc/fpu/fpu_control.h