Hi Marius,

* Marius Strobl <mar...@alchemy.franken.de>, 20120113 01:00:
> Uhm, these are V8-specific, for V9 the C compiler frame size should
> be 192 instead of 64 and the function alignment should be 32 instead
> of 4 bytes (at least with GCC and US1-optimizations enabled as we
> default to on sparc64), see <machine/asm.h>. However, given that
> these functions only seem to obtain new register window for
> debugging purposes you probably alternatively could just remove
> the saves and the corresponding restores completely.

Any comments on the attached patch?

Thanks,
-- 
 Ed Schouten <e...@80386.nl>
 WWW: http://80386.nl/
Index: modsi3.S
===================================================================
--- modsi3.S	(revision 230265)
+++ modsi3.S	(working copy)
@@ -47,13 +47,13 @@
  */
 #include "../assembly.h"
 .text
-	.align 4
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__umodsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	b	divide
 	mov	0,%g3			! result always nonnegative
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__modsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	orcc	%o1,%o0,%g0	! are either %o0 or %o1 negative
 	bge	divide			! if not, skip this junk
 	mov	%o0,%g3		! record sign of result in sign of %g3
@@ -324,7 +324,6 @@
 got_result:
 	tst	%g3
 	bge	1f
-	restore
 	! answer < 0
 	retl				! leaf-routine return
 	neg	%o3,%o0 		! remainder <- -%o3
Index: divmod.m4
===================================================================
--- divmod.m4	(revision 230265)
+++ divmod.m4	(working copy)
@@ -59,9 +59,6 @@
 
 #include "../assembly.h"
 
-.text
-	.align 4
-
 define(DEVELOP_QUOTIENT_BITS,
 `	!depth $1, accumulated bits $2
 	bl	L.$1.eval(TWOSUPN+$2)
@@ -84,12 +81,14 @@
 	ifelse( $1, 1, `9:')
 ')
 ifelse( ANSWER, `quotient', `
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__udivsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	b	divide
 	mov	0,SIGN			! result always nonnegative
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__divsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	orcc	divisor,dividend,%g0	! are either dividend or divisor negative
 	bge	divide			! if not, skip this junk
 	xor	divisor,dividend,SIGN	! record sign of result in sign of SIGN
@@ -104,12 +103,14 @@
 	neg	dividend
 	! FALL THROUGH
 ',`
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__umodsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	b	divide
 	mov	0,SIGN			! result always nonnegative
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__modsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	orcc	divisor,dividend,%g0	! are either dividend or divisor negative
 	bge	divide			! if not, skip this junk
 	mov	dividend,SIGN		! record sign of result in sign of SIGN
@@ -235,7 +236,6 @@
 got_result:
 	tst	SIGN
 	bge	1f
-	restore
 	! answer < 0
 	retl				! leaf-routine return
 ifelse( ANSWER, `quotient',
Index: divsi3.S
===================================================================
--- divsi3.S	(revision 230265)
+++ divsi3.S	(working copy)
@@ -47,13 +47,13 @@
  */
 #include "../assembly.h"
 .text
-	.align 4
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__udivsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	b	divide
 	mov	0,%g3			! result always nonnegative
+.text
+	.align 32
 DEFINE_COMPILERRT_FUNCTION(__divsi3)
-	save	%sp,-64,%sp		! do this for debugging
 	orcc	%o1,%o0,%g0	! are either %o0 or %o1 negative
 	bge	divide			! if not, skip this junk
 	xor	%o1,%o0,%g3	! record sign of result in sign of %g3
@@ -324,7 +324,6 @@
 got_result:
 	tst	%g3
 	bge	1f
-	restore
 	! answer < 0
 	retl				! leaf-routine return
 	neg	%o2,%o0			! quotient <- -%o2

Attachment: pgpgAxSRLGCYC.pgp
Description: PGP signature

Reply via email to