mirror of git://sourceware.org/git/glibc.git
Update.
* sysdeps/i386/bits/string.h (__memrchr): Do addition in assembler to make it conforming C. * sysdeps/i386/i486/bits/string.h (__memrchr): Likewise.
This commit is contained in:
parent
6ae3b383a5
commit
b7f75e247b
|
|
@ -1,5 +1,9 @@
|
||||||
2003-09-05 Andreas Jaeger <aj@suse.de>
|
2003-09-05 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
|
* sysdeps/i386/bits/string.h (__memrchr): Do addition in assembler
|
||||||
|
to make it conforming C.
|
||||||
|
* sysdeps/i386/i486/bits/string.h (__memrchr): Likewise.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/i386/fcntl.c (__fcntl_nocancel): Change
|
* sysdeps/unix/sysv/linux/i386/fcntl.c (__fcntl_nocancel): Change
|
||||||
prototype to use variable argument lists and get the possible one
|
prototype to use variable argument lists and get the possible one
|
||||||
argument via va_arg.
|
argument via va_arg.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/* Optimized, inlined string functions. i386 version.
|
/* Optimized, inlined string functions. i386 version.
|
||||||
Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
Copyright (C) 1997,1998,1999,2000,2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
|
@ -321,11 +321,12 @@ __memrchr (__const void *__s, int __c, size_t __n)
|
||||||
"repne; scasb\n\t"
|
"repne; scasb\n\t"
|
||||||
"je 1f\n\t"
|
"je 1f\n\t"
|
||||||
"orl $-1,%0\n"
|
"orl $-1,%0\n"
|
||||||
"1:\tcld"
|
"1:\tcld\n\t"
|
||||||
|
"incl %0"
|
||||||
: "=D" (__res), "=&c" (__d0)
|
: "=D" (__res), "=&c" (__d0)
|
||||||
: "a" (__c), "0" (__s + __n - 1), "1" (__n)
|
: "a" (__c), "0" (__s + __n - 1), "1" (__n)
|
||||||
: "cc");
|
: "cc");
|
||||||
return __res + 1;
|
return __res;
|
||||||
}
|
}
|
||||||
# ifdef __USE_GNU
|
# ifdef __USE_GNU
|
||||||
# define memrchr(s, c, n) __memrchr (s, c, n)
|
# define memrchr(s, c, n) __memrchr (s, c, n)
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,8 @@ __memrchr (__const void *__s, int __c, size_t __n)
|
||||||
("std\n\t"
|
("std\n\t"
|
||||||
"repne; scasb\n\t"
|
"repne; scasb\n\t"
|
||||||
"cmovne %2,%0\n\t"
|
"cmovne %2,%0\n\t"
|
||||||
"cld"
|
"cld\n\t"
|
||||||
|
"incl %0"
|
||||||
: "=D" (__res), "=&c" (__d0), "=&r" (__d1)
|
: "=D" (__res), "=&c" (__d0), "=&r" (__d1)
|
||||||
: "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
|
: "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
|
||||||
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
|
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
|
||||||
|
|
@ -495,13 +496,14 @@ __memrchr (__const void *__s, int __c, size_t __n)
|
||||||
"repne; scasb\n\t"
|
"repne; scasb\n\t"
|
||||||
"je 1f\n\t"
|
"je 1f\n\t"
|
||||||
"orl $-1,%0\n"
|
"orl $-1,%0\n"
|
||||||
"1:\tcld"
|
"1:\tcld\n\t"
|
||||||
|
"incl %0"
|
||||||
: "=D" (__res), "=&c" (__d0)
|
: "=D" (__res), "=&c" (__d0)
|
||||||
: "a" (__c), "0" (__s + __n - 1), "1" (__n),
|
: "a" (__c), "0" (__s + __n - 1), "1" (__n),
|
||||||
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
|
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
|
||||||
: "cc");
|
: "cc");
|
||||||
# endif
|
# endif
|
||||||
return __res + 1;
|
return __res;
|
||||||
}
|
}
|
||||||
# ifdef __USE_GNU
|
# ifdef __USE_GNU
|
||||||
# define memrchr(s, c, n) __memrchr ((s), (c), (n))
|
# define memrchr(s, c, n) __memrchr ((s), (c), (n))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue