summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_fs.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-07-22 18:37:46 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-07-29 19:10:59 +0100
commite3d2ebac115f7b7899664fefc2652fb829acfa27 (patch)
tree135cfc368ae426c6c6a485cb4a544098d636fedb /src/gallium/drivers/llvmpipe/lp_state_fs.c
parent38f5b1bc38fde041162e90e0ba3955ac661e1abf (diff)
llvmpipe: Avoid corrupting the FPU stack with MMX instructions on 32bit OSes.
Unfortunately LLVM doesn't emit EMMS itself, and there is no easy/effective way to disable MMX. http://llvm.org/bugs/show_bug.cgi?id=3287
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_fs.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 5953d690a4..dbcc286417 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -676,6 +676,11 @@ generate_fragment(struct llvmpipe_context *lp,
color_ptr);
}
+#ifdef PIPE_ARCH_X86
+ /* Avoid corrupting the FPU stack on 32bit OSes. */
+ lp_build_intrinsic(builder, "llvm.x86.mmx.emms", LLVMVoidType(), NULL, 0);
+#endif
+
LLVMBuildRetVoid(builder);
LLVMDisposeBuilder(builder);