summaryrefslogtreecommitdiff
path: root/cpukit/score/cpu/sparc/cpu_asm.S
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/sparc/cpu_asm.S')
-rw-r--r--cpukit/score/cpu/sparc/cpu_asm.S17
1 files changed, 15 insertions, 2 deletions
diff --git a/cpukit/score/cpu/sparc/cpu_asm.S b/cpukit/score/cpu/sparc/cpu_asm.S
index 92674de783..15f9dd26e1 100644
--- a/cpukit/score/cpu/sparc/cpu_asm.S
+++ b/cpukit/score/cpu/sparc/cpu_asm.S
@@ -55,7 +55,13 @@ SYM(_CPU_Context_save_fp):
or %l1, %lo(SPARC_PSR_EF_MASK), %l1
or %l0, %l1, %l0
mov %l0, %psr ! **** ENABLE FLOAT ACCESS ****
- nop; nop; nop; ! Need three nops before EF is
+ nop; nop; nop; ! Need three nops before EF is
+#ifdef SPARC_DYNAMIC_FPU_DETECTION
+ mov %psr, %l0 ! **** check whether fpu present ****
+ andcc %l0,%l1,%g0
+ beq 1f
+ nop
+#endif
ld [%i0], %l0 ! active due to pipeline delay!!!
std %f0, [%l0 + FO_F1_OFFSET]
std %f2, [%l0 + F2_F3_OFFSET]
@@ -104,7 +110,13 @@ SYM(_CPU_Context_restore_fp):
or %l1, %lo(SPARC_PSR_EF_MASK), %l1
or %l0, %l1, %l0
mov %l0, %psr ! **** ENABLE FLOAT ACCESS ****
- nop; nop; nop; ! Need three nops before EF is
+ nop; nop; nop; ! Need three nops before EF is
+#ifdef SPARC_DYNAMIC_FPU_DETECTION
+ mov %psr, %l0 ! **** check whether fpu present ****
+ andcc %l0,%l1,%g0
+ beq 1f
+ nop
+#endif
ld [%i0], %l0 ! active due to pipeline delay!!!
ldd [%l0 + FO_F1_OFFSET], %f0
ldd [%l0 + F2_F3_OFFSET], %f2
@@ -123,6 +135,7 @@ SYM(_CPU_Context_restore_fp):
ldd [%l0 + F28_F29_OFFSET], %f28
ldd [%l0 + F3O_F31_OFFSET], %f30
ld [%l0 + FSR_OFFSET], %fsr
+1:
ret
restore