memset.S (f43dc23d5ea91fca257be02138a255f02d98e806) | memset.S (74cad25c076a2f5253312c2fe82d1a4daecc1323) |
---|---|
1/* linux/arch/sparc/lib/memset.S: Sparc optimized memset, bzero and clear_user code 2 * Copyright (C) 1991,1996 Free Software Foundation 3 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 5 * | 1/* linux/arch/sparc/lib/memset.S: Sparc optimized memset, bzero and clear_user code 2 * Copyright (C) 1991,1996 Free Software Foundation 3 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 5 * |
6 * Returns 0, if ok, and number of bytes not yet set if exception 7 * occurs and we were called as clear_user. | 6 * Calls to memset returns initial %o0. Calls to bzero returns 0, if ok, and 7 * number of bytes not yet set if exception occurs and we were called as 8 * clear_user. |
8 */ 9 10#include <asm/ptrace.h> 11 12/* Work around cpp -rob */ 13#define ALLOC #alloc 14#define EXECINSTR #execinstr 15#define EX(x,y,a,b) \ --- 44 unchanged lines hidden (view full) --- 60 .globl __bzero_begin 61__bzero_begin: 62 63 .globl __bzero 64 .globl memset 65 .globl __memset_start, __memset_end 66__memset_start: 67memset: | 9 */ 10 11#include <asm/ptrace.h> 12 13/* Work around cpp -rob */ 14#define ALLOC #alloc 15#define EXECINSTR #execinstr 16#define EX(x,y,a,b) \ --- 44 unchanged lines hidden (view full) --- 61 .globl __bzero_begin 62__bzero_begin: 63 64 .globl __bzero 65 .globl memset 66 .globl __memset_start, __memset_end 67__memset_start: 68memset: |
69 mov %o0, %g1 70 mov 1, %g4 |
|
68 and %o1, 0xff, %g3 69 sll %g3, 8, %g2 70 or %g3, %g2, %g3 71 sll %g3, 16, %g2 72 or %g3, %g2, %g3 73 b 1f 74 mov %o2, %o1 753: --- 8 unchanged lines hidden (view full) --- 84 EX(stb %g3, [%o0 + 0x02], sub %o1, 2) 852: 86 sub %o2, 4, %o2 87 add %o1, %o2, %o1 88 b 4f 89 sub %o0, %o2, %o0 90 91__bzero: | 71 and %o1, 0xff, %g3 72 sll %g3, 8, %g2 73 or %g3, %g2, %g3 74 sll %g3, 16, %g2 75 or %g3, %g2, %g3 76 b 1f 77 mov %o2, %o1 783: --- 8 unchanged lines hidden (view full) --- 87 EX(stb %g3, [%o0 + 0x02], sub %o1, 2) 882: 89 sub %o2, 4, %o2 90 add %o1, %o2, %o1 91 b 4f 92 sub %o0, %o2, %o0 93 94__bzero: |
95 clr %g4 |
|
92 mov %g0, %g3 931: 94 cmp %o1, 7 95 bleu 7f 96 andcc %o0, 3, %o2 97 98 bne 3b 994: --- 46 unchanged lines hidden (view full) --- 146 andcc %o1, 1, %g0 147 148 EX(sth %g3, [%o0], and %o1, 3) 149 add %o0, 2, %o0 1501: 151 bne,a 8f 152 EX(stb %g3, [%o0], and %o1, 1) 1538: | 96 mov %g0, %g3 971: 98 cmp %o1, 7 99 bleu 7f 100 andcc %o0, 3, %o2 101 102 bne 3b 1034: --- 46 unchanged lines hidden (view full) --- 150 andcc %o1, 1, %g0 151 152 EX(sth %g3, [%o0], and %o1, 3) 153 add %o0, 2, %o0 1541: 155 bne,a 8f 156 EX(stb %g3, [%o0], and %o1, 1) 1578: |
154 retl 155 clr %o0 | 158 b 0f 159 nop |
1567: 157 be 13b 158 orcc %o1, 0, %g0 159 160 be 0f 1618: 162 add %o0, 1, %o0 163 subcc %o1, 1, %o1 164 bne 8b 165 EX(stb %g3, [%o0 - 1], add %o1, 1) 1660: | 1607: 161 be 13b 162 orcc %o1, 0, %g0 163 164 be 0f 1658: 166 add %o0, 1, %o0 167 subcc %o1, 1, %o1 168 bne 8b 169 EX(stb %g3, [%o0 - 1], add %o1, 1) 1700: |
171 andcc %g4, 1, %g0 172 be 5f 173 nop |
|
167 retl | 174 retl |
175 mov %g1, %o0 1765: 177 retl |
|
168 clr %o0 169__memset_end: 170 171 .section .fixup,#alloc,#execinstr 172 .align 4 17320: 174 cmp %g2, 8 175 bleu 1f --- 27 unchanged lines hidden --- | 178 clr %o0 179__memset_end: 180 181 .section .fixup,#alloc,#execinstr 182 .align 4 18320: 184 cmp %g2, 8 185 bleu 1f --- 27 unchanged lines hidden --- |