summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/x86')
-rw-r--r--src/mesa/x86/3dnow.c2
-rw-r--r--src/mesa/x86/common_x86.c83
-rw-r--r--src/mesa/x86/common_x86_asm.h14
-rw-r--r--src/mesa/x86/gen_matypes.c4
-rw-r--r--src/mesa/x86/glapi_x86.S54
-rw-r--r--src/mesa/x86/sse.c2
-rw-r--r--src/mesa/x86/x86.h35
-rw-r--r--src/mesa/x86/x86_xform.c (renamed from src/mesa/x86/x86.c)68
-rw-r--r--src/mesa/x86/x86_xform.h (renamed from src/mesa/x86/common_x86_macros.h)4
9 files changed, 133 insertions, 133 deletions
diff --git a/src/mesa/x86/3dnow.c b/src/mesa/x86/3dnow.c
index c037a617618..de2fb1e2aad 100644
--- a/src/mesa/x86/3dnow.c
+++ b/src/mesa/x86/3dnow.c
@@ -34,7 +34,7 @@
#include "tnl/t_context.h"
#include "3dnow.h"
-#include "common_x86_macros.h"
+#include "x86_xform.h"
#ifdef DEBUG_MATH
#include "math/m_debug.h"
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index 53215479358..5efdb4f24a6 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -52,7 +52,10 @@
#include "common_x86_asm.h"
-int _mesa_x86_cpu_features = 0;
+/** Bitmask of X86_FEATURE_x bits */
+int _mesa_x86_cpu_features = 0x0;
+
+
/* No reason for this to be public.
*/
@@ -73,9 +76,12 @@ extern GLuint _ASMAPI _mesa_x86_cpuid_edx(GLuint op);
* kernels provide full SSE support on all processors that expose SSE via
* the CPUID mechanism.
*/
+
+/* These are assembly functions: */
extern void _mesa_test_os_sse_support( void );
extern void _mesa_test_os_sse_exception_support( void );
+
#if defined(WIN32)
#ifndef STATUS_FLOAT_MULTIPLE_TRAPS
# define STATUS_FLOAT_MULTIPLE_TRAPS (0xC00002B5L)
@@ -107,7 +113,11 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp)
#endif /* WIN32 */
-static void check_os_sse_support( void )
+/**
+ * Check if SSE is supported.
+ * If not, turn off the X86_FEATURE_XMM flag in _mesa_x86_cpu_features.
+ */
+void _mesa_check_os_sse_support( void )
{
#if defined(__FreeBSD__)
{
@@ -187,10 +197,26 @@ static void check_os_sse_support( void )
#endif /* USE_SSE_ASM */
-void _mesa_init_all_x86_transform_asm( void )
+/**
+ * Initialize the _mesa_x86_cpu_features bitfield.
+ * This is a no-op if called more than once.
+ */
+void
+_mesa_get_x86_features(void)
{
+ static int called = 0;
+
+ if (called)
+ return;
+
+ called = 1;
+
#ifdef USE_X86_ASM
- _mesa_x86_cpu_features = 0;
+ _mesa_x86_cpu_features = 0x0;
+
+ if (_mesa_getenv( "MESA_NO_ASM")) {
+ return;
+ }
if (!_mesa_x86_has_cpuid()) {
_mesa_debug(NULL, "CPUID not detected\n");
@@ -263,52 +289,5 @@ void _mesa_init_all_x86_transform_asm( void )
}
}
-
- if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
- _mesa_x86_cpu_features = 0;
- }
-
- if ( _mesa_x86_cpu_features ) {
- _mesa_init_x86_transform_asm();
- }
-
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- if ( _mesa_getenv( "MESA_NO_MMX" ) == 0 ) {
- _mesa_debug(NULL, "MMX cpu detected.\n");
- } else {
- _mesa_x86_cpu_features &= ~(X86_FEATURE_MMX);
- }
- }
-#endif
-
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- if ( _mesa_getenv( "MESA_NO_3DNOW" ) == 0 ) {
- _mesa_debug(NULL, "3DNow! cpu detected.\n");
- _mesa_init_3dnow_transform_asm();
- } else {
- _mesa_x86_cpu_features &= ~(X86_FEATURE_3DNOW);
- }
- }
-#endif
-
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- if ( _mesa_getenv( "MESA_NO_SSE" ) == 0 ) {
- _mesa_debug(NULL, "SSE cpu detected.\n");
- if ( _mesa_getenv( "MESA_FORCE_SSE" ) == 0 ) {
- check_os_sse_support();
- }
- if ( cpu_has_xmm ) {
- _mesa_init_sse_transform_asm();
- }
- } else {
- _mesa_debug(NULL, "SSE cpu detected, but switched off by user.\n");
- _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
- }
- }
-#endif
-#endif
+#endif /* USE_X86_ASM */
}
-
diff --git a/src/mesa/x86/common_x86_asm.h b/src/mesa/x86/common_x86_asm.h
index 89312b24379..0d39e3d2308 100644
--- a/src/mesa/x86/common_x86_asm.h
+++ b/src/mesa/x86/common_x86_asm.h
@@ -42,18 +42,12 @@
*/
#include "common_x86_features.h"
-#ifdef USE_X86_ASM
-#include "x86.h"
-#ifdef USE_3DNOW_ASM
-#include "3dnow.h"
-#endif
-#ifdef USE_SSE_ASM
-#include "sse.h"
-#endif
-#endif
-
extern int _mesa_x86_cpu_features;
+extern void _mesa_get_x86_features(void);
+
+extern void _mesa_check_os_sse_support(void);
+
extern void _mesa_init_all_x86_transform_asm( void );
#endif
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
index afb4b11529f..8c690b4f882 100644
--- a/src/mesa/x86/gen_matypes.c
+++ b/src/mesa/x86/gen_matypes.c
@@ -61,7 +61,7 @@ do { \
printf( "\n" ); \
} while (0)
-#if defined(__BEOS__) || defined(_LP64)
+#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
#define OFFSET( s, t, m ) \
printf( "#define %s\t%ld\n", s, offsetof( t, m ) );
#else
@@ -69,7 +69,7 @@ do { \
printf( "#define %s\t%d\n", s, offsetof( t, m ) );
#endif
-#if defined(__BEOS__) || defined(_LP64)
+#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
#define SIZEOF( s, t ) \
printf( "#define %s\t%ld\n", s, sizeof(t) );
#else
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 2e05a74ac69..7aa344f214e 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -889,6 +889,10 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(VertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV, VertexAttribs4fvNV@12)
GL_STUB(VertexAttribs4svNV, _gloffset_VertexAttribs4svNV, VertexAttribs4svNV@12)
GL_STUB(VertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV, VertexAttribs4ubvNV@12)
+ GL_STUB(GetTexBumpParameterfvATI, _gloffset_GetTexBumpParameterfvATI, GetTexBumpParameterfvATI@8)
+ GL_STUB(GetTexBumpParameterivATI, _gloffset_GetTexBumpParameterivATI, GetTexBumpParameterivATI@8)
+ GL_STUB(TexBumpParameterfvATI, _gloffset_TexBumpParameterfvATI, TexBumpParameterfvATI@8)
+ GL_STUB(TexBumpParameterivATI, _gloffset_TexBumpParameterivATI, TexBumpParameterivATI@8)
GL_STUB(AlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI, AlphaFragmentOp1ATI@24)
GL_STUB(AlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI, AlphaFragmentOp2ATI@36)
GL_STUB(AlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI, AlphaFragmentOp3ATI@48)
@@ -905,26 +909,26 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
- GL_STUB(_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_734@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
- GL_STUB(_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_735@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@4))
- GL_STUB(_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_736@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8))
- GL_STUB(_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_737@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@8))
- GL_STUB(_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_738@4)
+ GL_STUB(_dispatch_stub_738, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_738@4)
HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
+ GL_STUB(_dispatch_stub_739, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_739@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@4))
+ GL_STUB(_dispatch_stub_740, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_740@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8))
+ GL_STUB(_dispatch_stub_741, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_741@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@8))
+ GL_STUB(_dispatch_stub_742, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_742@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_742, _dispatch_stub_742@4))
GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
- GL_STUB(_dispatch_stub_745, _gloffset_DepthBoundsEXT, _dispatch_stub_745@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@16))
- GL_STUB(_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_746@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_746, _dispatch_stub_746@8))
+ GL_STUB(_dispatch_stub_749, _gloffset_DepthBoundsEXT, _dispatch_stub_749@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@16))
+ GL_STUB(_dispatch_stub_750, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_750@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_750, _dispatch_stub_750@8))
GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -942,19 +946,19 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4)
GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4)
GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
- GL_STUB(_dispatch_stub_764, _gloffset_BlitFramebufferEXT, _dispatch_stub_764@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_764, _dispatch_stub_764@40))
+ GL_STUB(_dispatch_stub_768, _gloffset_BlitFramebufferEXT, _dispatch_stub_768@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@40))
GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
- GL_STUB(_dispatch_stub_766, _gloffset_StencilFuncSeparateATI, _dispatch_stub_766@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16))
- GL_STUB(_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_767@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16))
- GL_STUB(_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_768@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16))
- GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_769@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@12))
- GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_770@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12))
+ GL_STUB(_dispatch_stub_770, _gloffset_StencilFuncSeparateATI, _dispatch_stub_770@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16))
+ GL_STUB(_dispatch_stub_771, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_771@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@16))
+ GL_STUB(_dispatch_stub_772, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_772@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@16))
+ GL_STUB(_dispatch_stub_773, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_773@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_773, _dispatch_stub_773@12))
+ GL_STUB(_dispatch_stub_774, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_774@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_774, _dispatch_stub_774@12))
GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
diff --git a/src/mesa/x86/sse.c b/src/mesa/x86/sse.c
index 1c185387c64..aef15b53152 100644
--- a/src/mesa/x86/sse.c
+++ b/src/mesa/x86/sse.c
@@ -33,7 +33,7 @@
#include "tnl/t_context.h"
#include "sse.h"
-#include "common_x86_macros.h"
+#include "x86_xform.h"
#ifdef DEBUG_MATH
#include "math/m_debug.h"
diff --git a/src/mesa/x86/x86.h b/src/mesa/x86/x86.h
deleted file mode 100644
index 97651ec6ee4..00000000000
--- a/src/mesa/x86/x86.h
+++ /dev/null
@@ -1,35 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Intel x86 assembly code by Josh Vanderhoof
- */
-
-#ifndef __X86_H__
-#define __X86_H__
-
-extern void _mesa_init_x86_transform_asm( void );
-
-#endif
diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86_xform.c
index ce649f66b0b..16b2b26bcc8 100644
--- a/src/mesa/x86/x86.c
+++ b/src/mesa/x86/x86_xform.c
@@ -32,8 +32,17 @@
#include "math/m_xform.h"
#include "tnl/t_context.h"
-#include "x86.h"
-#include "common_x86_macros.h"
+#include "x86_xform.h"
+#include "common_x86_asm.h"
+
+#ifdef USE_X86_ASM
+#ifdef USE_3DNOW_ASM
+#include "3dnow.h"
+#endif
+#ifdef USE_SSE_ASM
+#include "sse.h"
+#endif
+#endif
#ifdef DEBUG_MATH
#include "math/m_debug.h"
@@ -76,9 +85,9 @@ _mesa_v16_x86_general_xform( GLfloat *dest,
#endif
-void _mesa_init_x86_transform_asm( void )
-{
#ifdef USE_X86_ASM
+static void _mesa_init_x86_transform_asm( void )
+{
ASSIGN_XFORM_GROUP( x86, 2 );
ASSIGN_XFORM_GROUP( x86, 3 );
ASSIGN_XFORM_GROUP( x86, 4 );
@@ -90,6 +99,55 @@ void _mesa_init_x86_transform_asm( void )
_math_test_all_transform_functions( "x86" );
_math_test_all_cliptest_functions( "x86" );
#endif
-#endif
}
+#endif
+
+void _mesa_init_all_x86_transform_asm( void )
+{
+ _mesa_get_x86_features();
+
+#ifdef USE_X86_ASM
+ if ( _mesa_x86_cpu_features ) {
+ _mesa_init_x86_transform_asm();
+ }
+
+#ifdef USE_MMX_ASM
+ if ( cpu_has_mmx ) {
+ if ( _mesa_getenv( "MESA_NO_MMX" ) == 0 ) {
+ _mesa_debug(NULL, "MMX cpu detected.\n");
+ } else {
+ _mesa_x86_cpu_features &= ~(X86_FEATURE_MMX);
+ }
+ }
+#endif
+
+#ifdef USE_3DNOW_ASM
+ if ( cpu_has_3dnow ) {
+ if ( _mesa_getenv( "MESA_NO_3DNOW" ) == 0 ) {
+ _mesa_debug(NULL, "3DNow! cpu detected.\n");
+ _mesa_init_3dnow_transform_asm();
+ } else {
+ _mesa_x86_cpu_features &= ~(X86_FEATURE_3DNOW);
+ }
+ }
+#endif
+
+#ifdef USE_SSE_ASM
+ if ( cpu_has_xmm ) {
+ if ( _mesa_getenv( "MESA_NO_SSE" ) == 0 ) {
+ _mesa_debug(NULL, "SSE cpu detected.\n");
+ if ( _mesa_getenv( "MESA_FORCE_SSE" ) == 0 ) {
+ _mesa_check_os_sse_support();
+ }
+ if ( cpu_has_xmm ) {
+ _mesa_init_sse_transform_asm();
+ }
+ } else {
+ _mesa_debug(NULL, "SSE cpu detected, but switched off by user.\n");
+ _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM);
+ }
+ }
+#endif
+#endif
+}
diff --git a/src/mesa/x86/common_x86_macros.h b/src/mesa/x86/x86_xform.h
index 462f32b3f25..e886d9add2a 100644
--- a/src/mesa/x86/common_x86_macros.h
+++ b/src/mesa/x86/x86_xform.h
@@ -26,8 +26,8 @@
* Gareth Hughes
*/
-#ifndef __COMMON_X86_MACROS_H__
-#define __COMMON_X86_MACROS_H__
+#ifndef X86_XFORM_H
+#define X86_XFORM_H
/* =============================================================