This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] h8300/lib1funcs.asm: Optimize divmodsi4.


Hi,

Attached is a patch to optimize divmodsi4.  S0P, a macro for er4, does
not have to be cleared if we go straight through the conditional jump
to DenHighNonzero.

The patch moves the clearing of S0P to DenHighNonzero.

Tested on h8300 port.  Committed.

Kazu Hirata

2003-11-12  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/lib1funcs.asm (divmodsi4): Clear S0P in
	DenHighNonZero.

Index: lib1funcs.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/lib1funcs.asm,v
retrieving revision 1.19
diff -u -r1.19 lib1funcs.asm
--- lib1funcs.asm	12 Nov 2003 23:39:48 -0000	1.19
+++ lib1funcs.asm	13 Nov 2003 01:00:19 -0000
@@ -589,7 +589,6 @@
 #else /* __H8300H__ */
 
 divmodsi4:
-	sub.l	S0P,S0P		; zero play area
 	mov.w	A1E,A1E		; denominator top word 0?
 	bne	DenHighNonZero
 
@@ -605,6 +604,7 @@
 	rts
 
 DenHighNonZero:
+	sub.l	S0P,S0P		; zero play area
 	mov.w	A0E,A2
 	mov.b	A2H,S0L
 	mov.b	A2L,A2H


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]