summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-06-05 00:12:45 +0300
committerunknown <monty@narttu.mysql.fi>2003-06-05 00:12:45 +0300
commitad5e39bf12b7aeefbc313e464a1349541a7b15c5 (patch)
tree824e127f68404d3fbe881d6619e34ad389d21202 /strings
parent020baadcfebbd0f2248d9a3fa15f29d6e9d954b4 (diff)
parentc6c60f6ee819a238ab62e3f9608502c9a8f25b36 (diff)
downloadmariadb-git-ad5e39bf12b7aeefbc313e464a1349541a7b15c5.tar.gz
merge with public tree
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union client/mysql.cc: Auto merged configure.in: Auto merged include/config-win.h: Auto merged include/mysql.h: Auto merged include/mysql_version.h.in: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/ctype_collate.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/subselect.test: Auto merged mysys/default.c: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/protocol.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_string.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'strings')
-rw-r--r--strings/Makefile.am2
-rw-r--r--strings/ctype.c2
-rw-r--r--strings/str_test.c4
-rw-r--r--strings/strings-x86.s86
-rw-r--r--strings/strings.asm16
5 files changed, 60 insertions, 50 deletions
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 4a57ed73d20..7b2fdcccc55 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -73,7 +73,7 @@ if ASSEMBLER
endif
str_test: str_test.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(srcdir)/str_test.c $(LDADD) $(LIBS)
+ $(LINK) $(FLAGS) -DMAIN $INCLUDES $(srcdir)/str_test.c $(LDADD) $(LIBS) $(pkglib_LIBRARIES)
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/strings/ctype.c b/strings/ctype.c
index ce7bb9ca4a4..cbd13111b70 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -31,7 +31,6 @@ static char *mstr(char *str,const char *src,uint l1,uint l2)
return str;
}
-
struct my_cs_file_section_st
{
int state;
@@ -265,4 +264,3 @@ my_bool my_parse_charset_xml(const char *buf, uint len,
my_xml_parser_free(&p);
return rc;
}
-
diff --git a/strings/str_test.c b/strings/str_test.c
index 0c3ff471ad7..369fa7251d8 100644
--- a/strings/str_test.c
+++ b/strings/str_test.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -94,6 +94,8 @@ int main(void)
test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp(to+6,from+6,3),0L),INT_MAX32,
3,T_CHAR,3,F_CHAR,0,0);
test_strarg("bmove_upp(to,from,0)",(bmove_upp(to,from,0),0L),INT_MAX32,0,0);
+ test_strarg("bmove_align(to,from,8)",(bmove_align(to,from,8),0L),INT_MAX32,
+ 8,F_CHAR,0,0);
test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32,
3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0);
test_strarg("strappend(to,T_LEN+5,' ')",(strappend(to,T_LEN+5,' '),0L),INT_MAX32,
diff --git a/strings/strings-x86.s b/strings/strings-x86.s
index 8b29a2db7f1..9409657e06c 100644
--- a/strings/strings-x86.s
+++ b/strings/strings-x86.s
@@ -23,44 +23,53 @@
# Move a alligned, not overlapped, by (long) divided memory area
# Args: to,from,length
-.globl bmove_allign
- .type bmove_allign,@function
-bmove_allign:
+.globl bmove_align
+ .type bmove_align,@function
+bmove_align:
movl %edi,%edx
- movl %esi,%eax
+ push %esi
movl 4(%esp),%edi # to
movl 8(%esp),%esi # from
movl 12(%esp),%ecx # length
addw $3,%cx # fix if not divisible with long
shrw $2,%cx
- rep
- movsl
- movl %eax,%esi
+ jz .ba_20
+ .p2align 4,,7
+.ba_10:
+ movl -4(%esi,%ecx),%eax
+ movl %eax,-4(%edi,%ecx)
+ decl %ecx
+ jnz .ba_10
+.ba_20: pop %esi
movl %edx,%edi
ret
-.end:
- .size bmove_allign,.end-bmove_allign
+ .size bmove_align,.end-bmove_align
# Move a string from higher to lower
- # Arg from+1,to+1,length
+ # Arg from_end+1,to_end+1,length
.globl bmove_upp
.type bmove_upp,@function
bmove_upp:
- std # Work downward
- movl %edi,%edx
- movl %esi,%eax
- movl 4(%esp),%edi # p1
- movl 8(%esp),%esi # p2
- movl 12(%esp),%ecx # length
- decl %edi # Don't move last arg
- decl %esi
- rep
- movsb # One byte a time because overlap
- cld # C library wants cld
- movl %eax,%esi
+ movl %edi,%edx # Remember %edi
+ push %esi
+ movl 8(%esp),%edi # dst
+ movl 16(%esp),%ecx # length
+ movl 12(%esp),%esi # source
+ test %ecx,%ecx
+ jz .bu_20
+ subl %ecx,%esi # To start of strings
+ subl %ecx,%edi
+
+ .p2align 4,,7
+.bu_10: movb -1(%esi,%ecx),%al
+ movb %al,-1(%edi,%ecx)
+ decl %ecx
+ jnz .bu_10
+.bu_20: pop %esi
movl %edx,%edi
ret
+
.bmove_upp_end:
.size bmove_upp,.bmove_upp_end-bmove_upp
@@ -304,22 +313,23 @@ si_99: popl %ebp
strmake:
pushl %edi
pushl %esi
- movl 12(%esp),%edi # dst
- movl 16(%esp),%esi # src
- movl 20(%esp),%ecx # Length of memory-area
- clrb %al # For test of end-null
- jecxz sm_90 # Nothing to move, put zero at end.
-
-sm_10: cmpb (%esi),%al # Next char to move
- movsb # move arg
- jz sm_99 # last char, we are ready
- loop sm_10 # Continue moving
-sm_90: movb %al,(%edi) # Set end pos
- incl %edi # Fix that di points at end null
-sm_99: decl %edi # di points now at end null
- movl %edi,%eax # Ret value.p $
- popl %esi
- popl %edi
+ mov 12(%esp),%edi # dst
+ movl $0,%edx
+ movl 20(%esp),%ecx # length
+ movl 16(%esp),%esi # src
+ cmpl %edx,%ecx
+ jz sm_90
+sm_00: movb (%esi,%edx),%al
+ cmpb $0,%al
+ jz sm_90
+ movb %al,(%edi,%edx)
+ incl %edx
+ cmpl %edx,%ecx
+ jnz sm_00
+sm_90: movb $0,(%edi,%edx)
+sm_99: lea (%edi,%edx),%eax # Return pointer to end null
+ pop %esi
+ pop %edi
ret
.strmake_end:
.size strmake,.strmake_end-strmake
diff --git a/strings/strings.asm b/strings/strings.asm
index 43bc23fa965..fe39c8bb3e6 100644
--- a/strings/strings.asm
+++ b/strings/strings.asm
@@ -219,8 +219,8 @@ _bmove ENDP
; Args: to,from,length
;
- PUBLIC _bmove_allign
-_bmove_allign PROC
+ PUBLIC _bmove_align
+_bmove_align PROC
mov bx,bp
mov dx,di
mov ax,si
@@ -238,7 +238,7 @@ _bmove_allign PROC
mov di,dx
mov bp,bx
ret
-_bmove_allign ENDP
+_bmove_align ENDP
;
; Move a string from higher to lower
@@ -656,9 +656,9 @@ _bmove ENDP
; Args: to,from,length
;
- begcode bmove_allign
- public _bmove_allign
-_bmove_allign proc near
+ begcode bmove_align
+ public _bmove_align
+_bmove_align proc near
fix_es 1
mov edx,edi
mov eax,esi
@@ -671,8 +671,8 @@ _bmove_allign proc near
mov esi,eax
mov edi,edx
ret
-_bmove_allign ENDP
- endcode bmove_allign
+_bmove_align ENDP
+ endcode bmove_align
;
; Move a string from higher to lower