svn commit: r230025 - head/contrib/compiler-rt/lib/sparc64

Marius Strobl marius at
Tue Jan 17 17:22:20 UTC 2012

On Tue, Jan 17, 2012 at 03:55:05PM +0100, Ed Schouten wrote:
> Hi Marius,
> * Marius Strobl <marius at>, 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?

Index: divmod.m4
--- divmod.m4	(revision 230265)
+++ divmod.m4	(working copy)
@@ -235,7 +236,6 @@
 	tst	SIGN
 	bge	1f
-	restore
 	! answer < 0
 	retl				! leaf-routine return
 ifelse( ANSWER, `quotient',

Sorry, on closer inspection you cannot just litteraly remove the
restore in this case. The problem is that both bge and retl are
delayed control-transfer instructions and the restore is done in
the delay slot of the bge, which means it's actually execetuted
before the branch (in FreeBSD source we usually mark this via an
additional space character before the instruction in a delay slot
so it's easier to spot). If you just remove the restore retl is
now in the delay slot of bge, which gives wrong behavior. You
therefore either need to replace it with a nop or you can actually
take advantage of the delay slots like done in the attached patch


-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparc.diff
Type: text/x-diff
Size: 2376 bytes
Desc: not available
Url :

More information about the svn-src-all mailing list