[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7db3a8b1c7f9471b651345e5c391398166ca2a06.1431436210.git.christophe.leroy@c-s.fr>
Date: Tue, 12 May 2015 15:32:52 +0200 (CEST)
From: Christophe Leroy <christophe.leroy@....fr>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>, scottwood@...escale.com
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Joakim Tjernlund <joakim.tjernlund@...nsmode.se>,
Kyle Moffett <Kyle.D.Moffett@...ing.com>
Subject: [PATCH 2/4] powerpc32: swap r4 and r5 in cacheable_memzero
We swap r4 and r5, this avoids having to move the len contained in r4
into r5
Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
---
arch/powerpc/lib/copy_32.S | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
index 55f19f9..cbca76c 100644
--- a/arch/powerpc/lib/copy_32.S
+++ b/arch/powerpc/lib/copy_32.S
@@ -75,18 +75,17 @@ CACHELINE_MASK = (L1_CACHE_BYTES-1)
* area is cacheable. -- paulus
*/
_GLOBAL(cacheable_memzero)
- mr r5,r4
- li r4,0
+ li r5,0
addi r6,r3,-4
- cmplwi 0,r5,4
+ cmplwi 0,r4,4
blt 7f
- stwu r4,4(r6)
+ stwu r5,4(r6)
beqlr
andi. r0,r6,3
- add r5,r0,r5
+ add r4,r0,r4
subf r6,r0,r6
clrlwi r7,r6,32-LG_CACHELINE_BYTES
- add r8,r7,r5
+ add r8,r7,r4
srwi r9,r8,LG_CACHELINE_BYTES
addic. r9,r9,-1 /* total number of complete cachelines */
ble 2f
@@ -94,26 +93,26 @@ _GLOBAL(cacheable_memzero)
srwi. r0,r0,2
beq 3f
mtctr r0
-4: stwu r4,4(r6)
+4: stwu r5,4(r6)
bdnz 4b
3: mtctr r9
li r7,4
10: dcbz r7,r6
addi r6,r6,CACHELINE_BYTES
bdnz 10b
- clrlwi r5,r8,32-LG_CACHELINE_BYTES
- addi r5,r5,4
-2: srwi r0,r5,2
+ clrlwi r4,r8,32-LG_CACHELINE_BYTES
+ addi r4,r4,4
+2: srwi r0,r4,2
mtctr r0
bdz 6f
-1: stwu r4,4(r6)
+1: stwu r5,4(r6)
bdnz 1b
-6: andi. r5,r5,3
-7: cmpwi 0,r5,0
+6: andi. r4,r4,3
+7: cmpwi 0,r4,0
beqlr
- mtctr r5
+ mtctr r4
addi r6,r6,3
-8: stbu r4,1(r6)
+8: stbu r5,1(r6)
bdnz 8b
blr
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists