From cf89f063634ff89cbd732bf67950debc94897ed9 Mon Sep 17 00:00:00 2001 From: David Miller Date: Fri, 27 Feb 2009 02:38:40 -0800 Subject: [PATCH] mesa: Fix and re-enable sparc normal asm. Fix a bug reported in 2003 :-) The output vector has 4 entries, not 3. Unconditionally emit .register directives. Signed-off-by: David S. Miller --- src/mesa/sparc/norm.S | 25 +++++++++++-------------- src/mesa/sparc/sparc.c | 3 --- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/mesa/sparc/norm.S b/src/mesa/sparc/norm.S index 44950a10a5d..117d36fa223 100644 --- a/src/mesa/sparc/norm.S +++ b/src/mesa/sparc/norm.S @@ -1,11 +1,8 @@ #include "sparc_matrix.h" -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) - /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch -#endif .text @@ -98,7 +95,7 @@ _mesa_sparc_transform_normalize_normals: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer ba 7f nop @@ -154,7 +151,7 @@ _mesa_sparc_transform_normalize_normals: cmp %o4, %g1 ! continue if (i < count) bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -225,7 +222,7 @@ _mesa_sparc_transform_normalize_normals_no_rot: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer ba 7f nop @@ -263,7 +260,7 @@ _mesa_sparc_transform_normalize_normals_no_rot: cmp %o4, %g1 ! continue if (i < count) bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -314,7 +311,7 @@ _mesa_sparc_transform_rescale_normals_no_rot: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -379,7 +376,7 @@ _mesa_sparc_transform_rescale_normals: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -421,7 +418,7 @@ _mesa_sparc_transform_normals_no_rot: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -471,7 +468,7 @@ _mesa_sparc_transform_normals: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -529,7 +526,7 @@ _mesa_sparc_normalize_normals: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer ba 7f nop @@ -557,7 +554,7 @@ _mesa_sparc_normalize_normals: cmp %o4, %g1 ! continue if (i < count) bl 5b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop @@ -602,7 +599,7 @@ _mesa_sparc_rescale_normals: cmp %o4, %g1 ! continue if (i < count) bl 1b - add %g3, 0x0c, %g3 ! advance out vector pointer + add %g3, 0x10, %g3 ! advance out vector pointer 7: retl nop diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index fafb49b81cd..d2286a2c837 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -113,8 +113,6 @@ void _mesa_init_all_sparc_transform_asm(void) _mesa_clip_tab[4] = _mesa_sparc_cliptest_points4; _mesa_clip_np_tab[4] = _mesa_sparc_cliptest_points4_np; -#if 0 - /* disable these too. See bug 673938 */ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = _mesa_sparc_transform_normalize_normals; _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = @@ -131,7 +129,6 @@ void _mesa_init_all_sparc_transform_asm(void) _mesa_sparc_normalize_normals; _mesa_normal_tab[NORM_RESCALE] = _mesa_sparc_rescale_normals; -#endif #ifdef DEBUG_MATH _math_test_all_transform_functions("sparc"); -- 2.30.2