From: José Fonseca Date: Sun, 21 Apr 2013 08:02:21 +0000 (+0100) Subject: Revert "gallivm: Emit vector selects." X-Git-Tag: mesa-9.2.1~1655 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fb5b2f45c1daf7a6add3d369e616cfba51aacf4;p=platform%2Fupstream%2Fmesa.git Revert "gallivm: Emit vector selects." It caused inumerous regressions (LLVM 3.1) in blending. In particular: - lp_test_blend type=u8nx16 rgb_func=sub rgb_src_factor=zero rgb_dst_factor=inv_src_color alpha_func=rev_sub alpha_src_factor=one alpha_dst_factor=const_color ... MISMATCH Src: 0 0 0 b5 49 29 0 a2 0 21 de 0 c3 1b ec 0 Src1: 2d 85 14 0 f8 0 79 a1 99 0 d8 0 59 16 0 0 Dst: 0 a9 97 0 c0 0 78 0 0 8b aa f0 bd 0 78 f6 Con: 7d 0 c0 0 0 bb 77 0 0 0 50 0 40 51 0 0 Res: 0 0 0 0 0 29 0 0 0 0 c8 0 97 1b e3 0 Ref: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 type=u8nx16 rgb_func=max rgb_src_factor=one rgb_dst_factor=inv_const_color alpha_func=min alpha_src_factor=zero alpha_dst_factor=inv_src1_alpha ... MISMATCH Src: d 0 0 e9 0 37 35 f0 62 0 0 b2 e9 f7 0 5c Src1: 8f 0 bf 0 a8 5 0 0 c4 0 d7 7 92 a 0 17 Dst: cb 0 1e 0 0 0 19 8e 0 4d 0 0 0 0 3 46 Con: aa 5a 5f 8f 0 0 bc 92 0 88 0 0 b7 8a c0 88 Res: 44 0 13 0 0 0 7 8e 0 24 0 0 0 0 1 40 Ref: 44 0 13 0 0 37 35 0 62 24 0 0 e9 f7 1 0 This reverts commit 1e266c7ef01251ecf72347a2ba1d174b035cbe3b. --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index cdb7e0a..168bc26 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -458,10 +458,22 @@ lp_build_select(struct lp_build_context *bld, mask = LLVMBuildTrunc(builder, mask, LLVMInt1TypeInContext(lc), ""); res = LLVMBuildSelect(builder, mask, a, b, ""); } - else if (HAVE_LLVM >= 0x301) { + else if (0) { /* Generate a vector select. * - * Only supported on LLVM 3.1 onwards + * XXX: Using vector selects would avoid emitting intrinsics, but they aren't + * properly supported yet. + * + * LLVM 3.1 supports it, but it yields buggy code (e.g. lp_blend_test). + * + * LLVM 3.0 includes experimental support provided the -promote-elements + * options is passed to LLVM's command line (e.g., via + * llvm::cl::ParseCommandLineOptions), but resulting code quality is much + * worse, probably because some optimization passes don't know how to + * handle vector selects. + * + * See also: + * - http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043659.html */ /* Convert the mask to a vector of booleans.