summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-05-13 21:03:08 +0100
committerJosé Fonseca <[email protected]>2010-05-13 21:14:39 +0100
commitc5c0e0172fc42fcce317f960ef36e5591c38005e (patch)
tree32725e975c38b54754f5f71342a49aa739493708 /src/gallium
parentc67d9d84f501f145f841c0b981caff6f4dfd936f (diff)
Conditionally revert "gallivm: Use a more compact approach for lp_build_broadcast_scalar()."
This reverts commit a09e46c72461183c879d8472b44fe740ecc79b9f.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_swizzle.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
index f095a39cf52..3c8a7bc09ea 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
@@ -76,10 +76,20 @@ lp_build_broadcast_scalar(struct lp_build_context *bld,
}
else {
LLVMValueRef res;
+#if HAVE_LLVM >= 0x207
res = LLVMBuildInsertElement(bld->builder, bld->undef, scalar,
LLVMConstInt(LLVMInt32Type(), 0, 0), "");
res = LLVMBuildShuffleVector(bld->builder, res, bld->undef,
lp_build_const_int_vec(type, 0), "");
+#else
+ /* XXX: The above path provokes a bug in LLVM 2.6 */
+ unsigned i;
+ res = bld->undef;
+ for(i = 0; i < type.length; ++i) {
+ LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0);
+ res = LLVMBuildInsertElement(bld->builder, res, scalar, index, "");
+ }
+#endif
return res;
}
}