aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_arit.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-12-13 21:20:05 +0100
committerRoland Scheidegger <[email protected]>2013-12-14 17:11:03 +0100
commit27d47bd42f417db96842c9453092acf68944a4c8 (patch)
treeeef9ef9d4a523d702479605af6f5b31be3c3f8a0 /src/gallium/auxiliary/gallivm/lp_bld_arit.c
parent7c027666da1cd3691983bbc238847a2af57f336e (diff)
gallivm: fix pointer type for stmxcsr/ldmxcsr
The argument is a i8 pointer not a i32 pointer (even though the value actually stored/loaded IS i32). Older llvm versions didn't care but 3.2 and newer do leading to crashes. Reviewed-by: Zack Rusin <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 440dd0b6ac2..e516ae8214c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -3510,10 +3510,12 @@ lp_build_fpstate_get(struct gallivm_state *gallivm)
gallivm,
LLVMInt32TypeInContext(gallivm->context),
"mxcsr_ptr");
+ LLVMValueRef mxcsr_ptr8 = LLVMBuildPointerCast(builder, mxcsr_ptr,
+ LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0), "");
lp_build_intrinsic(builder,
"llvm.x86.sse.stmxcsr",
LLVMVoidTypeInContext(gallivm->context),
- &mxcsr_ptr, 1);
+ &mxcsr_ptr8, 1);
return mxcsr_ptr;
}
return 0;
@@ -3554,7 +3556,10 @@ lp_build_fpstate_set(struct gallivm_state *gallivm,
LLVMValueRef mxcsr_ptr)
{
if (util_cpu_caps.has_sse) {
- lp_build_intrinsic(gallivm->builder,
+ LLVMBuilderRef builder = gallivm->builder;
+ mxcsr_ptr = LLVMBuildPointerCast(builder, mxcsr_ptr,
+ LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0), "");
+ lp_build_intrinsic(builder,
"llvm.x86.sse.ldmxcsr",
LLVMVoidTypeInContext(gallivm->context),
&mxcsr_ptr, 1);