mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
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>
This commit is contained in:
parent
3bb1350c36
commit
82a35070ec
@ -61,7 +61,12 @@ typedef unsigned long int fpu_control_t;
|
||||
# define _FPU_GETCW(cw) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (*&cw))
|
||||
# define _FPU_SETCW(cw) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (*&cw))
|
||||
#else
|
||||
# define _FPU_GETCW(cw) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (*&cw))
|
||||
# ifdef __leon__
|
||||
/* Prevent stfsr from being placed directly after other fp instruction. */
|
||||
# define _FPU_GETCW(cw) __asm__ __volatile__ ("nop; st %%fsr,%0" : "=m" (*&cw))
|
||||
# else
|
||||
# define _FPU_GETCW(cw) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (*&cw))
|
||||
# endif
|
||||
# define _FPU_SETCW(cw) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (*&cw))
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user