1 /* $Id: x86.c,v 1.2 1999/10/19 18:37:07 keithw Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Intel x86 assembly code by Josh Vanderhoof
43 extern void gl_v16_x86_cliptest_points4(GLfloat
*first_vert
,
50 extern void gl_v16_x86_general_xform(GLfloat
*dest
,
58 #define XFORM_ARGS GLvector4f *to_vec, \
59 const GLmatrix *mat, \
60 const GLvector4f *from_vec, \
61 const GLubyte *mask, \
64 #define DECLARE_XFORM_GROUP(pfx, vsize, masked) \
65 extern void gl_##pfx##_transform_points##vsize##_general_##masked(XFORM_ARGS); \
66 extern void gl_##pfx##_transform_points##vsize##_identity_##masked(XFORM_ARGS); \
67 extern void gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked(XFORM_ARGS); \
68 extern void gl_##pfx##_transform_points##vsize##_perspective_##masked(XFORM_ARGS); \
69 extern void gl_##pfx##_transform_points##vsize##_2d_##masked(XFORM_ARGS); \
70 extern void gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked(XFORM_ARGS); \
71 extern void gl_##pfx##_transform_points##vsize##_3d_##masked(XFORM_ARGS);
73 #define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked ) \
74 gl_transform_tab[cma][vsize][MATRIX_GENERAL] \
75 = gl_##pfx##_transform_points##vsize##_general_##masked; \
76 gl_transform_tab[cma][vsize][MATRIX_IDENTITY] \
77 = gl_##pfx##_transform_points##vsize##_identity_##masked; \
78 gl_transform_tab[cma][vsize][MATRIX_3D_NO_ROT] \
79 = gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked; \
80 gl_transform_tab[cma][vsize][MATRIX_PERSPECTIVE] \
81 = gl_##pfx##_transform_points##vsize##_perspective_##masked; \
82 gl_transform_tab[cma][vsize][MATRIX_2D] \
83 = gl_##pfx##_transform_points##vsize##_2d_##masked; \
84 gl_transform_tab[cma][vsize][MATRIX_2D_NO_ROT] \
85 = gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked; \
86 gl_transform_tab[cma][vsize][MATRIX_3D] \
87 = gl_##pfx##_transform_points##vsize##_3d_##masked;
89 void gl_init_x86_asm_transforms( void )
92 DECLARE_XFORM_GROUP( x86
, 2, raw
)
93 DECLARE_XFORM_GROUP( x86
, 3, raw
)
94 DECLARE_XFORM_GROUP( x86
, 4, raw
)
95 DECLARE_XFORM_GROUP( x86
, 2, masked
)
96 DECLARE_XFORM_GROUP( x86
, 3, masked
)
97 DECLARE_XFORM_GROUP( x86
, 4, masked
)
99 extern GLvector4f
*gl_x86_cliptest_points4( GLvector4f
*clip_vec
,
100 GLvector4f
*proj_vec
,
106 ASSIGN_XFORM_GROUP( x86
, 0, 2, raw
)
107 ASSIGN_XFORM_GROUP( x86
, 0, 3, raw
)
108 ASSIGN_XFORM_GROUP( x86
, 0, 4, raw
)
110 ASSIGN_XFORM_GROUP( x86
, CULL_MASK_ACTIVE
, 2, masked
)
111 ASSIGN_XFORM_GROUP( x86
, CULL_MASK_ACTIVE
, 3, masked
)
112 ASSIGN_XFORM_GROUP( x86
, CULL_MASK_ACTIVE
, 4, masked
)
114 gl_clip_tab
[4] = gl_x86_cliptest_points4
;
117 gl_test_all_transform_functions("x86");
121 gl_cliptest_points4_v16
= gl_v16_x86_cliptest_points4
;
122 gl_xform_points3_v16_general
= gl_v16_x86_general_xform
;