1 /* Optimized memcmp implementation for PowerPC476.
2 Copyright (C) 2010-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
23 r3:source1 address, return equality
27 Check 2 words from src1 and src2. If unequal jump to end and
28 return src1 > src2 or src1 < src2.
29 If count = zero check bytes before zero counter and then jump to end and
30 return src1 > src2, src1 < src2 or src1 = src2.
31 If src1 = src2 and no null, repeat. */
35 beq L(preword2_count_loop)
39 L(word8_compare_loop):
74 bdnz L(word8_compare_loop)
76 L(preword2_count_loop):
78 beq L(prebyte_count_loop)
93 bdnz L(word2_count_loop)
95 L(prebyte_count_loop):
107 bdnz L(byte_count_loop)
127 libc_hidden_builtin_def (memcmp)
128 weak_alias (memcmp,bcmp)