diff options
author | Gareth Hughes <[email protected]> | 2001-03-29 06:46:15 +0000 |
---|---|---|
committer | Gareth Hughes <[email protected]> | 2001-03-29 06:46:15 +0000 |
commit | 1b2fef5c28a40cd001598071e25b876ad4fccdd1 (patch) | |
tree | 03d5dd8385ddfc5ad18b4e02f1de6533e202c3a5 /src/mesa/x86/3dnow.c | |
parent | 8e48a232fe48e4b6855cecb1d02363fb142365ae (diff) |
Consolidation of asm code in 3.5
Diffstat (limited to 'src/mesa/x86/3dnow.c')
-rw-r--r-- | src/mesa/x86/3dnow.c | 131 |
1 files changed, 61 insertions, 70 deletions
diff --git a/src/mesa/x86/3dnow.c b/src/mesa/x86/3dnow.c index b6ef3739361..821a33d76cd 100644 --- a/src/mesa/x86/3dnow.c +++ b/src/mesa/x86/3dnow.c @@ -1,4 +1,4 @@ -/* $Id: 3dnow.c,v 1.17 2001/03/28 20:44:43 gareth Exp $ */ +/* $Id: 3dnow.c,v 1.18 2001/03/29 06:46:15 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -51,31 +51,31 @@ const GLubyte flag -#define DECLARE_XFORM_GROUP( pfx, sz, masked ) \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot_##masked( XFORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_##masked( XFORM_ARGS ); +#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, cma, sz, masked ) \ - _mesa_transform_tab[cma][sz][MATRIX_GENERAL] = \ - _mesa_##pfx##_transform_points##sz##_general_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_IDENTITY] = \ - _mesa_##pfx##_transform_points##sz##_identity_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_3D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_3d_no_rot_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_PERSPECTIVE] = \ - _mesa_##pfx##_transform_points##sz##_perspective_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_2D] = \ - _mesa_##pfx##_transform_points##sz##_2d_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_2D_NO_ROT] = \ - _mesa_##pfx##_transform_points##sz##_2d_no_rot_##masked; \ - _mesa_transform_tab[cma][sz][MATRIX_3D] = \ - _mesa_##pfx##_transform_points##sz##_3d_##masked; +#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; @@ -87,47 +87,42 @@ extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_##masked( XFORM_ARGS GLvector3f *dest -#define DECLARE_NORM_GROUP( pfx, masked ) \ -extern void _ASMAPI _mesa_##pfx##_rescale_normals_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_normalize_normals_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normals_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_##masked( NORM_ARGS ); \ -extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot_##masked( NORM_ARGS ); - - -#define ASSIGN_NORM_GROUP( pfx, cma, masked ) \ - _mesa_normal_tab[NORM_RESCALE][cma] = \ - _mesa_##pfx##_rescale_normals_##masked; \ - _mesa_normal_tab[NORM_NORMALIZE][cma] = \ - _mesa_##pfx##_normalize_normals_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM][cma] = \ - _mesa_##pfx##_transform_normals_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][cma] = \ - _mesa_##pfx##_transform_normals_no_rot_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][cma] = \ - _mesa_##pfx##_transform_rescale_normals_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][cma] = \ - _mesa_##pfx##_transform_rescale_normals_no_rot_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][cma] = \ - _mesa_##pfx##_transform_normalize_normals_##masked; \ - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][cma] = \ - _mesa_##pfx##_transform_normalize_normals_no_rot_##masked; +#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_3DNOW_ASM -DECLARE_XFORM_GROUP( 3dnow, 2, raw ) -DECLARE_XFORM_GROUP( 3dnow, 3, raw ) -DECLARE_XFORM_GROUP( 3dnow, 4, raw ) +DECLARE_XFORM_GROUP( 3dnow, 2 ) +DECLARE_XFORM_GROUP( 3dnow, 3 ) +DECLARE_XFORM_GROUP( 3dnow, 4 ) -DECLARE_XFORM_GROUP( 3dnow, 2, masked ) -DECLARE_XFORM_GROUP( 3dnow, 3, masked ) -DECLARE_XFORM_GROUP( 3dnow, 4, masked ) - -DECLARE_NORM_GROUP( 3dnow, raw ) -/*DECLARE_NORM_GROUP( 3dnow, masked )*/ +DECLARE_NORM_GROUP( 3dnow ) extern void _ASMAPI @@ -155,16 +150,11 @@ _mesa_3dnow_project_clipped_vertices( GLfloat *first, void _mesa_init_3dnow_transform_asm( void ) { #ifdef USE_3DNOW_ASM - ASSIGN_XFORM_GROUP( 3dnow, 0, 2, raw ); - ASSIGN_XFORM_GROUP( 3dnow, 0, 3, raw ); - ASSIGN_XFORM_GROUP( 3dnow, 0, 4, raw ); - -/* ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 2, masked ); */ -/* ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 3, masked ); */ -/* ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 4, masked ); */ + ASSIGN_XFORM_GROUP( 3dnow, 2 ); + ASSIGN_XFORM_GROUP( 3dnow, 3 ); + ASSIGN_XFORM_GROUP( 3dnow, 4 ); - ASSIGN_NORM_GROUP( 3dnow, 0, raw ); -/* ASSIGN_NORM_GROUP( 3dnow, CULL_MASK_ACTIVE, masked ); */ + ASSIGN_NORM_GROUP( 3dnow ); #ifdef DEBUG _math_test_all_transform_functions( "3DNow!" ); @@ -177,6 +167,7 @@ void _mesa_init_3dnow_vertex_asm( void ) { #ifdef USE_3DNOW_ASM _mesa_xform_points3_v16_general = _mesa_v16_3dnow_general_xform; + _mesa_project_v16 = _mesa_3dnow_project_vertices; _mesa_project_clipped_v16 = _mesa_3dnow_project_clipped_vertices; |