Smaller bits

John Tytgat John.Tytgat at aaug.net
Tue Feb 18 14:00:55 PST 2003


Some smaller bits to be patched in the current trunk :

---8<---
	* source/clib/bits/netdb.h: Removed _gethostbyname() and
	  _gethostbyaddr() definition
	* source/netlib/_hostbyadd.s: Removed.
	* source/netlib/_hostbynam.s: Removed.
	* source/netlib/host.c: Removed.
	* source/Makefile: Removed _hostbyadd.o & _hostbynam.o from
	  NETLIB_ASM list.  Removed host.o from NETLIB list.
	* objs/Makefile: Likewise.
	* source/sys/_udiv10.s (_kernel_udiv10, __rt_udiv10): Made routine
	  2 instructions shorter.
	* source/sys/_sdiv10.s (_kernel_sdiv10, __rt_sdiv10): Likewise.
---8<---

Don't forget to remove source/netlib/_hostbyadd.s, source/netlib/_hostbynam.s
and source/netlib/host.c.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven
-------------- next part --------------
Index: objs/Makefile,fe1
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/objs/Makefile,fe1,v
retrieving revision 1.7
diff -u -b -B -r1.7 Makefile,fe1
--- objs/Makefile,fe1	29 Jan 2003 18:49:00 -0000	1.7
+++ objs/Makefile,fe1	18 Feb 2003 21:43:34 -0000
@@ -127,7 +127,7 @@
 
 NETLIB = netlib.o.accept netlib.o.bind netlib.o.connect \
 	netlib.o.getpeernam netlib.o.getsocknam netlib.o.getsockopt \
-	netlib.o.h_errno netlib.o.host \
+	netlib.o.h_errno \
 	netlib.o.inet_lnaof netlib.o.inet_mkad \
 	netlib.o.inet_netof netlib.o.inet_netwo netlib.o.inet_ntoa \
 	netlib.o.ntop netlib.o.listen netlib.o.net netlib.o.proto \
@@ -138,7 +138,7 @@
 NETLIB_ASM = netlib.o._accept netlib.o._bind netlib.o._bswap_16 \
 	netlib.o._bswap_32 netlib.o._connect \
 	netlib.o._getpeerna netlib.o._getsockna netlib.o._getsockop \
-	netlib.o._gettsize netlib.o._hostbyadd netlib.o._hostbynam \
+	netlib.o._gettsize \
 	netlib.o._listen netlib.o._net_error netlib.o._readv netlib.o._recv \
 	netlib.o._recvfrom \
 	netlib.o._recvmsg netlib.o._sclose netlib.o._select netlib.o._send \
Index: source/Makefile
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/Makefile,v
retrieving revision 1.11
diff -u -b -B -r1.11 Makefile
--- source/Makefile	29 Dec 2002 19:10:11 -0000	1.11
+++ source/Makefile	18 Feb 2003 21:43:35 -0000
@@ -246,7 +246,6 @@
 	$(libunixobj)/netlib/getpeernam.o \
 	$(libunixobj)/netlib/getsocknam.o \
 	$(libunixobj)/netlib/getsockopt.o \
-	$(libunixobj)/netlib/host.o \
 	$(libunixobj)/netlib/h_errno.o \
 	$(libunixobj)/netlib/in6_addr.o \
 	$(libunixobj)/netlib/inet_lnaof.o \
@@ -281,8 +280,6 @@
 	$(libunixobj)/netlib/_getsockna.o \
 	$(libunixobj)/netlib/_getsockop.o \
 	$(libunixobj)/netlib/_gettsize.o \
-	$(libunixobj)/netlib/_hostbyadd.o \
-	$(libunixobj)/netlib/_hostbynam.o \
 	$(libunixobj)/netlib/_listen.o \
 	$(libunixobj)/netlib/_net_error.o \
 	$(libunixobj)/netlib/_readv.o \
Index: source/clib/bits/netdb.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/clib/bits/netdb.h,v
retrieving revision 1.1
diff -u -b -B -r1.1 netdb.h
--- source/clib/bits/netdb.h	22 Dec 2002 18:22:28 -0000	1.1
+++ source/clib/bits/netdb.h	18 Feb 2003 21:43:35 -0000
@@ -52,8 +52,6 @@
 
 #ifdef __UNIXLIB_INTERNALS
 /* Direct SWI veneers: */
-extern struct hostent *_gethostbyname (const char *name);
-extern struct hostent *_gethostbyaddr (const char *addr, int len, int type);
 extern int _sclose (int sd);
 extern int _sread (int sd, void *data, int nbyte);
 extern int _swrite (int sd, const void *data, int nbyte);
Index: source/sys/_sdiv10.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/sys/_sdiv10.s,v
retrieving revision 1.4
diff -u -b -B -r1.4 _sdiv10.s
--- source/sys/_sdiv10.s	24 Sep 2002 21:02:38 -0000	1.4
+++ source/sys/_sdiv10.s	18 Feb 2003 21:43:35 -0000
@@ -19,19 +19,17 @@
 |__rt_sdiv10|
 	MOVS	a4, a1
 	RSBMI	a1, a1, #0
-	MOV	a2, a1
-	MOV	a1, a1, LSR #1
-	ADD	a1, a1, a1, LSR #1
+	SUB	a2, a1, #10		; Keep a1 - 10 for later
+	SUB	a1, a1, a1, LSR #2
 	ADD	a1, a1, a1, LSR #4
 	ADD	a1, a1, a1, LSR #8
 	ADD	a1, a1, a1, LSR #16
-	MOV	a1, a1, LSR #3
+	MOV	a1, a1, LSR #3		; a1 = a1 (on entry) / 10
 	ADD	a3, a1, a1, LSL #2
-	SUB	a2, a2, a3, LSL #1
-	CMP	a2, #10
-	ADDGE	a1, a1, #1
-	SUBGE	a2, a2, #10
-	CMP	a4, #0
+	SUBS	a2, a2, a3, LSL #1	; Calculate a1/10 - (a1/10)*10
+	ADDPL	a1, a1, #1		; Fix quotient
+	ADDMI	a2, a2, #10		; Fix remainder
+	CMP	a4, #0			; Negative sign ?
 	RSBMI	a1, a1, #0
 	RSBMI	a2, a2, #0
 	return	AL, pc, lr
Index: source/sys/_udiv10.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/sys/_udiv10.s,v
retrieving revision 1.4
diff -u -b -B -r1.4 _udiv10.s
--- source/sys/_udiv10.s	24 Sep 2002 21:02:38 -0000	1.4
+++ source/sys/_udiv10.s	18 Feb 2003 21:43:35 -0000
@@ -17,18 +17,16 @@
 	NAME	__rt_udiv10
 |_kernel_udiv10|
 |__rt_udiv10|
-	MOV	a2, a1
-	MOV	a1, a1, LSR #1
-	ADD	a1, a1, a1, LSR #1
+	SUB	a2, a1, #10		; Keep a1 - 10 for later
+	SUB	a1, a1, a1, LSR #2
 	ADD	a1, a1, a1, LSR #4
 	ADD	a1, a1, a1, LSR #8
 	ADD	a1, a1, a1, LSR #16
-	MOV	a1, a1, LSR #3
+	MOV	a1, a1, LSR #3		; a1 = a1 (on entry) / 10
 	ADD	a3, a1, a1, LSL #2
-	SUB	a2, a2, a3, LSL #1
-	CMP	a2, #10
-	ADDGE	a1, a1, #1
-	SUBGE	a2, a2, #10
+	SUBS	a2, a2, a3, LSL #1	; Calculate a1/10 - (a1/10)*10
+	ADDPL	a1, a1, #1		; Fix quotient
+	ADDMI	a2, a2, #10		; Fix remainder
 	return	AL, pc, lr
 
 	END


More information about the gcc mailing list