1 /* Highly optimized version for ix86, x>=6.
2 Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 #include "asm-syntax.h"
26 #define PARMS LINKAGE /* no space for saved regs */
28 #define STR2 STR1+PTR_SIZE
31 ENTRY (BP_SYM (strcmp))
36 CHECK_BOUNDS_LOW (%ecx, STR1(%esp))
37 CHECK_BOUNDS_LOW (%edx, STR2(%esp))
39 L(oop): movb (%ecx), %al
48 /* when strings are equal, pointers rest one beyond
49 the end of the NUL terminators. */
50 CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jbe)
51 CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jbe)
55 #ifndef __BOUNDED_POINTERS__
63 /* When strings differ, pointers rest on
64 the unequal characters. */
65 L(chk): CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jb)
66 CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jb)
72 libc_hidden_builtin_def (strcmp)