[Mesa-dev] [PATCH 2/6] mesa: replace _XFORMAPI with _ASMAPI

Brian Paul brianp at vmware.com
Tue Mar 10 18:43:57 PDT 2015


First step to simplifying _ASMAPI cdecl wrapper macros.
Don't bother checking USE_X86_ASM.  Just use the cdecl tag all the time
as we do in gallium.
---
 src/mesa/math/m_clip_tmp.h  |  8 +++----
 src/mesa/math/m_norm_tmp.h  | 18 +++++++-------
 src/mesa/math/m_xform.h     | 14 +++--------
 src/mesa/math/m_xform_tmp.h | 58 ++++++++++++++++++++++-----------------------
 4 files changed, 45 insertions(+), 53 deletions(-)

diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h
index 45dec47..9a07c84 100644
--- a/src/mesa/math/m_clip_tmp.h
+++ b/src/mesa/math/m_clip_tmp.h
@@ -40,7 +40,7 @@
  * \param andMask bitwise-AND of clipMask values
  * \return proj_vec pointer
  */
-static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
+static GLvector4f * _ASMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
                                                      GLvector4f *proj_vec,
                                                      GLubyte clipMask[],
                                                      GLubyte *orMask,
@@ -120,7 +120,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec,
  * \param andMask bitwise-AND of clipMask values
  * \return clip_vec pointer
  */
-static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec,
+static GLvector4f * _ASMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec,
 							GLvector4f *proj_vec,
 							GLubyte clipMask[],
 							GLubyte *orMask,
@@ -177,7 +177,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec,
 }
 
 
-static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
+static GLvector4f * _ASMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
                                                      GLvector4f *proj_vec,
                                                      GLubyte clipMask[],
                                                      GLubyte *orMask,
@@ -213,7 +213,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec,
 }
 
 
-static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec,
+static GLvector4f * _ASMAPI TAG(cliptest_points2)( GLvector4f *clip_vec,
                                                      GLvector4f *proj_vec,
                                                      GLubyte clipMask[],
                                                      GLubyte *orMask,
diff --git a/src/mesa/math/m_norm_tmp.h b/src/mesa/math/m_norm_tmp.h
index c8fab0e..163679b 100644
--- a/src/mesa/math/m_norm_tmp.h
+++ b/src/mesa/math/m_norm_tmp.h
@@ -39,7 +39,7 @@
  *           optimization)
  * dest - the destination vector of normals
  */
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_normalize_normals)( const GLmatrix *mat,
                                   GLfloat scale,
                                   const GLvector4f *in,
@@ -106,7 +106,7 @@ TAG(transform_normalize_normals)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
                                          GLfloat scale,
                                          const GLvector4f *in,
@@ -171,7 +171,7 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
                                        GLfloat scale,
                                        const GLvector4f *in,
@@ -200,7 +200,7 @@ TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_rescale_normals)( const GLmatrix *mat,
                                 GLfloat scale,
                                 const GLvector4f *in,
@@ -232,7 +232,7 @@ TAG(transform_rescale_normals)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_normals_no_rot)( const GLmatrix *mat,
 			       GLfloat scale,
 			       const GLvector4f *in,
@@ -262,7 +262,7 @@ TAG(transform_normals_no_rot)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_normals)( const GLmatrix *mat,
                         GLfloat scale,
                         const GLvector4f *in,
@@ -292,7 +292,7 @@ TAG(transform_normals)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(normalize_normals)( const GLmatrix *mat,
                         GLfloat scale,
                         const GLvector4f *in,
@@ -338,7 +338,7 @@ TAG(normalize_normals)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(rescale_normals)( const GLmatrix *mat,
                       GLfloat scale,
                       const GLvector4f *in,
@@ -361,7 +361,7 @@ TAG(rescale_normals)( const GLmatrix *mat,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(init_c_norm_transform)( void )
 {
    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h
index 2ed62e7..3ac2211 100644
--- a/src/mesa/math/m_xform.h
+++ b/src/mesa/math/m_xform.h
@@ -32,14 +32,6 @@
 #include "math/m_matrix.h"
 #include "math/m_vector.h"
 
-#ifdef USE_X86_ASM
-#define _XFORMAPI _ASMAPI
-#define _XFORMAPIP _ASMAPIP
-#else
-#define _XFORMAPI
-#define _XFORMAPIP *
-#endif
-
 
 extern void
 _math_init_transformation(void);
@@ -99,7 +91,7 @@ init_c_cliptest(void);
 #define CLIP_FRUSTUM_BITS    0x3f
 
 
-typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip,
+typedef GLvector4f * (_ASMAPIP clip_func)( GLvector4f *vClip,
 					     GLvector4f *vProj,
 					     GLubyte clipMask[],
 					     GLubyte *orMask,
@@ -119,7 +111,7 @@ typedef void (*vec_copy_func)( GLvector4f *to,
 /*
  * Functions for transformation of normals in the VB.
  */
-typedef void (_XFORMAPIP normal_func)( const GLmatrix *mat,
+typedef void (_ASMAPIP normal_func)( const GLmatrix *mat,
 				      GLfloat scale,
 				      const GLvector4f *in,
 				      const GLfloat lengths[],
@@ -141,7 +133,7 @@ typedef void (_XFORMAPIP normal_func)( const GLmatrix *mat,
  *     when the mask byte is zero.  This is always present as a
  *     parameter, to allow a unified interface.
  */
-typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
+typedef void (_ASMAPIP transform_func)( GLvector4f *to_vec,
 					  const GLfloat m[16],
 					  const GLvector4f *from_vec );
 
diff --git a/src/mesa/math/m_xform_tmp.h b/src/mesa/math/m_xform_tmp.h
index 8886c96..089dc78 100644
--- a/src/mesa/math/m_xform_tmp.h
+++ b/src/mesa/math/m_xform_tmp.h
@@ -70,7 +70,7 @@
  *     driver-specific vertex format.
  */
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_general)( GLvector4f *to_vec,
 				const GLfloat m[16],
 				const GLvector4f *from_vec )
@@ -96,7 +96,7 @@ TAG(transform_points1_general)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_identity)( GLvector4f *to_vec,
 				 const GLfloat m[16],
 				 const GLvector4f *from_vec )
@@ -116,7 +116,7 @@ TAG(transform_points1_identity)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_2d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -138,7 +138,7 @@ TAG(transform_points1_2d)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -159,7 +159,7 @@ TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_3d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -183,7 +183,7 @@ TAG(transform_points1_3d)( GLvector4f *to_vec,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -206,7 +206,7 @@ TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points1_perspective)( GLvector4f *to_vec,
 				    const GLfloat m[16],
 				    const GLvector4f *from_vec )
@@ -236,7 +236,7 @@ TAG(transform_points1_perspective)( GLvector4f *to_vec,
  * present early in the geometry pipeline and throughout the
  * texture pipeline.
  */
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_general)( GLvector4f *to_vec,
 				const GLfloat m[16],
 				const GLvector4f *from_vec )
@@ -262,7 +262,7 @@ TAG(transform_points2_general)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_identity)( GLvector4f *to_vec,
 				 const GLfloat m[16],
 				 const GLvector4f *from_vec )
@@ -283,7 +283,7 @@ TAG(transform_points2_identity)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_2d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -305,7 +305,7 @@ TAG(transform_points2_2d)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -326,7 +326,7 @@ TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_3d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -353,7 +353,7 @@ TAG(transform_points2_3d)( GLvector4f *to_vec,
 /* I would actually say this was a fairly important function, from
  * a texture transformation point of view.
  */
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -382,7 +382,7 @@ TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
 }
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points2_perspective)( GLvector4f *to_vec,
 				    const GLfloat m[16],
 				    const GLvector4f *from_vec )
@@ -407,7 +407,7 @@ TAG(transform_points2_perspective)( GLvector4f *to_vec,
 
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_general)( GLvector4f *to_vec,
 				const GLfloat m[16],
 				const GLvector4f *from_vec )
@@ -433,7 +433,7 @@ TAG(transform_points3_general)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_identity)( GLvector4f *to_vec,
 				 const GLfloat m[16],
 				 const GLvector4f *from_vec )
@@ -455,7 +455,7 @@ TAG(transform_points3_identity)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_2d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -478,7 +478,7 @@ TAG(transform_points3_2d)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -500,7 +500,7 @@ TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_3d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -526,7 +526,7 @@ TAG(transform_points3_3d)( GLvector4f *to_vec,
 
 /* previously known as ortho...
  */
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -549,7 +549,7 @@ TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points3_perspective)( GLvector4f *to_vec,
 				    const GLfloat m[16],
 				    const GLvector4f *from_vec )
@@ -575,7 +575,7 @@ TAG(transform_points3_perspective)( GLvector4f *to_vec,
 
 
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_general)( GLvector4f *to_vec,
 				const GLfloat m[16],
 				const GLvector4f *from_vec )
@@ -601,7 +601,7 @@ TAG(transform_points4_general)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_identity)( GLvector4f *to_vec,
 				 const GLfloat m[16],
 				 const GLvector4f *from_vec )
@@ -624,7 +624,7 @@ TAG(transform_points4_identity)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_2d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -648,7 +648,7 @@ TAG(transform_points4_2d)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -671,7 +671,7 @@ TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_3d)( GLvector4f *to_vec,
 			   const GLfloat m[16],
 			   const GLvector4f *from_vec )
@@ -696,7 +696,7 @@ TAG(transform_points4_3d)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
 				  const GLfloat m[16],
 				  const GLvector4f *from_vec )
@@ -720,7 +720,7 @@ TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
    to_vec->count = from_vec->count;
 }
 
-static void _XFORMAPI
+static void _ASMAPI
 TAG(transform_points4_perspective)( GLvector4f *to_vec,
 				    const GLfloat m[16],
 				    const GLvector4f *from_vec )
@@ -753,7 +753,7 @@ static transform_func TAG(transform_tab_4)[7];
  * optimized routines overwriting the arrays.  This only occurs during
  * startup.
  */
-static void _XFORMAPI TAG(init_c_transformations)( void )
+static void _ASMAPI TAG(init_c_transformations)( void )
 {
 #define TAG_TAB   _mesa_transform_tab
 #define TAG_TAB_1 TAG(transform_tab_1)
-- 
1.9.1



More information about the mesa-dev mailing list