Subversion Repositories shark

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
57 pj 1
/* $Id: 3dnow.c,v 1.1 2003-02-28 11:49:38 pj Exp $ */
2
 
3
/*
4
 * Mesa 3-D graphics library
5
 * Version:  4.1
6
 *
7
 * Copyright (C) 1999-2002  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_xform.h"
35
#include "tnl/t_context.h"
36
 
37
#include "3dnow.h"
38
#include "common_x86_macros.h"
39
 
40
#ifdef DEBUG
41
#include "math/m_debug.h"
42
#endif
43
 
44
 
45
#ifdef USE_3DNOW_ASM
46
DECLARE_XFORM_GROUP( 3dnow, 2 )
47
DECLARE_XFORM_GROUP( 3dnow, 3 )
48
DECLARE_XFORM_GROUP( 3dnow, 4 )
49
 
50
DECLARE_NORM_GROUP( 3dnow )
51
 
52
 
53
extern void _ASMAPI
54
_mesa_v16_3dnow_general_xform( GLfloat *first_vert,
55
                               const GLfloat *m,
56
                               const GLfloat *src,
57
                               GLuint src_stride,
58
                               GLuint count );
59
 
60
extern void _ASMAPI
61
_mesa_3dnow_project_vertices( GLfloat *first,
62
                              GLfloat *last,
63
                              const GLfloat *m,
64
                              GLuint stride );
65
 
66
extern void _ASMAPI
67
_mesa_3dnow_project_clipped_vertices( GLfloat *first,
68
                                      GLfloat *last,
69
                                      const GLfloat *m,
70
                                      GLuint stride,
71
                                      const GLubyte *clipmask );
72
#endif
73
 
74
 
75
void _mesa_init_3dnow_transform_asm( void )
76
{
77
#ifdef USE_3DNOW_ASM
78
   ASSIGN_XFORM_GROUP( 3dnow, 2 );
79
   ASSIGN_XFORM_GROUP( 3dnow, 3 );
80
   ASSIGN_XFORM_GROUP( 3dnow, 4 );
81
 
82
   ASSIGN_NORM_GROUP( 3dnow );
83
 
84
#ifdef DEBUG
85
   _math_test_all_transform_functions( "3DNow!" );
86
   _math_test_all_normal_transform_functions( "3DNow!" );
87
#endif
88
#endif
89
}