summaryrefslogtreecommitdiff
path: root/src/mesa/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/x86')
-rw-r--r--src/mesa/x86/glapi_x86.S58
-rw-r--r--src/mesa/x86/read_rgba_span_x86.S133
-rw-r--r--src/mesa/x86/rtasm/x86sse.c25
-rw-r--r--src/mesa/x86/rtasm/x86sse.h3
4 files changed, 62 insertions, 157 deletions
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 0fe625bc9d..9a5d875e21 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -844,10 +844,6 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(GetVertexAttribivNV, _gloffset_GetVertexAttribivNV, GetVertexAttribivNV@12)
GL_STUB(IsProgramNV, _gloffset_IsProgramNV, IsProgramNV@4)
GL_STUB(LoadProgramNV, _gloffset_LoadProgramNV, LoadProgramNV@16)
- GL_STUB(ProgramParameter4dNV, _gloffset_ProgramParameter4dNV, ProgramParameter4dNV@40)
- GL_STUB(ProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV, ProgramParameter4dvNV@12)
- GL_STUB(ProgramParameter4fNV, _gloffset_ProgramParameter4fNV, ProgramParameter4fNV@24)
- GL_STUB(ProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV, ProgramParameter4fvNV@12)
GL_STUB(ProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV, ProgramParameters4dvNV@16)
GL_STUB(ProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV, ProgramParameters4fvNV@16)
GL_STUB(RequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV, RequestResidentProgramsNV@8)
@@ -908,26 +904,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_737, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_737@4)
+ GL_STUB(_dispatch_stub_733, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_733@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@4))
+ GL_STUB(_dispatch_stub_734, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_734@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
+ GL_STUB(_dispatch_stub_735, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_735@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8))
+ GL_STUB(_dispatch_stub_736, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_736@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8))
+ GL_STUB(_dispatch_stub_737, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_737@4)
HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
- GL_STUB(_dispatch_stub_738, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_738@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
- GL_STUB(_dispatch_stub_739, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_739@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@8))
- GL_STUB(_dispatch_stub_740, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_740@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8))
- GL_STUB(_dispatch_stub_741, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_741@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@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_748, _gloffset_DepthBoundsEXT, _dispatch_stub_748@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@16))
- GL_STUB(_dispatch_stub_749, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_749@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@8))
+ GL_STUB(_dispatch_stub_744, _gloffset_DepthBoundsEXT, _dispatch_stub_744@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_744, _dispatch_stub_744@16))
+ GL_STUB(_dispatch_stub_745, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_745@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@8))
GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -945,19 +941,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_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40))
+ GL_STUB(_dispatch_stub_763, _gloffset_BlitFramebufferEXT, _dispatch_stub_763@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_763, _dispatch_stub_763@40))
GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
- GL_STUB(_dispatch_stub_769, _gloffset_StencilFuncSeparateATI, _dispatch_stub_769@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16))
- GL_STUB(_dispatch_stub_770, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_770@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16))
- GL_STUB(_dispatch_stub_771, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_771@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@16))
- GL_STUB(_dispatch_stub_772, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_772@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@12))
- GL_STUB(_dispatch_stub_773, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_773@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_773, _dispatch_stub_773@12))
+ GL_STUB(_dispatch_stub_765, _gloffset_StencilFuncSeparateATI, _dispatch_stub_765@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@16))
+ GL_STUB(_dispatch_stub_766, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_766@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16))
+ GL_STUB(_dispatch_stub_767, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_767@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16))
+ GL_STUB(_dispatch_stub_768, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_768@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@12))
+ GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_769@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@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)
@@ -1107,6 +1103,10 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
+ GL_STUB_ALIAS(ProgramParameter4dNV, _gloffset_ProgramEnvParameter4dARB, ProgramParameter4dNV@40, ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40)
+ GL_STUB_ALIAS(ProgramParameter4dvNV, _gloffset_ProgramEnvParameter4dvARB, ProgramParameter4dvNV@12, ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12)
+ GL_STUB_ALIAS(ProgramParameter4fNV, _gloffset_ProgramEnvParameter4fARB, ProgramParameter4fNV@24, ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24)
+ GL_STUB_ALIAS(ProgramParameter4fvNV, _gloffset_ProgramEnvParameter4fvARB, ProgramParameter4fvNV@12, ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12)
GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)
diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S
index 3cbcd71996..2e5c3be83f 100644
--- a/src/mesa/x86/read_rgba_span_x86.S
+++ b/src/mesa/x86/read_rgba_span_x86.S
@@ -33,20 +33,7 @@
.file "read_rgba_span_x86.S"
#if !defined(__DJGPP__) && !defined(__MINGW32__) /* this one cries for assyntax.h */
/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- .section .rodata
- .align 16
- .type mask, @object
- .size mask, 32
-mask:
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0xff00ff00
- .long 0x00ff0000
- .long 0x00ff0000
- .long 0x00ff0000
- .long 0x00ff0000
+ * Replaced data segment constants with text-segment instructions.
*/
#define LOAD_MASK(mvins,m1,m2) \
pushl $0xff00ff00 ;\
@@ -61,8 +48,7 @@ mask:
mvins (%esp), m2 ;\
addl $32, %esp
-
-/* I implemented these as macros because the appear in quite a few places,
+/* I implemented these as macros because they appear in several places,
* and I've tweaked them a number of times. I got tired of changing every
* place they appear. :)
*/
@@ -99,11 +85,6 @@ _generic_read_RGBA_span_BGRA8888_REV_MMX:
#ifdef USE_INNER_EMMS
emms
#endif
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- movq mask, %mm1
- movq mask+16, %mm2
- */
LOAD_MASK(movq,%mm1,%mm2)
movl 8(%esp), %ebx /* source pointer */
@@ -201,11 +182,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE:
#ifdef USE_INNER_EMMS
emms
#endif
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- movq mask, %mm1
- movq mask+16, %mm2
- */
+
LOAD_MASK(movq,%mm1,%mm2)
movl 16(%esp), %ebx /* source pointer */
@@ -364,11 +341,6 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2:
pushl %esi
pushl %ebx
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- movdqa mask, %xmm1
- movdqa mask+16, %xmm2
- */
LOAD_MASK(movdqu,%xmm1,%xmm2)
movl 12(%esp), %ebx /* source pointer */
@@ -491,60 +463,12 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2:
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- */
-#if 0
- .section .rodata
-
- .align 16
-mask_565:
- .word 0xf800
- .word 0x07e0
- .word 0x001f
- .word 0x0000
-
-/* Setting SCALE_ADJUST to 5 gives a perfect match with the classic C
- * implementation in Mesa. Setting SCALE_ADJUST to 0 is slightly faster but
- * at a small cost to accuracy.
- */
-
-#define SCALE_ADJUST 5
-#if SCALE_ADJUST == 5
-prescale:
- .word 0x0001
- .word 0x0010
- .word 0x0200
- .word 0x0000
-
-scale:
- .word 0x20e8 /* (0x00ff0000 / 0x000007c0) + 1 */
- .word 0x40c5 /* (0x00ff0000 / 0x000003f0) + 1 */
- .word 0x839d /* (0x00ff0000 / 0x000001f0) + 1 */
- .word 0x0000
-#elif SCALE_ADJUST == 0
-prescale:
- .word 0x0001
- .word 0x0020
- .word 0x0800
- .word 0x0000
-
-scale:
- .word 0x0108 /* (0x00ff0000 / 0x0000f800) + 1 */
- .word 0x0104 /* (0x00ff0000 / 0x0000fc00) + 1 */
- .word 0x0108 /* (0x00ff0000 / 0x0000f800) + 1 */
- .word 0x0000
-#else
-#error SCALE_ADJUST must either be 5 or 0.
-#endif
-
-
-alpha: .long 0x00000000
- .long 0x00ff0000
-#endif
-
#define MASK_565_L 0x07e0f800
#define MASK_565_H 0x0000001f
+/* Setting SCALE_ADJUST to 5 gives a perfect match with the
+ * classic C implementation in Mesa. Setting SCALE_ADJUST
+ * to 0 is slightly faster but at a small cost to accuracy.
+ */
#define SCALE_ADJUST 5
#if SCALE_ADJUST == 5
#define PRESCALE_L 0x00100001
@@ -581,23 +505,17 @@ _generic_read_RGBA_span_RGB565_MMX:
movl 8(%esp), %edx /* destination pointer */
movl 12(%esp), %ecx /* number of pixels to copy */
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- movq mask_565, %mm5
- movq prescale, %mm6
- movq scale, %mm7
- */
- pushl MASK_565_H
- pushl MASK_565_L
+ pushl $MASK_565_H
+ pushl $MASK_565_L
movq (%esp), %mm5
- pushl PRESCALE_H
- pushl PRESCALE_L
+ pushl $PRESCALE_H
+ pushl $PRESCALE_L
movq (%esp), %mm6
- pushl SCALE_H
- pushl SCALE_L
+ pushl $SCALE_H
+ pushl $SCALE_L
movq (%esp), %mm7
- pushl ALPHA_H
- pushl ALPHA_L
+ pushl $ALPHA_H
+ pushl $ALPHA_L
movq (%esp), %mm3
addl $32,%esp
@@ -648,11 +566,6 @@ _generic_read_RGBA_span_RGB565_MMX:
/* Always set the alpha value to 0xff.
*/
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- por alpha, %mm0
- por alpha, %mm2
- */
por %mm3, %mm0
por %mm3, %mm2
@@ -665,8 +578,6 @@ _generic_read_RGBA_span_RGB565_MMX:
movq %mm0, (%edx)
addl $8, %edx
-
-
pshufw $0xaa, %mm4, %mm0
pshufw $0xff, %mm4, %mm2
@@ -681,11 +592,6 @@ _generic_read_RGBA_span_RGB565_MMX:
pmulhuw %mm7, %mm0
pmulhuw %mm7, %mm2
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- por alpha, %mm0
- por alpha, %mm2
- */
por %mm3, %mm0
por %mm3, %mm2
@@ -724,11 +630,6 @@ _generic_read_RGBA_span_RGB565_MMX:
pmulhuw %mm7, %mm0
pmulhuw %mm7, %mm2
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- por alpha, %mm0
- por alpha, %mm2
- */
por %mm3, %mm0
por %mm3, %mm2
@@ -757,10 +658,6 @@ _generic_read_RGBA_span_RGB565_MMX:
#endif
pmulhuw %mm7, %mm0
-/* Kevin F. Quinn 2nd July 2006
- * Replace data segment constants with text-segment instructions
- por alpha, %mm0
- */
por %mm3, %mm0
packuswb %mm0, %mm0
diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c
index 3ea37bb5e7..612cd51a6e 100644
--- a/src/mesa/x86/rtasm/x86sse.c
+++ b/src/mesa/x86/rtasm/x86sse.c
@@ -1063,20 +1063,29 @@ struct x86_reg x86_fn_arg( struct x86_function *p,
}
-void x86_init_func( struct x86_function *p )
-{
- x86_init_func_size(p, 1024);
-}
-
-void x86_init_func_size( struct x86_function *p, GLuint code_size )
+/**
+ * Initialize an x86_function object, allocating space for up to
+ * 'code_size' bytes of code.
+ */
+GLboolean x86_init_func( struct x86_function *p, GLuint code_size )
{
+ assert(!p->store);
p->store = _mesa_exec_malloc(code_size);
- p->csr = p->store;
+ if (p->store) {
+ p->csr = p->store;
+ return GL_TRUE;
+ }
+ else {
+ p->csr = NULL;
+ return GL_FALSE;
+ }
}
void x86_release_func( struct x86_function *p )
{
- _mesa_exec_free(p->store);
+ if (p->store)
+ _mesa_exec_free(p->store);
+ p->store = p->csr = NULL;
}
diff --git a/src/mesa/x86/rtasm/x86sse.h b/src/mesa/x86/rtasm/x86sse.h
index 66fb852ac9..42b09937bc 100644
--- a/src/mesa/x86/rtasm/x86sse.h
+++ b/src/mesa/x86/rtasm/x86sse.h
@@ -80,8 +80,7 @@ enum sse_cc {
*/
-void x86_init_func( struct x86_function *p );
-void x86_init_func_size( struct x86_function *p, GLuint code_size );
+GLboolean x86_init_func( struct x86_function *p, GLuint code_size );
void x86_release_func( struct x86_function *p );
void (*x86_get_func( struct x86_function *p ))( void );