Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 344031 | Differences between
and this patch

Collapse All | Expand All

(-)a/autom4te.cache/output.0 (-1 / +1 lines)
Lines 19189-19195 Link Here
19189
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19189
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19190
$as_echo_n "checking if we should use assembler functions... " >&6; }
19190
$as_echo_n "checking if we should use assembler functions... " >&6; }
19191
# For now we only support assembler on i386 and sparc systems
19191
# For now we only support assembler on i386 and sparc systems
19192
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19192
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19193
  ASSEMBLER_x86_TRUE=
19193
  ASSEMBLER_x86_TRUE=
19194
  ASSEMBLER_x86_FALSE='#'
19194
  ASSEMBLER_x86_FALSE='#'
19195
else
19195
else
(-)a/autom4te.cache/output.1 (-1 / +1 lines)
Lines 19193-19199 Link Here
19193
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19193
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19194
$as_echo_n "checking if we should use assembler functions... " >&6; }
19194
$as_echo_n "checking if we should use assembler functions... " >&6; }
19195
# For now we only support assembler on i386 and sparc systems
19195
# For now we only support assembler on i386 and sparc systems
19196
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19196
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19197
  ASSEMBLER_x86_TRUE=
19197
  ASSEMBLER_x86_TRUE=
19198
  ASSEMBLER_x86_FALSE='#'
19198
  ASSEMBLER_x86_FALSE='#'
19199
else
19199
else
(-)a/autom4te.cache/traces.0 (-1 / +1 lines)
Lines 1164-1170 Link Here
1164
m4trace:configure.in:631: -1- AC_SUBST([MYSQL_SERVER_SUFFIX])
1164
m4trace:configure.in:631: -1- AC_SUBST([MYSQL_SERVER_SUFFIX])
1165
m4trace:configure.in:631: -1- AC_SUBST_TRACE([MYSQL_SERVER_SUFFIX])
1165
m4trace:configure.in:631: -1- AC_SUBST_TRACE([MYSQL_SERVER_SUFFIX])
1166
m4trace:configure.in:631: -1- m4_pattern_allow([^MYSQL_SERVER_SUFFIX$])
1166
m4trace:configure.in:631: -1- m4_pattern_allow([^MYSQL_SERVER_SUFFIX$])
1167
m4trace:configure.in:676: -1- AM_CONDITIONAL([ASSEMBLER_x86], [test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)])
1167
m4trace:configure.in:676: -1- AM_CONDITIONAL([ASSEMBLER_x86], [test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)])
1168
m4trace:configure.in:676: -1- AC_SUBST([ASSEMBLER_x86_TRUE])
1168
m4trace:configure.in:676: -1- AC_SUBST([ASSEMBLER_x86_TRUE])
1169
m4trace:configure.in:676: -1- AC_SUBST_TRACE([ASSEMBLER_x86_TRUE])
1169
m4trace:configure.in:676: -1- AC_SUBST_TRACE([ASSEMBLER_x86_TRUE])
1170
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_TRUE$])
1170
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_TRUE$])
(-)a/autom4te.cache/traces.1 (-1 / +1 lines)
Lines 4807-4813 Link Here
4807
configure.in:610: the top level])
4807
configure.in:610: the top level])
4808
m4trace:configure.in:619: -1- m4_pattern_allow([^COMMUNITY_SERVER$])
4808
m4trace:configure.in:619: -1- m4_pattern_allow([^COMMUNITY_SERVER$])
4809
m4trace:configure.in:631: -1- m4_pattern_allow([^MYSQL_SERVER_SUFFIX$])
4809
m4trace:configure.in:631: -1- m4_pattern_allow([^MYSQL_SERVER_SUFFIX$])
4810
m4trace:configure.in:676: -1- AM_CONDITIONAL([ASSEMBLER_x86], [test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)])
4810
m4trace:configure.in:676: -1- AM_CONDITIONAL([ASSEMBLER_x86], [test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)])
4811
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_TRUE$])
4811
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_TRUE$])
4812
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_FALSE$])
4812
m4trace:configure.in:676: -1- m4_pattern_allow([^ASSEMBLER_x86_FALSE$])
4813
m4trace:configure.in:676: -1- _AM_SUBST_NOTMAKE([ASSEMBLER_x86_TRUE])
4813
m4trace:configure.in:676: -1- _AM_SUBST_NOTMAKE([ASSEMBLER_x86_TRUE])
(-)a/configure (-1 / +1 lines)
Lines 19189-19195 Link Here
19189
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19189
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use assembler functions" >&5
19190
$as_echo_n "checking if we should use assembler functions... " >&6; }
19190
$as_echo_n "checking if we should use assembler functions... " >&6; }
19191
# For now we only support assembler on i386 and sparc systems
19191
# For now we only support assembler on i386 and sparc systems
19192
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19192
 if test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;); then
19193
  ASSEMBLER_x86_TRUE=
19193
  ASSEMBLER_x86_TRUE=
19194
  ASSEMBLER_x86_FALSE='#'
19194
  ASSEMBLER_x86_FALSE='#'
19195
else
19195
else
(-)a/configure.in (-1 / +1 lines)
Lines 673-679 Link Here
673
673
674
AC_MSG_CHECKING(if we should use assembler functions)
674
AC_MSG_CHECKING(if we should use assembler functions)
675
# For now we only support assembler on i386 and sparc systems
675
# For now we only support assembler on i386 and sparc systems
676
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
676
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.S -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
677
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
677
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
678
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
678
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
679
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
679
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
(-)a/strings/Makefile.am (-2 / +2 lines)
Lines 20-26 Link Here
20
20
21
# Exact one of ASSEMBLER_X
21
# Exact one of ASSEMBLER_X
22
if ASSEMBLER_x86
22
if ASSEMBLER_x86
23
ASRCS		= strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
23
ASRCS		= strings-x86.S longlong2str-x86.s my_strtoll10-x86.s
24
CSRCS		= bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c strmov.c
24
CSRCS		= bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c strmov.c
25
else
25
else
26
if ASSEMBLER_sparc32
26
if ASSEMBLER_sparc32
Lines 44-50 Link Here
44
EXTRA_DIST =		ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
44
EXTRA_DIST =		ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
45
			ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
45
			ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
46
			ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
46
			ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
47
			xml.c decimal.c strto.c strings-x86.s \
47
			xml.c decimal.c strto.c strings-x86.S \
48
			longlong2str.c longlong2str-x86.s longlong2str_asm.c \
48
			longlong2str.c longlong2str-x86.s longlong2str_asm.c \
49
			my_strtoll10.c my_strtoll10-x86.s \
49
			my_strtoll10.c my_strtoll10-x86.s \
50
			strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
50
			strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
(-)a/strings/Makefile.in (-3 / +3 lines)
Lines 103-109 Link Here
103
libmystrings_la_DEPENDENCIES =
103
libmystrings_la_DEPENDENCIES =
104
am__libmystrings_la_SOURCES_DIST = bmove_upp-sparc.s strappend-sparc.s \
104
am__libmystrings_la_SOURCES_DIST = bmove_upp-sparc.s strappend-sparc.s \
105
	strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
105
	strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
106
	strnmov-sparc.s strstr-sparc.s strings-x86.s \
106
	strnmov-sparc.s strstr-sparc.s strings-x86.S \
107
	longlong2str-x86.s my_strtoll10-x86.s strxmov.c bmove_upp.c \
107
	longlong2str-x86.s my_strtoll10-x86.s strxmov.c bmove_upp.c \
108
	strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c \
108
	strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c \
109
	strstr.c strinstr.c strmake.c strnmov.c strmov.c \
109
	strstr.c strinstr.c strmake.c strnmov.c strmov.c \
Lines 621-627 Link Here
621
@ASSEMBLER_sparc32_TRUE@@ASSEMBLER_x86_FALSE@ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s
621
@ASSEMBLER_sparc32_TRUE@@ASSEMBLER_x86_FALSE@ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s
622
622
623
# Exact one of ASSEMBLER_X
623
# Exact one of ASSEMBLER_X
624
@ASSEMBLER_x86_TRUE@ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
624
@ASSEMBLER_x86_TRUE@ASRCS = strings-x86.S longlong2str-x86.s my_strtoll10-x86.s
625
# These file MUST all be on the same line!! Otherwise automake
625
# These file MUST all be on the same line!! Otherwise automake
626
# generats a very broken makefile
626
# generats a very broken makefile
627
@ASSEMBLER_sparc32_FALSE@@ASSEMBLER_x86_FALSE@CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c
627
@ASSEMBLER_sparc32_FALSE@@ASSEMBLER_x86_FALSE@CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c
Lines 633-639 Link Here
633
EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
633
EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
634
			ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
634
			ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
635
			ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
635
			ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
636
			xml.c decimal.c strto.c strings-x86.s \
636
			xml.c decimal.c strto.c strings-x86.S \
637
			longlong2str.c longlong2str-x86.s longlong2str_asm.c \
637
			longlong2str.c longlong2str-x86.s longlong2str_asm.c \
638
			my_strtoll10.c my_strtoll10-x86.s \
638
			my_strtoll10.c my_strtoll10-x86.s \
639
			strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
639
			strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
(-)a/strings/strings-x86.s (-416 lines)
Lines 1-416 Link Here
1
# Copyright (C) 2000 MySQL AB
2
# This program is free software; you can redistribute it and/or modify
3
# it under the terms of the GNU General Public License as published by
4
# the Free Software Foundation; version 2 of the License.
5
#
6
# This program is distributed in the hope that it will be useful,
7
# but WITHOUT ANY WARRANTY; without even the implied warranty of
8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9
# GNU General Public License for more details.
10
#
11
# You should have received a copy of the GNU General Public License
12
# along with this program; if not, write to the Free Software
13
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14
15
# Optimized string functions Intel 80x86  (gcc/gas syntax)
16
17
	.file	"strings.s"
18
	.version "1.00"
19
20
.text
21
22
#	Move a alligned, not overlapped, by (long) divided memory area
23
#	Args: to,from,length
24
25
.globl bmove_align
26
	.type	 bmove_align,@function
27
bmove_align:	
28
	movl	%edi,%edx
29
	push	%esi
30
	movl	4(%esp),%edi		# to
31
	movl	8(%esp),%esi		# from
32
	movl	12(%esp),%ecx		# length
33
	addw	$3,%cx			# fix if not divisible with long
34
	shrw	$2,%cx
35
	jz	.ba_20
36
	.p2align 4,,7
37
.ba_10:
38
	movl	-4(%esi,%ecx),%eax
39
	movl	 %eax,-4(%edi,%ecx)
40
	decl	%ecx
41
	jnz	.ba_10
42
.ba_20:	pop	%esi
43
	movl	%edx,%edi
44
	ret
45
46
.bmove_align_end:	
47
	.size	 bmove_align,.bmove_align_end-bmove_align
48
49
	# Move a string from higher to lower
50
	# Arg from_end+1,to_end+1,length
51
52
.globl bmove_upp
53
	.type bmove_upp,@function
54
bmove_upp:	
55
	movl	%edi,%edx		# Remember %edi
56
	push	%esi
57
	movl	8(%esp),%edi		# dst
58
	movl	16(%esp),%ecx		# length
59
	movl	12(%esp),%esi		# source
60
	test	%ecx,%ecx
61
	jz	.bu_20
62
	subl	%ecx,%esi		# To start of strings
63
	subl	%ecx,%edi
64
	
65
	.p2align 4,,7
66
.bu_10:	movb	-1(%esi,%ecx),%al
67
	movb	 %al,-1(%edi,%ecx)
68
	decl	%ecx
69
	jnz	.bu_10
70
.bu_20:	pop	%esi
71
	movl	%edx,%edi
72
	ret
73
74
.bmove_upp_end:	
75
	.size bmove_upp,.bmove_upp_end-bmove_upp
76
77
	# Append fillchars to string
78
	# Args: dest,len,fill
79
80
.globl strappend
81
	.type strappend,@function
82
strappend:	
83
	pushl	%edi
84
	movl	8(%esp),%edi		#  Memory pointer
85
	movl	12(%esp),%ecx		#  Length
86
	clrl	%eax			#  Find end of string
87
	repne
88
	scasb
89
	jnz	sa_99			#  String to long, shorten it
90
	movzb	16(%esp),%eax		#  Fillchar
91
	decl	%edi			#  Point at end null
92
	incl	%ecx			#  rep made one dec for null-char
93
94
	movb	%al,%ah			# (2) Set up a 32 bit pattern.
95
	movw	%ax,%dx			# (2)
96
	shll	$16,%eax		# (3)
97
	movw	%dx,%ax			# (2) %eax has the 32 bit pattern.
98
99
	movl	%ecx,%edx		# (2) Save the count of bytes.
100
	shrl	$2,%ecx			# (2) Number of dwords.
101
	rep
102
	stosl				# (5 + 5n)
103
	movb	$3,%cl			# (2)
104
	and	%edx,%ecx		# (2) Fill in the odd bytes
105
	rep
106
	stosb				#  Move last bytes if any
107
108
sa_99:	movb	$0,(%edi)		#  End of string
109
	popl	%edi
110
	ret
111
.strappend_end:	
112
	.size strappend,.strappend_end-strappend
113
114
	# Find if string contains any char in another string
115
	# Arg: str,set
116
	# Ret: Pointer to first found char in str
117
118
.globl strcont
119
	.type strcont,@function
120
strcont:	
121
	movl	%edi,%edx
122
	pushl	%esi
123
	movl	8(%esp),%esi		#  str
124
	movl	12(%esp),%ecx		#  set
125
	clrb	%ah			#  For endtest
126
	jmp	sc_60
127
128
sc_10:	scasb
129
	jz	sc_fo			#  Found char
130
sc_20:	cmp	(%edi),%ah		#  Test if null
131
	jnz	sc_10			#  Not end of set yet
132
	incl	%esi			#  Next char in str
133
sc_60:	movl	%ecx,%edi		#  %edi = Set
134
	movb	(%esi),%al		#  Test if this char exist
135
	andb	%al,%al
136
	jnz	sc_20			#  Not end of string
137
	clrl	%esi			#  Return Null
138
sc_fo:	movl	%esi,%eax		#  Char found here
139
	movl	%edx,%edi		#  Restore
140
	popl	%esi
141
	ret
142
.strcont_end:	
143
	.size strcont,.strcont_end-strcont
144
145
	# Find end of string
146
	# Arg: str
147
	# ret: Pointer to end null
148
149
.globl strend
150
	.type strend,@function
151
strend:	
152
	movl	%edi,%edx		#  Save
153
	movl	4(%esp),%edi		#  str
154
	clrl	%eax			#  Find end of string
155
	movl	%eax,%ecx
156
	decl	%ecx			#  ECX = -1
157
	repne
158
	scasb
159
	movl	%edi,%eax
160
	decl	%eax			#  End of string
161
	movl	%edx,%edi		#  Restore
162
	ret
163
.strend_end:	
164
	.size strend,.strend_end-strend
165
166
	# Make a string with len fill-chars and endnull
167
	# Args: dest,len,fill
168
	# Ret:  dest+len
169
170
.globl strfill
171
	.type strfill,@function
172
strfill:
173
	pushl	%edi
174
	movl	8(%esp),%edi		#  Memory pointer
175
	movl	12(%esp),%ecx		#  Length
176
	movzb	16(%esp),%eax		#  Fill
177
178
	movb	%al,%ah			# (2) Set up a 32 bit pattern
179
	movw	%ax,%dx			# (2)
180
	shll	$16,%eax		# (3)
181
	movw	%dx,%ax			# (2) %eax has the 32 bit pattern.
182
183
	movl	%ecx,%edx		# (2) Save the count of bytes.
184
	shrl	$2,%ecx			# (2) Number of dwords.
185
	rep
186
	stosl				# (5 + 5n)
187
	movb	$3,%cl			# (2)
188
	and	%edx,%ecx		# (2) Fill in the odd bytes
189
	rep
190
	stosb				#  Move last bytes if any
191
192
	movb	%cl,(%edi)		#  End NULL
193
	movl	%edi,%eax		#  End i %eax
194
	popl	%edi
195
	ret
196
.strfill_end:	
197
	.size strfill,.strfill_end-strfill
198
199
200
	# Find a char in or end of a string
201
	# Arg: str,char
202
	# Ret: pointer to found char or NullS
203
204
.globl strcend
205
	.type strcend,@function
206
strcend:
207
	movl	%edi,%edx
208
	movl	4(%esp),%edi		# str
209
	movb	8(%esp),%ah		# search
210
	clrb	%al			# for scasb to find end
211
212
se_10:	cmpb	(%edi),%ah
213
	jz	se_20			# Found char
214
	scasb
215
	jnz	se_10			# Not end
216
	dec 	%edi			# Not found, point at end of string
217
se_20:	movl	%edi,%eax
218
	movl	%edx,%edi		# Restore
219
	ret
220
.strcend_end:	
221
	.size strcend,.strcend_end-strcend
222
223
	# Test if string has a given suffix
224
225
.globl is_prefix
226
	.type is_prefix,@function
227
is_prefix:	
228
	movl	%edi,%edx		# Save %edi
229
	pushl	%esi			# and %esi
230
	movl	12(%esp),%esi		# get suffix
231
	movl	8(%esp),%edi		# s1
232
	movl	$1,%eax			# Ok and zero-test
233
ip_10:	cmpb	(%esi),%ah
234
	jz	suf_ok			# End of string/ found suffix
235
	cmpsb				# Compare strings
236
	jz	ip_10			# Same, possible prefix
237
	xor	%eax,%eax		# Not suffix
238
suf_ok:	popl	%esi
239
	movl	%edx,%edi
240
	ret
241
.is_prefix_end:	
242
	.size is_prefix,.is_prefix_end-is_prefix
243
244
	# Find a substring in string
245
	# Arg: str,search
246
247
.globl strstr
248
	.type strstr,@function
249
250
strstr:	
251
	pushl	%edi
252
	pushl	%esi
253
	movl	12(%esp),%esi		#  str
254
	movl	16(%esp),%edi		#  search
255
	movl	%edi,%ecx
256
	incl	%ecx			#  %ecx = search+1
257
	movb	(%edi),%ah		#  %ah = First char in search
258
	jmp	sf_10
259
260
sf_00:	movl	%edx,%esi		#  si = Current str-pos
261
sf_10:	movb	(%esi),%al		#  Test if this char exist
262
	andb	%al,%al
263
	jz	sf_90			#  End of string, didn't find search
264
	incl	%esi
265
	cmpb	%al,%ah
266
	jnz	sf_10			#  Didn't find first char, continue
267
	movl	%esi,%edx		#  Save str-pos in %edx
268
	movl	%ecx,%edi
269
sf_20:	cmpb	$0,(%edi)
270
	jz	sf_fo			#  Found substring
271
	cmpsb
272
	jz	sf_20			#  Char ok
273
	jmp	sf_00			#  Next str-pos
274
275
sf_90:	movl	$1,%edx			#  Return Null
276
sf_fo:	movl	%edx,%eax		#  Char found here
277
	decl	%eax			#  Pointed one after
278
	popl	%esi
279
	popl	%edi
280
	ret
281
.strstr_end:	
282
	.size strstr,.strstr_end-strstr
283
284
285
	# Find a substring in string, return index
286
	# Arg: str,search
287
288
.globl strinstr
289
	.type strinstr,@function
290
291
strinstr:
292
	pushl	%ebp
293
	movl	%esp,%ebp
294
	pushl	12(%ebp)		#  search
295
	pushl	8(%ebp)			#  str
296
	call	strstr
297
	add	$8,%esp
298
	or	%eax,%eax
299
	jz	si_99			#  Not found, return NULL
300
	sub	8(%ebp),%eax		#  Pos from start
301
	inc	%eax			#  And first pos = 1
302
si_99:	popl	%ebp
303
	ret
304
.strinstr_end:	
305
	.size strinstr,.strinstr_end-strinstr
306
307
	# Make a string of len length from another string
308
	# Arg: dst,src,length
309
	# ret: end of dst
310
311
.globl strmake
312
	.type strmake,@function
313
314
strmake:	
315
	pushl	%edi
316
	pushl	%esi
317
	mov	12(%esp),%edi		# dst
318
	movl	$0,%edx
319
	movl	20(%esp),%ecx		# length
320
	movl	16(%esp),%esi		# src
321
	cmpl	%edx,%ecx
322
	jz	sm_90
323
sm_00:	movb	(%esi,%edx),%al
324
	cmpb	$0,%al
325
	jz	sm_90
326
	movb	%al,(%edi,%edx)
327
	incl	%edx
328
	cmpl	%edx,%ecx
329
	jnz	sm_00
330
sm_90:	movb	$0,(%edi,%edx)
331
sm_99:	lea	(%edi,%edx),%eax	# Return pointer to end null
332
	pop	%esi
333
	pop	%edi
334
	ret
335
.strmake_end:	
336
	.size strmake,.strmake_end-strmake
337
338
	# Move a string with max len chars
339
	# arg: dst,src,len
340
	# ret: pos to first null or dst+len
341
342
.globl strnmov
343
	.type strnmov,@function
344
strnmov:	
345
	pushl	%edi
346
	pushl	%esi
347
	movl	12(%esp),%edi		#  dst
348
	movl	16(%esp),%esi		#  src
349
	movl	20(%esp),%ecx		#  Length of memory-area
350
	jecxz	snm_99			#  Nothing to do
351
	clrb	%al			#  For test of end-null
352
353
snm_10:	cmpb	(%esi),%al		#  Next char to move
354
	movsb				#  move arg
355
	jz	snm_20			#  last char, fill with null
356
	loop	snm_10			#  Continue moving
357
	incl	%edi			#  Point two after last
358
snm_20:	decl	%edi			#  Point at first null (or last+1)
359
snm_99:	movl	%edi,%eax		#  Pointer at last char
360
	popl	%esi
361
	popl	%edi
362
	ret
363
.strnmov_end:	
364
	.size strnmov,.strnmov_end-strnmov
365
366
	
367
.globl strmov
368
	.type strmov,@function
369
strmov:	
370
	movl	%esi,%ecx		#  Save old %esi and %edi
371
	movl	%edi,%edx
372
	movl	8(%esp),%esi		#  get source pointer (s2)
373
	movl	4(%esp),%edi		#  %edi -> s1
374
smo_10:	movb	(%esi),%al
375
	movsb				#  move arg
376
	andb	%al,%al
377
	jnz	smo_10			#  Not last
378
	movl	%edi,%eax
379
	dec	%eax
380
	movl	%ecx,%esi		#  Restore
381
	movl	%edx,%edi
382
	ret
383
.strmov_end:	
384
	.size strmov,.strmov_end-strmov
385
386
.globl strxmov
387
	.type	 strxmov,@function
388
strxmov:
389
	movl	%ebx,%edx		#  Save %ebx, %esi and %edi
390
	mov	%esi,%ecx
391
	push	%edi
392
	leal	8(%esp),%ebx		#  Get destination
393
	movl	(%ebx),%edi
394
	xorb	%al,%al
395
	jmp	next_str		#  Handle source ebx+4
396
397
start_str:
398
	movsb
399
	cmpb	-1(%edi),%al
400
	jne	start_str
401
	decl	%edi			#  Don't copy last null
402
403
next_str:
404
	addl	$4,%ebx
405
	movl	(%ebx),%esi
406
	orl	%esi,%esi
407
	jne	start_str
408
	movb	%al,0(%edi)		#  Force last to ASCII 0
409
410
	movl	%edi,%eax		#  Return ptr to ASCII 0
411
	pop	%edi			#  Restore registers
412
	movl	%ecx,%esi
413
	movl	%edx,%ebx
414
	ret
415
.strxmov_end:
416
	.size	 strxmov,.strxmov_end-strxmov
(-)a/strings/strings-x86.S (+441 lines)
Line 0 Link Here
1
# Copyright (C) 2000 MySQL AB
2
# This program is free software; you can redistribute it and/or modify
3
# it under the terms of the GNU General Public License as published by
4
# the Free Software Foundation; version 2 of the License.
5
#
6
# This program is distributed in the hope that it will be useful,
7
# but WITHOUT ANY WARRANTY; without even the implied warranty of
8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9
# GNU General Public License for more details.
10
#
11
# You should have received a copy of the GNU General Public License
12
# along with this program; if not, write to the Free Software
13
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14
15
# Optimized string functions Intel 80x86  (gcc/gas syntax)
16
17
	.file	"strings.s"
18
	.version "1.00"
19
20
.text
21
22
#	Move a alligned, not overlapped, by (long) divided memory area
23
#	Args: to,from,length
24
25
.globl bmove_align
26
	.type	 bmove_align,@function
27
bmove_align:	
28
	movl	%edi,%edx
29
	push	%esi
30
	movl	4(%esp),%edi		# to
31
	movl	8(%esp),%esi		# from
32
	movl	12(%esp),%ecx		# length
33
	addw	$3,%cx			# fix if not divisible with long
34
	shrw	$2,%cx
35
	jz	.ba_20
36
	.p2align 4,,7
37
.ba_10:
38
	movl	-4(%esi,%ecx),%eax
39
	movl	 %eax,-4(%edi,%ecx)
40
	decl	%ecx
41
	jnz	.ba_10
42
.ba_20:	pop	%esi
43
	movl	%edx,%edi
44
	ret
45
46
.bmove_align_end:	
47
	.size	 bmove_align,.bmove_align_end-bmove_align
48
49
	# Move a string from higher to lower
50
	# Arg from_end+1,to_end+1,length
51
52
.globl bmove_upp
53
	.type bmove_upp,@function
54
bmove_upp:	
55
	movl	%edi,%edx		# Remember %edi
56
	push	%esi
57
	movl	8(%esp),%edi		# dst
58
	movl	16(%esp),%ecx		# length
59
	movl	12(%esp),%esi		# source
60
	test	%ecx,%ecx
61
	jz	.bu_20
62
	subl	%ecx,%esi		# To start of strings
63
	subl	%ecx,%edi
64
	
65
	.p2align 4,,7
66
.bu_10:	movb	-1(%esi,%ecx),%al
67
	movb	 %al,-1(%edi,%ecx)
68
	decl	%ecx
69
	jnz	.bu_10
70
.bu_20:	pop	%esi
71
	movl	%edx,%edi
72
	ret
73
74
.bmove_upp_end:	
75
	.size bmove_upp,.bmove_upp_end-bmove_upp
76
77
	# Append fillchars to string
78
	# Args: dest,len,fill
79
80
.globl strappend
81
	.type strappend,@function
82
strappend:	
83
	pushl	%edi
84
	movl	8(%esp),%edi		#  Memory pointer
85
	movl	12(%esp),%ecx		#  Length
86
	clrl	%eax			#  Find end of string
87
	repne
88
	scasb
89
	jnz	sa_99			#  String to long, shorten it
90
	movzb	16(%esp),%eax		#  Fillchar
91
	decl	%edi			#  Point at end null
92
	incl	%ecx			#  rep made one dec for null-char
93
94
	movb	%al,%ah			# (2) Set up a 32 bit pattern.
95
	movw	%ax,%dx			# (2)
96
	shll	$16,%eax		# (3)
97
	movw	%dx,%ax			# (2) %eax has the 32 bit pattern.
98
99
	movl	%ecx,%edx		# (2) Save the count of bytes.
100
	shrl	$2,%ecx			# (2) Number of dwords.
101
	rep
102
	stosl				# (5 + 5n)
103
	movb	$3,%cl			# (2)
104
	and	%edx,%ecx		# (2) Fill in the odd bytes
105
	rep
106
	stosb				#  Move last bytes if any
107
108
sa_99:	movb	$0,(%edi)		#  End of string
109
	popl	%edi
110
	ret
111
.strappend_end:	
112
	.size strappend,.strappend_end-strappend
113
114
	# Find if string contains any char in another string
115
	# Arg: str,set
116
	# Ret: Pointer to first found char in str
117
118
.globl strcont
119
	.type strcont,@function
120
strcont:	
121
	movl	%edi,%edx
122
	pushl	%esi
123
	movl	8(%esp),%esi		#  str
124
	movl	12(%esp),%ecx		#  set
125
	clrb	%ah			#  For endtest
126
	jmp	sc_60
127
128
sc_10:	scasb
129
	jz	sc_fo			#  Found char
130
sc_20:	cmp	(%edi),%ah		#  Test if null
131
	jnz	sc_10			#  Not end of set yet
132
	incl	%esi			#  Next char in str
133
sc_60:	movl	%ecx,%edi		#  %edi = Set
134
	movb	(%esi),%al		#  Test if this char exist
135
	andb	%al,%al
136
	jnz	sc_20			#  Not end of string
137
	clrl	%esi			#  Return Null
138
sc_fo:	movl	%esi,%eax		#  Char found here
139
	movl	%edx,%edi		#  Restore
140
	popl	%esi
141
	ret
142
.strcont_end:	
143
	.size strcont,.strcont_end-strcont
144
145
	# Find end of string
146
	# Arg: str
147
	# ret: Pointer to end null
148
149
.globl strend
150
	.type strend,@function
151
strend:	
152
	movl	%edi,%edx		#  Save
153
	movl	4(%esp),%edi		#  str
154
	clrl	%eax			#  Find end of string
155
	movl	%eax,%ecx
156
	decl	%ecx			#  ECX = -1
157
	repne
158
	scasb
159
	movl	%edi,%eax
160
	decl	%eax			#  End of string
161
	movl	%edx,%edi		#  Restore
162
	ret
163
.strend_end:	
164
	.size strend,.strend_end-strend
165
166
	# Make a string with len fill-chars and endnull
167
	# Args: dest,len,fill
168
	# Ret:  dest+len
169
170
.globl strfill
171
	.type strfill,@function
172
strfill:
173
	pushl	%edi
174
	movl	8(%esp),%edi		#  Memory pointer
175
	movl	12(%esp),%ecx		#  Length
176
	movzb	16(%esp),%eax		#  Fill
177
178
	movb	%al,%ah			# (2) Set up a 32 bit pattern
179
	movw	%ax,%dx			# (2)
180
	shll	$16,%eax		# (3)
181
	movw	%dx,%ax			# (2) %eax has the 32 bit pattern.
182
183
	movl	%ecx,%edx		# (2) Save the count of bytes.
184
	shrl	$2,%ecx			# (2) Number of dwords.
185
	rep
186
	stosl				# (5 + 5n)
187
	movb	$3,%cl			# (2)
188
	and	%edx,%ecx		# (2) Fill in the odd bytes
189
	rep
190
	stosb				#  Move last bytes if any
191
192
	movb	%cl,(%edi)		#  End NULL
193
	movl	%edi,%eax		#  End i %eax
194
	popl	%edi
195
	ret
196
.strfill_end:	
197
	.size strfill,.strfill_end-strfill
198
199
200
	# Find a char in or end of a string
201
	# Arg: str,char
202
	# Ret: pointer to found char or NullS
203
204
.globl strcend
205
	.type strcend,@function
206
strcend:
207
	movl	%edi,%edx
208
	movl	4(%esp),%edi		# str
209
	movb	8(%esp),%ah		# search
210
	clrb	%al			# for scasb to find end
211
212
se_10:	cmpb	(%edi),%ah
213
	jz	se_20			# Found char
214
	scasb
215
	jnz	se_10			# Not end
216
	dec 	%edi			# Not found, point at end of string
217
se_20:	movl	%edi,%eax
218
	movl	%edx,%edi		# Restore
219
	ret
220
.strcend_end:	
221
	.size strcend,.strcend_end-strcend
222
223
	# Test if string has a given suffix
224
225
.globl is_prefix
226
	.type is_prefix,@function
227
is_prefix:	
228
	movl	%edi,%edx		# Save %edi
229
	pushl	%esi			# and %esi
230
	movl	12(%esp),%esi		# get suffix
231
	movl	8(%esp),%edi		# s1
232
	movl	$1,%eax			# Ok and zero-test
233
ip_10:	cmpb	(%esi),%ah
234
	jz	suf_ok			# End of string/ found suffix
235
	cmpsb				# Compare strings
236
	jz	ip_10			# Same, possible prefix
237
	xor	%eax,%eax		# Not suffix
238
suf_ok:	popl	%esi
239
	movl	%edx,%edi
240
	ret
241
.is_prefix_end:	
242
	.size is_prefix,.is_prefix_end-is_prefix
243
244
	# Find a substring in string
245
	# Arg: str,search
246
247
.globl strstr
248
	.type strstr,@function
249
250
strstr:	
251
	pushl	%edi
252
	pushl	%esi
253
	movl	12(%esp),%esi		#  str
254
	movl	16(%esp),%edi		#  search
255
	movl	%edi,%ecx
256
	incl	%ecx			#  %ecx = search+1
257
	movb	(%edi),%ah		#  %ah = First char in search
258
	jmp	sf_10
259
260
sf_00:	movl	%edx,%esi		#  si = Current str-pos
261
sf_10:	movb	(%esi),%al		#  Test if this char exist
262
	andb	%al,%al
263
	jz	sf_90			#  End of string, didn't find search
264
	incl	%esi
265
	cmpb	%al,%ah
266
	jnz	sf_10			#  Didn't find first char, continue
267
	movl	%esi,%edx		#  Save str-pos in %edx
268
	movl	%ecx,%edi
269
sf_20:	cmpb	$0,(%edi)
270
	jz	sf_fo			#  Found substring
271
	cmpsb
272
	jz	sf_20			#  Char ok
273
	jmp	sf_00			#  Next str-pos
274
275
sf_90:	movl	$1,%edx			#  Return Null
276
sf_fo:	movl	%edx,%eax		#  Char found here
277
	decl	%eax			#  Pointed one after
278
	popl	%esi
279
	popl	%edi
280
	ret
281
.strstr_end:	
282
	.size strstr,.strstr_end-strstr
283
284
285
	# Find a substring in string, return index
286
	# Arg: str,search
287
288
.globl strinstr
289
	.type strinstr,@function
290
291
strinstr:
292
	pushl	%ebp
293
	movl	%esp,%ebp
294
#ifdef __PIC__
295
# undef __i686 /* gcc define gets in our way */
296
        pushl   %ebx
297
        call    __i686.get_pc_thunk.bx
298
        addl    $_GLOBAL_OFFSET_TABLE_, %ebx
299
#endif
300
	pushl	12(%ebp)		#  search
301
	pushl	8(%ebp)			#  str
302
#ifdef __PIC__
303
        call    strstr@PLT /*We need to be sure that ebx point to the got*/
304
#else
305
	call	strstr
306
#endif
307
	add	$8,%esp
308
	or	%eax,%eax
309
	jz	si_99			#  Not found, return NULL
310
	sub	8(%ebp),%eax		#  Pos from start
311
	inc	%eax			#  And first pos = 1
312
si_99:	
313
#ifdef __PIC__
314
        popl	%ebx
315
#endif
316
	popl	%ebp
317
	ret
318
.strinstr_end:	
319
	.size strinstr,.strinstr_end-strinstr
320
321
	# Make a string of len length from another string
322
	# Arg: dst,src,length
323
	# ret: end of dst
324
325
.globl strmake
326
	.type strmake,@function
327
328
strmake:	
329
	pushl	%edi
330
	pushl	%esi
331
	mov	12(%esp),%edi		# dst
332
	movl	$0,%edx
333
	movl	20(%esp),%ecx		# length
334
	movl	16(%esp),%esi		# src
335
	cmpl	%edx,%ecx
336
	jz	sm_90
337
sm_00:	movb	(%esi,%edx),%al
338
	cmpb	$0,%al
339
	jz	sm_90
340
	movb	%al,(%edi,%edx)
341
	incl	%edx
342
	cmpl	%edx,%ecx
343
	jnz	sm_00
344
sm_90:	movb	$0,(%edi,%edx)
345
sm_99:	lea	(%edi,%edx),%eax	# Return pointer to end null
346
	pop	%esi
347
	pop	%edi
348
	ret
349
.strmake_end:	
350
	.size strmake,.strmake_end-strmake
351
352
	# Move a string with max len chars
353
	# arg: dst,src,len
354
	# ret: pos to first null or dst+len
355
356
.globl strnmov
357
	.type strnmov,@function
358
strnmov:	
359
	pushl	%edi
360
	pushl	%esi
361
	movl	12(%esp),%edi		#  dst
362
	movl	16(%esp),%esi		#  src
363
	movl	20(%esp),%ecx		#  Length of memory-area
364
	jecxz	snm_99			#  Nothing to do
365
	clrb	%al			#  For test of end-null
366
367
snm_10:	cmpb	(%esi),%al		#  Next char to move
368
	movsb				#  move arg
369
	jz	snm_20			#  last char, fill with null
370
	loop	snm_10			#  Continue moving
371
	incl	%edi			#  Point two after last
372
snm_20:	decl	%edi			#  Point at first null (or last+1)
373
snm_99:	movl	%edi,%eax		#  Pointer at last char
374
	popl	%esi
375
	popl	%edi
376
	ret
377
.strnmov_end:	
378
	.size strnmov,.strnmov_end-strnmov
379
380
	
381
.globl strmov
382
	.type strmov,@function
383
strmov:	
384
	movl	%esi,%ecx		#  Save old %esi and %edi
385
	movl	%edi,%edx
386
	movl	8(%esp),%esi		#  get source pointer (s2)
387
	movl	4(%esp),%edi		#  %edi -> s1
388
smo_10:	movb	(%esi),%al
389
	movsb				#  move arg
390
	andb	%al,%al
391
	jnz	smo_10			#  Not last
392
	movl	%edi,%eax
393
	dec	%eax
394
	movl	%ecx,%esi		#  Restore
395
	movl	%edx,%edi
396
	ret
397
.strmov_end:	
398
	.size strmov,.strmov_end-strmov
399
400
.globl strxmov
401
	.type	 strxmov,@function
402
strxmov:
403
	movl	%ebx,%edx		#  Save %ebx, %esi and %edi
404
	mov	%esi,%ecx
405
	push	%edi
406
	leal	8(%esp),%ebx		#  Get destination
407
	movl	(%ebx),%edi
408
	xorb	%al,%al
409
	jmp	next_str		#  Handle source ebx+4
410
411
start_str:
412
	movsb
413
	cmpb	-1(%edi),%al
414
	jne	start_str
415
	decl	%edi			#  Don't copy last null
416
417
next_str:
418
	addl	$4,%ebx
419
	movl	(%ebx),%esi
420
	orl	%esi,%esi
421
	jne	start_str
422
	movb	%al,0(%edi)		#  Force last to ASCII 0
423
424
	movl	%edi,%eax		#  Return ptr to ASCII 0
425
	pop	%edi			#  Restore registers
426
	movl	%ecx,%esi
427
	movl	%edx,%ebx
428
	ret
429
.strxmov_end:
430
	.size	 strxmov,.strxmov_end-strxmov
431
432
#ifdef __PIC__
433
	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
434
	.globl __i686.get_pc_thunk.bx
435
	.hidden	__i686.get_pc_thunk.bx
436
	.type	__i686.get_pc_thunk.bx,@function
437
__i686.get_pc_thunk.bx:
438
	movl (%esp), %ebx
439
	ret
440
#endif
441
	.section	.note.GNU-stack,"",@progbits

Return to bug 344031