optimize arm setjmp/longjmp register saving/loading

the original code was wrongly based on how it would be done in thumb
mode, but that's not needed because musl's asm only targets arm.
This commit is contained in:
Rich Felker 2012-07-27 00:17:09 -04:00
parent e1b9c1b01b
commit 5aac5e2189
2 changed files with 2 additions and 6 deletions

View File

@ -7,9 +7,7 @@ longjmp:
mov ip,r0
movs r0,r1
moveq r0,#1
ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp}
ldr sp,[ip],#4
ldr lr,[ip],#4
ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp,sp,lr}
tst lr,#1
moveq pc,lr
bx lr

View File

@ -8,9 +8,7 @@ __setjmp:
_setjmp:
setjmp:
mov ip,r0
stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp}
mov r2,sp
stmia ip!,{r2,lr}
stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,sp,lr}
mov r0,#0
tst lr,#1
moveq pc,lr