summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-04-17 19:08:16 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-05-18 00:09:05 +1000
commit24c78586cc6798028205e12c34febf0337bcbded (patch)
treedf2de020255d500f9ff1e8980a6a920e26310448
parent96f391cf40ee5c9201cc7b55abe3903761e6a2e2 (diff)
downloadlinux-24c78586cc6798028205e12c34febf0337bcbded.tar.gz
powerpc: Avoid an unnecessary test and branch in longjmp()
Doing the test at exit of the function avoids an unnecessary
test and branch inside longjmp().

Semantics are unchanged.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/kernel/misc.S9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 384357cb8bc0..c60b70da1e4b 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -85,10 +85,7 @@ _GLOBAL(setjmp)
 	blr
 
 _GLOBAL(longjmp)
-	PPC_LCMPI r4,0
-	bne	1f
-	li	r4,1
-1:	PPC_LL	r13,4*SZL(r3)
+	PPC_LL	r13,4*SZL(r3)
 	PPC_LL	r14,5*SZL(r3)
 	PPC_LL	r15,6*SZL(r3)
 	PPC_LL	r16,7*SZL(r3)
@@ -113,7 +110,9 @@ _GLOBAL(longjmp)
 	PPC_LL	r1,SZL(r3)
 	PPC_LL	r2,2*SZL(r3)
 	mtlr	r0
-	mr	r3,r4
+	mr.	r3, r4
+	bnelr
+	li	r3, 1
 	blr
 
 _GLOBAL(current_stack_pointer)