summaryrefslogtreecommitdiffstats
path: root/src/mesa/math/m_debug_norm.c
diff options
context:
space:
mode:
authorGareth Hughes <[email protected]>2001-03-29 06:46:15 +0000
committerGareth Hughes <[email protected]>2001-03-29 06:46:15 +0000
commit1b2fef5c28a40cd001598071e25b876ad4fccdd1 (patch)
tree03d5dd8385ddfc5ad18b4e02f1de6533e202c3a5 /src/mesa/math/m_debug_norm.c
parent8e48a232fe48e4b6855cecb1d02363fb142365ae (diff)
Consolidation of asm code in 3.5
Diffstat (limited to 'src/mesa/math/m_debug_norm.c')
-rw-r--r--src/mesa/math/m_debug_norm.c78
1 files changed, 23 insertions, 55 deletions
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c
index a6f0cb76a75..45532475b3a 100644
--- a/src/mesa/math/m_debug_norm.c
+++ b/src/mesa/math/m_debug_norm.c
@@ -1,4 +1,4 @@
-/* $Id: m_debug_norm.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */
+/* $Id: m_debug_norm.c,v 1.6 2001/03/29 06:46:27 gareth Exp $ */
/*
* Mesa 3-D graphics library
@@ -186,8 +186,7 @@ static void ref_norm_transform_normalize( const GLmatrix *mat,
* Normal transformation tests
*/
-static int test_norm_function( normal_func func, int mtype,
- int masked, long *cycles )
+static int test_norm_function( normal_func func, int mtype, long *cycles )
{
GLvector3f source[1], dest[1], dest2[1], ref[1], ref2[1];
GLmatrix mat[1];
@@ -195,7 +194,6 @@ static int test_norm_function( normal_func func, int mtype,
GLfloat d2[TEST_COUNT][3], r2[TEST_COUNT][3], length[TEST_COUNT];
GLfloat scale;
GLfloat *m;
- GLubyte mask[TEST_COUNT];
int i, j;
#ifdef RUN_DEBUG_BENCHMARK
int cycle_i; /* the counter for the benchmarks we run */
@@ -231,7 +229,6 @@ static int test_norm_function( normal_func func, int mtype,
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
- mask[i] = i % 2; /* mask every 2nd element */
ASSIGN_3V( d[i], 0.0, 0.0, 0.0 );
ASSIGN_3V( s[i], 0.0, 0.0, 0.0 );
ASSIGN_3V( d2[i], 0.0, 0.0, 0.0 );
@@ -278,31 +275,16 @@ static int test_norm_function( normal_func func, int mtype,
}
if ( mesa_profile ) {
- if ( masked ) {
- BEGIN_RACE( *cycles );
- func( mat, scale, source, NULL, mask, dest );
- END_RACE( *cycles );
- func( mat, scale, source, length, mask, dest2 );
- } else {
- BEGIN_RACE( *cycles );
- func( mat, scale, source, NULL, NULL, dest );
- END_RACE( *cycles );
- func( mat, scale, source, length, NULL, dest2 );
- }
+ BEGIN_RACE( *cycles );
+ func( mat, scale, source, NULL, NULL, dest );
+ END_RACE( *cycles );
+ func( mat, scale, source, length, NULL, dest2 );
} else {
- if ( masked ) {
- func( mat, scale, source, NULL, mask, dest );
- func( mat, scale, source, length, mask, dest2 );
- } else {
- func( mat, scale, source, NULL, NULL, dest );
- func( mat, scale, source, length, NULL, dest2 );
- }
+ func( mat, scale, source, NULL, NULL, dest );
+ func( mat, scale, source, length, NULL, dest2 );
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
- if ( masked && !(mask[i] & 1) )
- continue;
-
for ( j = 0 ; j < 3 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
printf( "-----------------------------\n" );
@@ -344,7 +326,6 @@ static int test_norm_function( normal_func func, int mtype,
void _math_test_all_normal_transform_functions( char *description )
{
- int masked;
int mtype;
long benchmark_tab[0xf][0x4];
static int first_time = 1;
@@ -362,46 +343,33 @@ void _math_test_all_normal_transform_functions( char *description )
}
printf( "normal transform results after hooking in %s functions:\n",
description );
+ printf( "\n-------------------------------------------------------\n" );
}
#endif
- for ( masked = 0 ; masked <= 1 ; masked++ ) {
- int cma = masked ? 1 : 0;
- char *cmastring = masked ? "CULL_MASK_ACTIVE" : "0";
+ for ( mtype = 0 ; mtype < 8 ; mtype++ ) {
+ normal_func func = _mesa_normal_tab[norm_types[mtype]][0];
+ long *cycles = &(benchmark_tab[mtype][0]);
-#ifdef RUN_DEBUG_BENCHMARK
- if ( mesa_profile ) {
- printf( "\n culling: %s \n", masked ? "CULL_MASK_ACTIVE" : "0" );
- printf( "\n-------------------------------------------------------\n" );
+ if ( test_norm_function( func, mtype, cycles ) == 0 ) {
+ char buf[100];
+ sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
+ norm_strings[mtype], description );
+ _mesa_problem( NULL, buf );
}
-#endif
-
- for ( mtype = 0 ; mtype < 8 ; mtype++ ) {
- normal_func func = _mesa_normal_tab[norm_types[mtype]][cma];
- long *cycles = &(benchmark_tab[mtype][cma]);
-
- if ( test_norm_function( func, mtype, masked, cycles ) == 0 ) {
- char buf[100];
- sprintf( buf, "_mesa_normal_tab[%s][%s] failed test (%s)",
- cmastring, norm_strings[mtype], description );
- _mesa_problem( NULL, buf );
- }
#ifdef RUN_DEBUG_BENCHMARK
- if ( mesa_profile ) {
- printf( " %li\t", benchmark_tab[mtype][cma] );
- printf( " | [%s]\n", norm_strings[mtype] );
- }
- }
- if ( mesa_profile )
- printf( "\n" );
-#else
+ if ( mesa_profile ) {
+ printf( " %li\t", benchmark_tab[mtype][0] );
+ printf( " | [%s]\n", norm_strings[mtype] );
}
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
- if ( mesa_profile )
+ if ( mesa_profile ) {
+ printf( "\n" );
fflush( stdout );
+ }
#endif
}