Stop using register %g7 since that is used by the "system" (ie. the pthread implementation makes use of it).
Also, the projection vector can be NULL and we shouldn't try to access it at all in _mesa_sparc_cliptest_points4_np(). ioquake3 would crash due to this bug. Finally, unconditionally emit the register directives and re-enable in _mesa_init_all_sparc_transform_asm(). Signed-off-by: David S. Miller <da...@davemloft.net> --- src/mesa/sparc/clip.S | 29 +++++++++-------------------- src/mesa/sparc/sparc.c | 4 ++-- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/mesa/sparc/clip.S b/src/mesa/sparc/clip.S index 58c228e..208843c 100644 --- a/src/mesa/sparc/clip.S +++ b/src/mesa/sparc/clip.S @@ -25,12 +25,8 @@ #define VEC_SIZE_3 7 #define VEC_SIZE_4 15 -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) - /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch - .register %g7, #scratch -#endif .text .align 64 @@ -78,7 +74,7 @@ _mesa_sparc_cliptest_points4: add %g1, 0x4, %g1 ld [%i0 + V4F_STRIDE], %l1 - ld [%i0 + V4F_COUNT], %g7 + ld [%i0 + V4F_COUNT], %l3 LDPTR [%i0 + V4F_START], %i0 LDPTR [%i1 + V4F_START], %i5 ldub [%i3], %g2 @@ -91,12 +87,12 @@ _mesa_sparc_cliptest_points4: st %g3, [%i1 + V4F_FLAGS] mov 3, %g3 st %g3, [%i1 + V4F_SIZE] - st %g7, [%i1 + V4F_COUNT] + st %l3, [%i1 + V4F_COUNT] clr %l2 clr %l0 /* l0: i - * g7: count + * l3: count * l1: stride * l2: c * g2: (tmpAndMask << 8) | tmpOrMask @@ -153,12 +149,12 @@ _mesa_sparc_cliptest_points4: 3: add %i5, 0x10, %i5 ! IEU1 add %l0, 1, %l0 ! IEU0 Group add %i2, 1, %i2 ! IEU0 Group - cmp %l0, %g7 ! IEU1 Group + cmp %l0, %l3 ! IEU1 Group bne 1b ! CTI add %i0, %l1, %i0 ! IEU0 Group stb %g2, [%i3] ! LSU srl %g2, 8, %g3 ! IEU0 Group - cmp %l2, %g7 ! IEU1 Group + cmp %l2, %l3 ! IEU1 Group bl,a 1f ! CTI clr %g3 ! IEU0 1: stb %g3, [%i4] ! LSU Group @@ -174,25 +170,18 @@ _mesa_sparc_cliptest_points4_np: add %g1, 0x4, %g1 ld [%i0 + V4F_STRIDE], %l1 - ld [%i0 + V4F_COUNT], %g7 + ld [%i0 + V4F_COUNT], %l3 LDPTR [%i0 + V4F_START], %i0 - LDPTR [%i1 + V4F_START], %i5 ldub [%i3], %g2 ldub [%i4], %g3 sll %g3, 8, %g3 or %g2, %g3, %g2 - ld [%i1 + V4F_FLAGS], %g3 - or %g3, VEC_SIZE_4, %g3 - st %g3, [%i1 + V4F_FLAGS] - mov 3, %g3 - st %g3, [%i1 + V4F_SIZE] - st %g7, [%i1 + V4F_COUNT] clr %l2 clr %l0 /* l0: i - * g7: count + * l3: count * l1: stride * l2: c * g2: (tmpAndMask << 8) | tmpOrMask @@ -230,12 +219,12 @@ _mesa_sparc_cliptest_points4_np: and %g2, %g4, %g2 ! IEU0 Group 2: add %l0, 1, %l0 ! IEU0 Group add %i2, 1, %i2 ! IEU0 Group - cmp %l0, %g7 ! IEU1 Group + cmp %l0, %l3 ! IEU1 Group bne 1b ! CTI add %i0, %l1, %i0 ! IEU0 Group stb %g2, [%i3] ! LSU srl %g2, 8, %g3 ! IEU0 Group - cmp %l2, %g7 ! IEU1 Group + cmp %l2, %l3 ! IEU1 Group bl,a 1f ! CTI clr %g3 ! IEU0 1: stb %g3, [%i4] ! LSU Group diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index 3bde98e..fafb49b 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -109,10 +109,10 @@ void _mesa_init_all_sparc_transform_asm(void) ASSIGN_XFORM_GROUP(sparc, 2) ASSIGN_XFORM_GROUP(sparc, 3) ASSIGN_XFORM_GROUP(sparc, 4) -#if 0 + _mesa_clip_tab[4] = _mesa_sparc_cliptest_points4; _mesa_clip_np_tab[4] = _mesa_sparc_cliptest_points4_np; -#endif + #if 0 /* disable these too. See bug 673938 */ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = -- 1.6.1.2.253.ga34a ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev