memcmp.S (9268022b74279434ed6300244e3f977e56a8ceb5) memcmp.S (a215cdfdb0656f80bfc9a43ff914107596fd560a)
1/* $NetBSD: memcmp.S,v 1.3 2003/10/14 07:51:45 scw Exp $ */
2
3/*
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *

--- 52 unchanged lines hidden (view full) ---

61 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 */
64
65#include <machine/asm.h>
66
67__FBSDID("$FreeBSD$");
68
1/* $NetBSD: memcmp.S,v 1.3 2003/10/14 07:51:45 scw Exp $ */
2
3/*
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *

--- 52 unchanged lines hidden (view full) ---

61 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 */
64
65#include <machine/asm.h>
66
67__FBSDID("$FreeBSD$");
68
69.syntax unified
70
69ENTRY(memcmp)
70 mov ip, r0
71#if defined(_KERNEL) && !defined(_STANDALONE)
72 cmp r2, #0x06
73 beq .Lmemcmp_6bytes
74#endif
75 mov r0, #0x00
76
77 /* Are both addresses aligned the same way? */
78 cmp r2, #0x00
71ENTRY(memcmp)
72 mov ip, r0
73#if defined(_KERNEL) && !defined(_STANDALONE)
74 cmp r2, #0x06
75 beq .Lmemcmp_6bytes
76#endif
77 mov r0, #0x00
78
79 /* Are both addresses aligned the same way? */
80 cmp r2, #0x00
79 eornes r3, ip, r1
81 eorsne r3, ip, r1
80 RETeq /* len == 0, or same addresses! */
81 tst r3, #0x03
82 subne r2, r2, #0x01
83 bne .Lmemcmp_bytewise2 /* Badly aligned. Do it the slow way */
84
85 /* Word-align the addresses, if necessary */
86 sub r3, r1, #0x05
87 ands r3, r3, #0x03

--- 94 unchanged lines hidden ---
82 RETeq /* len == 0, or same addresses! */
83 tst r3, #0x03
84 subne r2, r2, #0x01
85 bne .Lmemcmp_bytewise2 /* Badly aligned. Do it the slow way */
86
87 /* Word-align the addresses, if necessary */
88 sub r3, r1, #0x05
89 ands r3, r3, #0x03

--- 94 unchanged lines hidden ---