i965: Don't calculate masks of used FS inputs
[mesa.git] / src / mesa / math / m_debug_norm.c
index 11cae6bba7a5e89482243204952b2c3c13f75588..02eb1f989f6d0afe2d91470f0d7c9da5793d1960 100644 (file)
  *    Gareth Hughes
  */
 
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
 
 #include "m_matrix.h"
 #include "m_xform.h"
@@ -208,7 +208,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
 
    (void) cycles;
 
-   mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+   mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
    mat->inv = m = mat->m;
 
    init_matrix( m );
@@ -230,7 +230,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
          case VAR:
             break;
          default:
-            _mesa_exit(1);
+            exit(1);
          }
       }
    }
@@ -294,15 +294,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
    for ( i = 0 ; i < TEST_COUNT ; i++ ) {
       for ( j = 0 ; j < 3 ; j++ ) {
          if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
-            _mesa_printf( "-----------------------------\n" );
-            _mesa_printf( "(i = %i, j = %i)\n", i, j );
-            _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            printf( "-----------------------------\n" );
+            printf( "(i = %i, j = %i)\n", i, j );
+            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                    d[i][0], r[i][0], r[i][0]/d[i][0],
                    MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
-            _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                    d[i][1], r[i][1], r[i][1]/d[i][1],
                    MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
-            _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+            printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                    d[i][2], r[i][2], r[i][2]/d[i][2],
                    MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
             return 0;
@@ -310,15 +310,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
 
          if ( norm_normalize_types[mtype] != 0 ) {
             if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) {
-               _mesa_printf( "------------------- precalculated length case ------\n" );
-               _mesa_printf( "(i = %i, j = %i)\n", i, j );
-               _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               printf( "------------------- precalculated length case ------\n" );
+               printf( "(i = %i, j = %i)\n", i, j );
+               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                       d2[i][0], r2[i][0], r2[i][0]/d2[i][0],
                       MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) );
-               _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                       d2[i][1], r2[i][1], r2[i][1]/d2[i][1],
                       MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) );
-               _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+               printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
                       d2[i][2], r2[i][2], r2[i][2]/d2[i][2],
                       MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) );
                return 0;
@@ -327,7 +327,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles )
       }
    }
 
-   ALIGN_FREE( mat->m );
+   _mesa_align_free( mat->m );
    return 1;
 }
 
@@ -346,11 +346,11 @@ void _math_test_all_normal_transform_functions( char *description )
    if ( mesa_profile ) {
       if ( !counter_overhead ) {
         INIT_COUNTER();
-        _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+        printf( "counter overhead: %ld cycles\n\n", counter_overhead );
       }
-      _mesa_printf( "normal transform results after hooking in %s functions:\n",
+      printf( "normal transform results after hooking in %s functions:\n",
              description );
-      _mesa_printf( "\n-------------------------------------------------------\n" );
+      printf( "\n-------------------------------------------------------\n" );
    }
 #endif
 
@@ -360,21 +360,21 @@ void _math_test_all_normal_transform_functions( char *description )
 
       if ( test_norm_function( func, mtype, cycles ) == 0 ) {
         char buf[100];
-        _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
+        sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
                  norm_strings[mtype], description );
-        _mesa_problem( NULL, buf );
+        _mesa_problem( NULL, "%s", buf );
       }
 
 #ifdef RUN_DEBUG_BENCHMARK
       if ( mesa_profile ) {
-        _mesa_printf( " %li\t", benchmark_tab[mtype] );
-        _mesa_printf( " | [%s]\n", norm_strings[mtype] );
+        printf( " %li\t", benchmark_tab[mtype] );
+        printf( " | [%s]\n", norm_strings[mtype] );
       }
 #endif
    }
 #ifdef RUN_DEBUG_BENCHMARK
    if ( mesa_profile ) {
-      _mesa_printf( "\n" );
+      printf( "\n" );
    }
 #endif
 }