summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@butch.>2002-11-07 03:54:00 +0200
committerunknown <monty@butch.>2002-11-07 03:54:00 +0200
commitc88b91020866b1505404157c76c56cbb92410ec5 (patch)
tree2cbd26b72e2ab9ce6d8a7e6cf96fab865fec9834 /strings
parent841fa6f694a5d998b94a6cd4508fe7d26e8407f3 (diff)
downloadmariadb-git-c88b91020866b1505404157c76c56cbb92410ec5.tar.gz
Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes.
client/mysqlbinlog.cc: Portability fix configure.in: Added use of ASFLAGS (For Solaris with Forte 5.0) include/my_global.h: Portability fix include/myisam.h: Portability fix include/queues.h: Portability fix innobase/include/ut0ut.h: Portability fix innobase/log/log0log.c: Portability fix innobase/rem/rem0cmp.c: Portability fix innobase/trx/trx0sys.c: Portability fix isam/pack_isam.c: Portability fix myisam/ft_boolean_search.c: Portability fix myisam/mi_dynrec.c: Code change to go around bug in Forte 5.0 myisam/sort.c: Portability fix mysys/my_aes.c: Portability fix scripts/Makefile.am: Support for ASFLAGS scripts/mysqlbug.sh: Support for ASFLAGS sql/field.cc: Portability fix sql/filesort.cc: Portability fix sql/gen_lex_hash.cc: Portability fix sql/ha_innodb.cc: Portability fix Changed SHOW INNODB STATUS to return error instead of writing message to log file. sql/ha_isammrg.cc: Portability fix sql/ha_myisam.cc: Portability fix sql/ha_myisammrg.cc: Portability fix sql/hash_filo.h: Portability fix sql/hostname.cc: Portability fix sql/item_cmpfunc.h: Indentation change sql/item_func.cc: Portability fix sql/item_func.h: Portability fix sql/log.cc: Portability fix sql/log_event.cc: Portability fix sql/mysql_priv.h: Portability fix sql/mysqld.cc: Portability fix Fixed bug with rpl_recovery_rank command line option on 64 bit systems sql/opt_range.cc: Portability fix sql/repl_failsafe.cc: Portability fix sql/slave.cc: Portability fix sql/slave.h: Portability fix sql/sql_acl.cc: Portability fix sql/sql_base.cc: Portability fix sql/sql_cache.cc: Portability fix sql/sql_cache.h: Portability fix sql/sql_class.cc: Portability fix sql/sql_delete.cc: Portability fix sql/sql_insert.cc: Portability fix sql/sql_manager.cc: Portability fix sql/sql_parse.cc: Portability fix BUILD/compile-solaris-sparc-forte: C sql/sql_udf.cc: Portability fix sql/sql_update.cc: Portability fix strings/Makefile.am: Portability fix strings/bmove_upp-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/str_test.c: Cleanup strings/strappend-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strend-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strmake-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strmov-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strnmov-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strstr-sparc.s: Fix so that this works on 32 and 64 bit sparcs strings/strxmov-sparc.s: Fixes to make this more portable, but it's still not usable on 64 bit systems :( BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'strings')
-rw-r--r--strings/Makefile.am11
-rw-r--r--strings/bmove_upp-sparc.s4
-rw-r--r--strings/str_test.c3
-rw-r--r--strings/strappend-sparc.s14
-rw-r--r--strings/strend-sparc.s6
-rw-r--r--strings/strmake-sparc.s8
-rw-r--r--strings/strmov-sparc.s6
-rw-r--r--strings/strnmov-sparc.s8
-rw-r--r--strings/strstr-sparc.s18
-rw-r--r--strings/strxmov-sparc.s17
10 files changed, 50 insertions, 45 deletions
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 9f55a4a8ff8..c5f3d4e4b2a 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -24,11 +24,11 @@ if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s
CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c
else
-if ASSEMBLER_sparc
+if ASSEMBLER_sparc32
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
-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 strxmov-sparc.s
-CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c
+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
+CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c strxmov.c
else
#no assembler
ASRCS =
@@ -75,8 +75,11 @@ clean-local:
if ASSEMBLER
# On Linux gcc can compile the assembly files
%.o : %.s
- $(AS) -o $@ $<
+ $(AS) $(ASFLAGS) -o $@ $<
endif
+str_test: str_test.c $(LIBRARIES)
+ $(LINK) $(FLAGS) -DMAIN $(srcdir)/str_test.c $(LDADD) $(LIBS)
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/strings/bmove_upp-sparc.s b/strings/bmove_upp-sparc.s
index 4fae7f5cc7c..f38c391f8ab 100644
--- a/strings/bmove_upp-sparc.s
+++ b/strings/bmove_upp-sparc.s
@@ -27,11 +27,11 @@ bmove_upp:
nop
.loop:
sub %o1, 1, %o1
- ldub [%o1], %g2
+ ldub [%o1], %o3
sub %o0, 1, %o0
subcc %o2, 1, %o2
bcc .loop
- stb %g2, [%o0]
+ stb %o3, [%o0]
.end:
retl
nop
diff --git a/strings/str_test.c b/strings/str_test.c
index bef48814f6d..0c3ff471ad7 100644
--- a/strings/str_test.c
+++ b/strings/str_test.c
@@ -130,9 +130,6 @@ int main(void)
if (errors)
fputs("--- Some functions doesn't work!! Fix them\n",stderr);
return(errors > 0);
-
- fputs("Fatal error\n",stderr);
- return(2);
} /* main */
diff --git a/strings/strappend-sparc.s b/strings/strappend-sparc.s
index 69bb555aa47..30b621c3fce 100644
--- a/strings/strappend-sparc.s
+++ b/strings/strappend-sparc.s
@@ -22,28 +22,28 @@
.type strappend,#function
.proc 020
strappend:
- add %o0, %o1, %g3 ! g3 = endpos
- ldsb [%o0], %g2
+ add %o0, %o1, %o3 ! o3 = endpos
+ ldsb [%o0], %o4
.loop1:
add %o0, 1, %o0 ! find end of str
- cmp %g2, 0
+ cmp %o4, 0
bne,a .loop1
- ldsb [%o0], %g2
+ ldsb [%o0], %o4
sub %o0, 1, %o0
- cmp %o0, %g3
+ cmp %o0, %o3
bgeu .end
nop
stb %o2, [%o0]
.loop2:
add %o0, 1, %o0
- cmp %o0, %g3
+ cmp %o0, %o3
blu,a .loop2
stb %o2, [%o0]
.end:
retl
- stb %g0, [%g3]
+ stb %g0, [%o3]
.strappend_end:
.size strappend,.strappend_end-strappend
.ident "Matt Wagner & Monty"
diff --git a/strings/strend-sparc.s b/strings/strend-sparc.s
index fd1dba4d36f..0f19f6a435a 100644
--- a/strings/strend-sparc.s
+++ b/strings/strend-sparc.s
@@ -22,12 +22,12 @@
.type strend,#function
.proc 0102
strend:
- ldsb [%o0], %g2 ! Handle first char differently to make
+ ldsb [%o0], %o3 ! Handle first char differently to make
.loop: ! a faster loop
add %o0, 1, %o0
- cmp %g2, 0
+ cmp %o3, 0
bne,a .loop
- ldsb [%o0], %g2
+ ldsb [%o0], %o3
retl
sub %o0,1,%o0
.strend_end:
diff --git a/strings/strmake-sparc.s b/strings/strmake-sparc.s
index 9fe72a9f9a2..4effe95774e 100644
--- a/strings/strmake-sparc.s
+++ b/strings/strmake-sparc.s
@@ -25,16 +25,16 @@ strmake:
orcc %g0,%o2,%g0
be,a .end
nop
- ldsb [%o1],%g2
+ ldsb [%o1],%o3
.loop:
- stb %g2,[%o0]
- cmp %g2,0
+ stb %o3,[%o0]
+ cmp %o3,0
be .end ! Jump to end on end of string
add %o1,1,%o1
add %o0,1,%o0
subcc %o2,1,%o2
bne,a .loop
- ldsb [%o1],%g2
+ ldsb [%o1],%o3
.end:
retl
stb %g0,[%o0]
diff --git a/strings/strmov-sparc.s b/strings/strmov-sparc.s
index 6114b0bf6e2..3536685b47b 100644
--- a/strings/strmov-sparc.s
+++ b/strings/strmov-sparc.s
@@ -23,10 +23,10 @@
.proc 0102
strmov:
.loop:
- ldub [%o1], %g2
- stb %g2, [%o0]
+ ldub [%o1], %o3
+ stb %o3, [%o0]
add %o1, 1, %o1
- cmp %g2, 0
+ cmp %o3, 0
bne,a .loop
add %o0, 1, %o0
retl
diff --git a/strings/strnmov-sparc.s b/strings/strnmov-sparc.s
index 2dfcb95ab76..f681318f410 100644
--- a/strings/strnmov-sparc.s
+++ b/strings/strnmov-sparc.s
@@ -25,16 +25,16 @@ strnmov:
orcc %g0,%o2,%g0
be,a .end
nop
- ldsb [%o1],%g2
+ ldsb [%o1],%o3
.loop:
- stb %g2,[%o0]
- cmp %g2,0
+ stb %o3,[%o0]
+ cmp %o3,0
be .end ! Jump to end on end of string
add %o1,1,%o1
add %o0,1,%o0
subcc %o2,1,%o2
bne,a .loop
- ldsb [%o1],%g2
+ ldsb [%o1],%o3
.end:
retl
nop
diff --git a/strings/strstr-sparc.s b/strings/strstr-sparc.s
index 1263236f107..eb658e9f7f0 100644
--- a/strings/strstr-sparc.s
+++ b/strings/strstr-sparc.s
@@ -33,10 +33,10 @@ strstr:
ldsb [%o1],%o2 ! o2= First char of search
.top:
- ldsb [%o0],%g3 ! g3= First char of rest of str
- cmp %g3,0
+ ldsb [%o0],%o4 ! o4= First char of rest of str
+ cmp %o4,0
be .abort ! Found end null ;
- cmp %g3,%o2
+ cmp %o4,%o2
bne .top
add %o0,1,%o0
@@ -45,20 +45,20 @@ strstr:
! while (*j)
! if (*i++ != *j++) goto skipp;
- or %g0,%o0,%g2
- add %o1,1,%g3 ! g3= search+1
+ or %g0,%o0,%o3
+ add %o1,1,%o4 ! o4= search+1
ldsb [%o0],%o5 ! o5= [current_str+1]
.loop2:
- ldsb [%g3],%g4
- add %g3,1,%g3
+ ldsb [%o4],%g4
+ add %o4,1,%o4
cmp %g4,0
be .end
cmp %o5,%g4
bne .top
- add %g2,1,%g2
+ add %o3,1,%o3
ba .loop2
- ldsb [%g2],%o5
+ ldsb [%o3],%o5
.end:
retl
diff --git a/strings/strxmov-sparc.s b/strings/strxmov-sparc.s
index e65b56d317d..b4ca531d2e4 100644
--- a/strings/strxmov-sparc.s
+++ b/strings/strxmov-sparc.s
@@ -15,12 +15,17 @@
! Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! MA 02111-1307, USA
+!
+! Note that this function only works on 32 bit sparc systems
+! on 64 bits the offsets to %sp are different !
+
.file "strxmov-sparc.s"
.section ".text"
.align 4
.global strxmov
.type strxmov,#function
.proc 0102
+
strxmov:
st %o2, [%sp+76] ! store 3rd param before other params
st %o3, [%sp+80] ! store 4th param " "
@@ -28,18 +33,18 @@ strxmov:
st %o4, [%sp+84] ! store 5th param
be .end
st %o5, [%sp+88] ! store last
- add %sp, 76, %g2 ! put pointer to 3rd arg
+ add %sp, 76, %o4 ! put pointer to 3rd arg
.loop:
- ldub [%o1], %g1 ! set values of src (o1)
+ ldub [%o1], %o5 ! set values of src (o1)
add %o1, 1, %o1 ! inc src
- stb %g1, [%o0] ! and dst (o2) equal
- cmp %g1, 0 ! second while cmp
+ stb %o5, [%o0] ! and dst (o2) equal
+ cmp %o5, 0 ! second while cmp
bne,a .loop
add %o0, 1, %o0 ! inc dst
- ld [%g2], %o1 ! get next param
+ ld [%o4], %o1 ! get next param
cmp %o1, 0 ! check if last param
bne .loop
- add %g2, 4, %g2 ! advance to next param
+ add %o4, 4, %o4 ! advance to next param
.end:
retl
stb %g0, [%o0]