Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78623 - trunk/libs/context/src/asm
From: oliver.kowalke_at_[hidden]
Date: 2012-05-25 14:42:18


Author: olli
Date: 2012-05-25 14:42:16 EDT (Fri, 25 May 2012)
New Revision: 78623
URL: http://svn.boost.org/trac/boost/changeset/78623

Log:
contxt: bugfix related FPU on ARM

Text files modified:
   trunk/libs/context/src/asm/fcontext_arm_aapcs_elf_gas.S | 29 ++++++++++++++++-------------
   1 files changed, 16 insertions(+), 13 deletions(-)

Modified: trunk/libs/context/src/asm/fcontext_arm_aapcs_elf_gas.S
==============================================================================
--- trunk/libs/context/src/asm/fcontext_arm_aapcs_elf_gas.S (original)
+++ trunk/libs/context/src/asm/fcontext_arm_aapcs_elf_gas.S 2012-05-25 14:42:16 EDT (Fri, 25 May 2012)
@@ -52,20 +52,23 @@
 jump_fcontext:
     stmia a1, {v1-v8,sp-lr} @ save V1-V8,SP-LR
     str lr, [a1,#40] @ save LR as PC
+
 #if (defined(__VFP_FP__) && !defined(__SOFTFP__))
     cmp a4, #0 @ test if fpu env should be preserved
- be 1f
-
- ldr a4, [a1,#52]
- stmia a4, {s16-s31} @ save S16-S31
+ beq 1f
 
- ldr a4, [a2,#52]
- ldmia a4, {s16-s31} @ restore S16-S31
+ mov a4, a1
+ add a4, #52
+ fstmiax a4, {d8-d15} @ save S16-S31
+
+ mov a4, a2
+ add a4, #52
+ fldmiax a4, {d8-d15} @ restore S16-S31
 1:
 #endif
 
- mov a1, a3 @ use third arg as return value after jump
- @ and as first arg in context function
+ mov a1, a3 @ use third arg as return value after jump
+ @ and as first arg in context function
     ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC
 .size jump_fcontext,.-jump_fcontext
 
@@ -78,11 +81,11 @@
     str a2, [a1,#40] @ save address of the context function
     ldr a2, [a1,#44] @ load the stack base
 
- push {a1,lr} @ save pointer to fcontext_t
- mov a1, a2 @ stack pointer as arg for align_stack
- bl align_stack_at_PLT @ align stack
- mov a2, a1 @ begin of aligned stack
- pop {a1,lr} @ restore pointer to fcontext_t
+ push {a1,lr} @ save pointer to fcontext_t
+ mov a1, a2 @ stack pointer as arg for align_stack
+ bl align_stack_at_PLT @ align stack
+ mov a2, a1 @ begin of aligned stack
+ pop {a1,lr} @ restore pointer to fcontext_t
 
     str a2, [a1,#32] @ save the aligned stack base
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk