From c5c0e0172fc42fcce317f960ef36e5591c38005e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 13 May 2010 21:03:08 +0100 Subject: [PATCH] Conditionally revert "gallivm: Use a more compact approach for lp_build_broadcast_scalar()." This reverts commit a09e46c72461183c879d8472b44fe740ecc79b9f. --- src/gallium/auxiliary/gallivm/lp_bld_swizzle.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } } -- 2.30.2