Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2012 15:55:05 +0100
From:      Ed Schouten <ed@80386.nl>
To:        Marius Strobl <marius@alchemy.franken.de>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r230025 - head/contrib/compiler-rt/lib/sparc64
Message-ID:  <20120117145505.GG95413@hoeg.nl>
In-Reply-To: <20120113000057.GA23960@alchemy.franken.de>
References:  <201201121755.q0CHtMA2020344@svn.freebsd.org> <20120113000057.GA23960@alchemy.franken.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--tcC6YSqBgqqkz7Sb
Content-Type: multipart/mixed; boundary="L+ofChggJdETEG3Y"
Content-Disposition: inline


--L+ofChggJdETEG3Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Marius,

* Marius Strobl <marius@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,
--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--L+ofChggJdETEG3Y
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="sparc.diff"
Content-Transfer-Encoding: quoted-printable

Index: modsi3.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- divmod.m4	(revision 230265)
+++ divmod.m4	(working copy)
@@ -59,9 +59,6 @@
=20
 #include "../assembly.h"
=20
-.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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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

--L+ofChggJdETEG3Y--

--tcC6YSqBgqqkz7Sb
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iQIcBAEBAgAGBQJPFYvJAAoJEG5e2P40kaK7ZiYP+QHf/DB6spR/Fxhn6r52JOc1
7JM452dFYQfZM6FiQr3t7+u2yJwswq5ioySRCXUlFAAbSLtCM0K8l0yFNRpEh+gh
uMS0/JCbjA4vvAtDeZVceCrmExoVR+tQ/r/bUUbPlKIDMEzWjtTi4uB/KhKkleGC
i3BKpaL5PDnAxOzzz9EqnD250DNLm+GVohebaFbyt6QDO/tJADJJkR6EiWLpk2zg
Ud1atyEEJy3Gt5++Npffv6uk4jly1xIqLvv/g3iXpH0murO8gdwu7v38UdOFTUWz
PszwaO5rq2WzlqutXEef0U+1CieEzyXFYXA44kvW8q9wt4TWmjJxtaoqDYNPbC3k
61/shM17YZ4Th1k0RNt4eGGhLQnQJUo/WIIuL/4bqDmGNF+P1aAVBxqnDmGuXqCI
BZGdZKQFdTFTPvyp6BGOvlBVEcnJu36JerzlR503AVfCaMXftz6533mae+H28oij
KgALguNzIbe/saVzFxZ0YFjt+i/GKdsQolUrKC0ysrgbM93khWbIfYKiF2uUf2zW
TeGgPB9Zjpi/0BGezgALRFEsLpA6JaR9YJrooUaUFp2jfUIZUkQEs3k9h076USW8
vAugEWlTCE3BX/gI5UW2aorZYcEpnPU4CrS63EQ0EWuVAdJ7pRksAl9kCdxHesfE
9GOF0eA8Z5qlx4UQscF4
=4kjK
-----END PGP SIGNATURE-----

--tcC6YSqBgqqkz7Sb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120117145505.GG95413>