Commit bfc2eae0 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/vdso32: miscellaneous optimisations

Various optimisations by inverting branches and removing
redundant instructions.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b4e79f963845545bcce1459cd6fcfe46bdde7863.1575273217.git.christophe.leroy@c-s.fr
parent e33ffc95
...@@ -30,11 +30,10 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) ...@@ -30,11 +30,10 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
.cfi_startproc .cfi_startproc
mflr r12 mflr r12
.cfi_register lr,r12 .cfi_register lr,r12
mr r4,r3 mr. r4,r3
get_datapage r3, r0 get_datapage r3, r0
mtlr r12 mtlr r12
addi r3,r3,CFG_SYSCALL_MAP32 addi r3,r3,CFG_SYSCALL_MAP32
cmpli cr0,r4,0
beqlr beqlr
li r0,NR_syscalls li r0,NR_syscalls
stw r0,0(r4) stw r0,0(r4)
......
...@@ -25,10 +25,10 @@ V_FUNCTION_BEGIN(__kernel_getcpu) ...@@ -25,10 +25,10 @@ V_FUNCTION_BEGIN(__kernel_getcpu)
rlwinm r7,r5,16,31-15,31-0 rlwinm r7,r5,16,31-15,31-0
beq cr0,1f beq cr0,1f
stw r6,0(r3) stw r6,0(r3)
1: beq cr1,2f 1: crclr cr0*4+so
stw r7,0(r4)
2: crclr cr0*4+so
li r3,0 /* always success */ li r3,0 /* always success */
beqlr cr1
stw r7,0(r4)
blr blr
.cfi_endproc .cfi_endproc
V_FUNCTION_END(__kernel_getcpu) V_FUNCTION_END(__kernel_getcpu)
......
...@@ -32,10 +32,9 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) ...@@ -32,10 +32,9 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
mflr r12 mflr r12
.cfi_register lr,r12 .cfi_register lr,r12
mr r10,r3 /* r10 saves tv */ mr. r10,r3 /* r10 saves tv */
mr r11,r4 /* r11 saves tz */ mr r11,r4 /* r11 saves tz */
get_datapage r9, r0 get_datapage r9, r0
cmplwi r10,0 /* check if tv is NULL */
beq 3f beq 3f
LOAD_REG_IMMEDIATE(r7, 1000000) /* load up USEC_PER_SEC */ LOAD_REG_IMMEDIATE(r7, 1000000) /* load up USEC_PER_SEC */
bl __do_get_tspec@local /* get sec/usec from tb & kernel */ bl __do_get_tspec@local /* get sec/usec from tb & kernel */
...@@ -43,15 +42,16 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) ...@@ -43,15 +42,16 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
stw r4,TVAL32_TV_USEC(r10) stw r4,TVAL32_TV_USEC(r10)
3: cmplwi r11,0 /* check if tz is NULL */ 3: cmplwi r11,0 /* check if tz is NULL */
beq 1f mtlr r12
crclr cr0*4+so
li r3,0
beqlr
lwz r4,CFG_TZ_MINUTEWEST(r9)/* fill tz */ lwz r4,CFG_TZ_MINUTEWEST(r9)/* fill tz */
lwz r5,CFG_TZ_DSTTIME(r9) lwz r5,CFG_TZ_DSTTIME(r9)
stw r4,TZONE_TZ_MINWEST(r11) stw r4,TZONE_TZ_MINWEST(r11)
stw r5,TZONE_TZ_DSTTIME(r11) stw r5,TZONE_TZ_DSTTIME(r11)
1: mtlr r12
crclr cr0*4+so
li r3,0
blr blr
.cfi_endproc .cfi_endproc
V_FUNCTION_END(__kernel_gettimeofday) V_FUNCTION_END(__kernel_gettimeofday)
...@@ -245,10 +245,10 @@ V_FUNCTION_BEGIN(__kernel_time) ...@@ -245,10 +245,10 @@ V_FUNCTION_BEGIN(__kernel_time)
lwz r3,STAMP_XTIME_SEC+LOPART(r9) lwz r3,STAMP_XTIME_SEC+LOPART(r9)
cmplwi r11,0 /* check if t is NULL */ cmplwi r11,0 /* check if t is NULL */
beq 2f mtlr r12
stw r3,0(r11) /* store result at *t */
2: mtlr r12
crclr cr0*4+so crclr cr0*4+so
beqlr
stw r3,0(r11) /* store result at *t */
blr blr
.cfi_endproc .cfi_endproc
V_FUNCTION_END(__kernel_time) V_FUNCTION_END(__kernel_time)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment