diff options
Diffstat (limited to 'src/mesa/x86')
-rw-r--r-- | src/mesa/x86/3dnow_normal.S | 48 | ||||
-rw-r--r-- | src/mesa/x86/common_x86.c | 9 | ||||
-rw-r--r-- | src/mesa/x86/glapi_x86.S | 33 |
3 files changed, 50 insertions, 40 deletions
diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index 4345c1b574..f3bbcb27b7 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -129,8 +129,8 @@ LLBL (G3TN_transform): PREFETCH ( REGIND(EDX) ) MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EBP ) /* decrement normal counter */ - JA ( LLBL (G3TN_transform) ) + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ + JNZ ( LLBL (G3TN_transform) ) POP_L ( EDX ) /* end of transform --- */ @@ -164,9 +164,9 @@ LLBL (G3TN_norm_w_lengths): MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - JA ( LLBL (G3TN_norm_w_lengths) ) + JNZ ( LLBL (G3TN_norm_w_lengths) ) JMP ( LLBL (G3TN_exit_3dnow) ) ALIGNTEXT32 @@ -192,7 +192,7 @@ LLBL (G3TN_norm): MOVQ ( MM5, MM4 ) PUNPCKLDQ ( MM3, MM3 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) @@ -204,7 +204,7 @@ LLBL (G3TN_norm): PFMUL ( MM5, MM1 ) /* | x2 (normalize*/ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - JA ( LLBL (G3TN_norm) ) + JNZ ( LLBL (G3TN_norm) ) LLBL (G3TN_exit_3dnow): FEMMS @@ -289,13 +289,13 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */ ADD_L ( CONST(4), EDI ) /* next length */ PFMUL ( MM3, MM6 ) /* x1 (normalized) | x0 (normalized) */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ MOVD ( REGIND(EDI), MM3 ) /* | length (x) */ - JA ( LLBL (G3TNNR_norm_w_lengths) ) + JNZ ( LLBL (G3TNNR_norm_w_lengths) ) JMP ( LLBL (G3TNNR_exit_3dnow) ) ALIGNTEXT32 @@ -331,7 +331,7 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFRCPIT2 ( MM4, MM5 ) PFMUL ( MM5, MM6 ) /* x1 (normalized) | x0 (normalized) */ @@ -340,7 +340,7 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */ PFMUL ( MM5, MM7 ) /* | x2 (normalized) */ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TNNR_norm) ) + JNZ ( LLBL (G3TNNR_norm) ) LLBL (G3TNNR_exit_3dnow): @@ -411,11 +411,11 @@ LLBL (G3TRNR_rescale): PFMUL ( MM2, MM5 ) /* | x2*m10 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */ + JNZ ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */ FEMMS @@ -511,8 +511,8 @@ LLBL (G3TR_rescale): PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDI ) /* decrement normal counter */ - JA ( LLBL (G3TR_rescale) ) + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ + JNZ ( LLBL (G3TR_rescale) ) FEMMS @@ -574,11 +574,11 @@ LLBL (G3TNR_transform): PFMUL ( MM2, MM5 ) /* | x2*m10 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EDI ) /* decrement normal counter */ + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TNR_transform) ) + JNZ ( LLBL (G3TNR_transform) ) FEMMS @@ -663,9 +663,9 @@ LLBL (G3T_transform): PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDI ) /* decrement normal counter */ + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ - JA ( LLBL (G3T_transform) ) + JNZ ( LLBL (G3T_transform) ) FEMMS @@ -730,9 +730,9 @@ LLBL (G3N_norm1): /* use precalculated lengths */ ADD_L ( CONST(16), EAX ) /* next r */ ADD_L ( CONST(4), EDX ) /* next length */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - JA ( LLBL (G3N_norm1) ) + JNZ ( LLBL (G3N_norm1) ) JMP ( LLBL (G3N_end1) ) @@ -765,7 +765,7 @@ LLBL (G3N_norm2): /* need to calculate lengths */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFRCPIT2 ( MM4, MM5 ) @@ -775,7 +775,7 @@ LLBL (G3N_norm2): /* need to calculate lengths */ PFMUL ( MM5, MM1 ) /* | x2 (normalized) */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - JA ( LLBL (G3N_norm2) ) + JNZ ( LLBL (G3N_norm2) ) LLBL (G3N_end1): FEMMS @@ -835,8 +835,8 @@ LLBL (G3R_rescale): MOVQ ( MM1, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM2, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDX ) /* decrement normal counter */ - JA ( LLBL (G3R_rescale) ) + SUB_L ( CONST(1), EDX ) /* decrement normal counter */ + JNZ ( LLBL (G3R_rescale) ) FEMMS diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 889b40a89f..0b2af0a370 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -104,12 +104,7 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) static void check_os_sse_support( void ) { -#if defined(__linux__) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) - _mesa_debug(NULL, "Cannot safely enable SSE on pre-2.4 kernels.\n"); - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); -#endif -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) { int ret, enabled; unsigned int len; @@ -160,7 +155,7 @@ static void check_os_sse_support( void ) /* Do nothing on other platforms for now. */ _mesa_debug(NULL, "Not testing OS support for SSE, leaving enabled.\n"); -#endif /* __linux__ */ +#endif /* __FreeBSD__ */ } #endif /* USE_SSE_ASM */ diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 1106eeede8..1d04779d14 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -58,12 +58,18 @@ #ifdef GLX_USE_TLS +#ifdef GLX_X86_READONLY_TEXT +# define CTX_INSNS MOV_L(GS:(EAX), EAX) +#else +# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ +#endif + # define GL_STUB(fn,off,fn_alt) \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ CALL(_x86_get_dispatch) ; \ - NOP ; \ + CTX_INSNS ; \ JMP(GL_OFFSET(off)) #elif defined(PTHREADS) @@ -114,7 +120,10 @@ SEG_TEXT HIDDEN(GLNAME(_x86_get_dispatch)) ALIGNTEXT16 GLNAME(_x86_get_dispatch): - movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax + call 1f +1: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax + movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax ret #elif defined(PTHREADS) @@ -133,7 +142,7 @@ GLNAME(_x86_get_dispatch): EXTERN GLNAME(_glapi_get_dispatch) #endif -#if defined( GLX_USE_TLS ) +#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT ) .section wtext, "awx", @progbits #endif /* defined( GLX_USE_TLS ) */ @@ -938,14 +947,15 @@ GLNAME(gl_dispatch_functions_start): 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_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16) - HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16)) - GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16) + GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) + GL_STUB(_dispatch_stub_769, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_769@16) HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16)) - GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12) - HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12)) - GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12) + GL_STUB(_dispatch_stub_770, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_770@16) + HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16)) + GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_771@12) HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12)) + GL_STUB(_dispatch_stub_772, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_772@12) + HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@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) @@ -1119,12 +1129,17 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8) GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8) GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8) + GL_STUB_ALIAS(VertexAttrib4bv, _gloffset_VertexAttrib4bvARB, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8) GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36) GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8) GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20) GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8) + GL_STUB_ALIAS(VertexAttrib4iv, _gloffset_VertexAttrib4ivARB, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8) GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20) GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8) + GL_STUB_ALIAS(VertexAttrib4ubv, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8) + GL_STUB_ALIAS(VertexAttrib4uiv, _gloffset_VertexAttrib4uivARB, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8) + GL_STUB_ALIAS(VertexAttrib4usv, _gloffset_VertexAttrib4usvARB, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8) GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24) GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8) GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16) |