summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86/sse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/x86/sse.c')
-rw-r--r--src/mesa/x86/sse.c104
1 files changed, 16 insertions, 88 deletions
diff --git a/src/mesa/x86/sse.c b/src/mesa/x86/sse.c
index a986636edc7..bcabf5ca1da 100644
--- a/src/mesa/x86/sse.c
+++ b/src/mesa/x86/sse.c
@@ -1,4 +1,4 @@
-/* $Id: sse.c,v 1.1 2001/03/29 06:46:16 gareth Exp $ */
+/* $Id: sse.c,v 1.2 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
@@ -31,92 +31,18 @@
#include "glheader.h"
#include "context.h"
-#include "mtypes.h"
-#include "sse.h"
-
#include "math/m_vertices.h"
#include "math/m_xform.h"
-
#include "tnl/t_context.h"
+#include "sse.h"
+#include "common_x86_macros.h"
+
#ifdef DEBUG
#include "math/m_debug.h"
#endif
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec, \
- const GLubyte *mask, \
- const GLubyte flag
-
-
-#define DECLARE_XFORM_GROUP( pfx, sz ) \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
-
-
-#define ASSIGN_XFORM_GROUP( pfx, sz ) \
- _mesa_transform_tab[0][sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[0][sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[0][sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[0][sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[0][sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
-
-#define NORM_ARGS const GLmatrix *mat, \
- GLfloat scale, \
- const GLvector3f *in, \
- const GLfloat *lengths, \
- const GLubyte mask[], \
- GLvector3f *dest
-
-
-#define DECLARE_NORM_GROUP( pfx ) \
-extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
-
-
-#define ASSIGN_NORM_GROUP( pfx ) \
- _mesa_normal_tab[NORM_RESCALE][0] = \
- _mesa_##pfx##_rescale_normals; \
- _mesa_normal_tab[NORM_NORMALIZE][0] = \
- _mesa_##pfx##_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM][0] = \
- _mesa_##pfx##_transform_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][0] = \
- _mesa_##pfx##_transform_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals_no_rot;
-
-
#ifdef USE_SSE_ASM
DECLARE_XFORM_GROUP( sse, 2 )
DECLARE_XFORM_GROUP( sse, 3 )
@@ -166,20 +92,22 @@ void _mesa_init_sse_transform_asm( void )
#if 1
/* TODO: Finish these off.
*/
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][0] =
- _mesa_sse_transform_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM|NORM_RESCALE][0] =
- _mesa_sse_transform_rescale_normals;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_RESCALE][0] =
- _mesa_sse_transform_rescale_normals_no_rot;
-
- _mesa_transform_tab[0][4][MATRIX_GENERAL] =
+ _mesa_transform_tab[4][MATRIX_GENERAL] =
_mesa_sse_transform_points4_general;
- _mesa_transform_tab[0][4][MATRIX_3D] =
+ _mesa_transform_tab[4][MATRIX_3D] =
_mesa_sse_transform_points4_3d;
- _mesa_transform_tab[0][4][MATRIX_IDENTITY] =
+ _mesa_transform_tab[4][MATRIX_IDENTITY] =
_mesa_sse_transform_points4_identity;
+
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
+ _mesa_sse_transform_normals_no_rot;
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
+ _mesa_sse_transform_rescale_normals;
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
+ _mesa_sse_transform_rescale_normals_no_rot;
#else
+ ASSIGN_XFORM_GROUP( sse, 4 );
+
ASSIGN_NORM_GROUP( sse );
#endif