diff options
Diffstat (limited to 'arch/sparc64/lib')
-rw-r--r-- | arch/sparc64/lib/VISmemset.S | 29 | ||||
-rw-r--r-- | arch/sparc64/lib/blockops.S | 18 | ||||
-rw-r--r-- | arch/sparc64/lib/strlen_user.S | 21 |
3 files changed, 35 insertions, 33 deletions
diff --git a/arch/sparc64/lib/VISmemset.S b/arch/sparc64/lib/VISmemset.S index 7ccd7b818..152723a49 100644 --- a/arch/sparc64/lib/VISmemset.S +++ b/arch/sparc64/lib/VISmemset.S @@ -1,9 +1,9 @@ -/* $Id: VISmemset.S,v 1.9 1999/05/25 16:53:01 jj Exp $ +/* $Id: VISmemset.S,v 1.10 1999/12/23 17:02:16 jj Exp $ * VISmemset.S: High speed memset operations utilizing the UltraSparc * Visual Instruction Set. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1996, 1997, 1999 Jakub Jelinek (jakub@redhat.com) */ #include "VIS.h" @@ -32,12 +32,7 @@ #endif #ifdef __KERNEL__ - #include <asm/visasm.h> - -#define RETL clr %o0 -#else -#define RETL mov %g3, %o0 #endif /* Well, memset is a lot easier to get right than bcopy... */ @@ -55,8 +50,8 @@ memset: #ifndef REGS_64BIT srl %o2, 0, %o2 #endif - mov %o0, %g3 #endif + mov %o0, %o4 cmp %o2, 7 bleu,pn %xcc, 17f andcc %o0, 3, %g5 @@ -188,19 +183,19 @@ memset: andcc %o2, 7, %o2 #ifdef __KERNEL__ 14: srl %g5, 1, %o3 - sethi %hi(13f), %o4 - sub %o4, %o3, %o4 - jmpl %o4 + %lo(13f), %g0 + sethi %hi(13f), %g3 + sub %g3, %o3, %g3 + jmpl %g3 + %lo(13f), %g0 add %o0, %g5, %o0 #else -14: rd %pc, %o4 +14: rd %pc, %g3 #ifdef REGS_64BIT srl %g5, 1, %o3 - sub %o4, %o3, %o4 + sub %g3, %o3, %g3 #else - sub %o4, %g5, %o4 + sub %g3, %g5, %g3 #endif - jmpl %o4 + (13f - 14b), %g0 + jmpl %g3 + (13f - 14b), %g0 add %o0, %g5, %o0 #endif 12: SET_BLOCKS(%o0, 0x68, %o1) @@ -220,14 +215,14 @@ memset: 1: bne,a,pn %xcc, 8f stb %o1, [%o0] 8: retl - RETL + mov %o4, %o0 17: brz,pn %o2, 0f 8: add %o0, 1, %o0 subcc %o2, 1, %o2 bne,pt %xcc, 8b stb %o1, [%o0 - 1] 0: retl - RETL + mov %o4, %o0 6: #ifdef REGS_64BIT stx %o1, [%o0] diff --git a/arch/sparc64/lib/blockops.S b/arch/sparc64/lib/blockops.S index 202b57270..1aa48643c 100644 --- a/arch/sparc64/lib/blockops.S +++ b/arch/sparc64/lib/blockops.S @@ -1,4 +1,4 @@ -/* $Id: blockops.S,v 1.18 1999/07/30 09:35:37 davem Exp $ +/* $Id: blockops.S,v 1.19 1999/11/19 05:52:45 davem Exp $ * blockops.S: UltraSparc block zero optimized routines. * * Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu) @@ -136,19 +136,19 @@ clear_page: /* %o0=dest */ faddd %f0, %f2, %f12 ! FPA Group fmuld %f0, %f2, %f14 ! FPM - rd %asi, %g2 ! LSU Group - wr %g0, ASI_BLK_P, %asi ! LSU Group membar #StoreLoad | #StoreStore | #LoadStore ! LSU Group -1: stda %f0, [%o0 + 0x00] %asi ! Store Group - stda %f0, [%o0 + 0x40] %asi ! Store Group - stda %f0, [%o0 + 0x80] %asi ! Store Group - stda %f0, [%o0 + 0xc0] %asi ! Store Group +1: stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group + add %o0, 0x40, %o0 ! IEU0 + stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group + add %o0, 0x40, %o0 ! IEU0 + stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group + add %o0, 0x40, %o0 ! IEU0 Group + stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group subcc %o1, 1, %o1 ! IEU1 bne,pt %icc, 1b ! CTI - add %o0, 0x100, %o0 ! IEU0 Group + add %o0, 0x40, %o0 ! IEU0 Group membar #Sync ! LSU Group - wr %g2, %g0, %asi ! LSU Group VISExitHalf stxa %g5, [%o2] ASI_DMMU diff --git a/arch/sparc64/lib/strlen_user.S b/arch/sparc64/lib/strlen_user.S index 04d5e53db..4af69a0ad 100644 --- a/arch/sparc64/lib/strlen_user.S +++ b/arch/sparc64/lib/strlen_user.S @@ -4,7 +4,7 @@ * or 0 for error * * Copyright (C) 1991,1996 Free Software Foundation - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1996,1999 David S. Miller (davem@redhat.com) * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ @@ -14,8 +14,11 @@ #define HI_MAGIC 0x80808080 .align 4 - .global __strlen_user + .global __strlen_user, __strnlen_user __strlen_user: + sethi %hi(32768), %o1 +__strnlen_user: + mov %o1, %g1 mov %o0, %o1 andcc %o0, 3, %g0 be,pt %icc, 9f @@ -42,11 +45,16 @@ __strlen_user: 13: lda [%o0] %asi, %o5 2: sub %o5, %o2, %o4 andcc %o4, %o3, %g0 - be,pt %icc, 13b + bne,pn %icc, 82f add %o0, 4, %o0 + sub %o0, %o1, %g2 +81: cmp %g2, %g1 + blu,pt %icc, 13b + mov %o0, %o4 + ba,a,pt %xcc, 1f /* Check every byte. */ - srl %o5, 24, %g5 +82: srl %o5, 24, %g5 andcc %g5, 0xff, %g0 be,pn %icc, 1f add %o0, -3, %o4 @@ -59,8 +67,8 @@ __strlen_user: be,pn %icc, 1f add %o4, 1, %o4 andcc %o5, 0xff, %g0 - bne,a,pt %icc, 2b -14: lda [%o0] %asi, %o5 + bne,pt %icc, 81b + sub %o0, %o1, %g2 add %o4, 1, %o4 1: retl sub %o4, %o1, %o0 @@ -85,4 +93,3 @@ __strlen_user: .word 12b, 30b .word 15b, 30b .word 13b, 30b - .word 14b, 30b |