ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

sse.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.0
00004  *
00005  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this software and associated documentation files (the "Software"),
00009  * to deal in the Software without restriction, including without limitation
00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the
00012  * Software is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 /*
00026  * PentiumIII-SIMD (SSE) optimizations contributed by
00027  * Andre Werthmann <wertmann@cs.uni-potsdam.de>
00028  */
00029 
00030 #include "main/glheader.h"
00031 #include "main/context.h"
00032 #include "math/m_xform.h"
00033 #include "tnl/t_context.h"
00034 
00035 #include "sse.h"
00036 #include "common_x86_macros.h"
00037 
00038 #ifdef DEBUG_MATH
00039 #include "math/m_debug.h"
00040 #endif
00041 
00042 
00043 #ifdef USE_SSE_ASM
00044 DECLARE_XFORM_GROUP( sse, 2 )
00045 DECLARE_XFORM_GROUP( sse, 3 )
00046 
00047 #if 1
00048 /* Some functions are not written in SSE-assembly, because the fpu ones are faster */
00049 extern void _ASMAPI _mesa_sse_transform_normals_no_rot( NORM_ARGS );
00050 extern void _ASMAPI _mesa_sse_transform_rescale_normals( NORM_ARGS );
00051 extern void _ASMAPI _mesa_sse_transform_rescale_normals_no_rot( NORM_ARGS );
00052 
00053 extern void _ASMAPI _mesa_sse_transform_points4_general( XFORM_ARGS );
00054 extern void _ASMAPI _mesa_sse_transform_points4_3d( XFORM_ARGS );
00055 /* XXX this function segfaults, see below */
00056 extern void _ASMAPI _mesa_sse_transform_points4_identity( XFORM_ARGS );
00057 /* XXX this one works, see below */
00058 extern void _ASMAPI _mesa_x86_transform_points4_identity( XFORM_ARGS );
00059 #else
00060 DECLARE_NORM_GROUP( sse )
00061 #endif
00062 
00063 
00064 extern void _ASMAPI
00065 _mesa_v16_sse_general_xform( GLfloat *first_vert,
00066                  const GLfloat *m,
00067                  const GLfloat *src,
00068                  GLuint src_stride,
00069                  GLuint count );
00070 
00071 extern void _ASMAPI
00072 _mesa_sse_project_vertices( GLfloat *first,
00073                 GLfloat *last,
00074                 const GLfloat *m,
00075                 GLuint stride );
00076 
00077 extern void _ASMAPI
00078 _mesa_sse_project_clipped_vertices( GLfloat *first,
00079                     GLfloat *last,
00080                     const GLfloat *m,
00081                     GLuint stride,
00082                     const GLubyte *clipmask );
00083 #endif
00084 
00085 
00086 void _mesa_init_sse_transform_asm( void )
00087 {
00088 #ifdef USE_SSE_ASM
00089    ASSIGN_XFORM_GROUP( sse, 2 );
00090    ASSIGN_XFORM_GROUP( sse, 3 );
00091 
00092 #if 1
00093    /* TODO: Finish these off.
00094     */
00095    _mesa_transform_tab[4][MATRIX_GENERAL] =
00096       _mesa_sse_transform_points4_general;
00097    _mesa_transform_tab[4][MATRIX_3D] =
00098       _mesa_sse_transform_points4_3d;
00099    /* XXX NOTE: _mesa_sse_transform_points4_identity segfaults with the
00100       conformance tests, so use the x86 version.
00101    */
00102    _mesa_transform_tab[4][MATRIX_IDENTITY] =
00103       _mesa_x86_transform_points4_identity;/*_mesa_sse_transform_points4_identity;*/
00104 
00105    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
00106       _mesa_sse_transform_normals_no_rot;
00107    _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
00108       _mesa_sse_transform_rescale_normals;
00109    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
00110       _mesa_sse_transform_rescale_normals_no_rot;
00111 #else
00112    ASSIGN_XFORM_GROUP( sse, 4 );
00113 
00114    ASSIGN_NORM_GROUP( sse );
00115 #endif
00116 
00117 #ifdef DEBUG_MATH
00118    _math_test_all_transform_functions( "SSE" );
00119    _math_test_all_normal_transform_functions( "SSE" );
00120 #endif
00121 #endif
00122 }
00123 

Generated on Fri May 25 2012 04:18:58 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.