lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] powerpc: avoid an unnecessary test and branch in longjmp()
Date
Doing the test at exit of the function avoids an unnecessary
test and branch in longjmp()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/misc.S | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 739977a6be80..9b9207f60d28 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -90,14 +90,11 @@ _GLOBAL(setjmp)
blr

_GLOBAL(longjmp)
- PPC_LCMPI r4,0
- bne 1f
- li r4,1
#if defined(CONFIG_PPC32) && defined(CONFIG_CPU_BIG_ENDIAN)
-1: lmw r12, 3*SZL(r3)
+ lmw r12, 3*SZL(r3)
mtcrf 0x38, r12
#else
-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)
@@ -123,7 +120,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)
--
2.13.3
\
 
 \ /
  Last update: 2018-03-19 13:24    [W:0.028 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site