3dnow normalize_normals broken, disable
[mesa.git] / src / mesa / x86 / 3dnow.c
1 /* $Id: 3dnow.c,v 1.20 2001/11/19 13:52:41 keithw Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
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:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
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.
25 */
26
27 /*
28 * 3DNow! optimizations contributed by
29 * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de>
30 */
31
32 #include "glheader.h"
33 #include "context.h"
34 #include "math/m_vertices.h"
35 #include "math/m_xform.h"
36 #include "tnl/t_context.h"
37
38 #include "3dnow.h"
39 #include "common_x86_macros.h"
40
41 #ifdef DEBUG
42 #include "math/m_debug.h"
43 #endif
44
45
46 #ifdef USE_3DNOW_ASM
47 DECLARE_XFORM_GROUP( 3dnow, 2 )
48 DECLARE_XFORM_GROUP( 3dnow, 3 )
49 DECLARE_XFORM_GROUP( 3dnow, 4 )
50
51 DECLARE_NORM_GROUP( 3dnow )
52
53
54 extern void _ASMAPI
55 _mesa_v16_3dnow_general_xform( GLfloat *first_vert,
56 const GLfloat *m,
57 const GLfloat *src,
58 GLuint src_stride,
59 GLuint count );
60
61 extern void _ASMAPI
62 _mesa_3dnow_project_vertices( GLfloat *first,
63 GLfloat *last,
64 const GLfloat *m,
65 GLuint stride );
66
67 extern void _ASMAPI
68 _mesa_3dnow_project_clipped_vertices( GLfloat *first,
69 GLfloat *last,
70 const GLfloat *m,
71 GLuint stride,
72 const GLubyte *clipmask );
73 #endif
74
75
76 void _mesa_init_3dnow_transform_asm( void )
77 {
78 #ifdef USE_3DNOW_ASM
79 ASSIGN_XFORM_GROUP( 3dnow, 2 );
80 ASSIGN_XFORM_GROUP( 3dnow, 3 );
81 ASSIGN_XFORM_GROUP( 3dnow, 4 );
82
83 /* Normalize_normals is broken - disable
84 */
85 /* ASSIGN_NORM_GROUP( 3dnow ); */
86
87 #ifdef DEBUG
88 _math_test_all_transform_functions( "3DNow!" );
89 _math_test_all_normal_transform_functions( "3DNow!" );
90 #endif
91 #endif
92 }
93
94 void _mesa_init_3dnow_vertex_asm( void )
95 {
96 #ifdef USE_3DNOW_ASM
97 _mesa_xform_points3_v16_general = _mesa_v16_3dnow_general_xform;
98
99 _mesa_project_v16 = _mesa_3dnow_project_vertices;
100 _mesa_project_clipped_v16 = _mesa_3dnow_project_clipped_vertices;
101
102 #ifdef DEBUG_NOT
103 _math_test_all_vertex_functions( "3DNow!" );
104 #endif
105 #endif
106 }