gallivm: Lower TGSI_OPCODE_MUL to fmul by default
authorTom Stellard <thomas.stellard@amd.com>
Thu, 6 Dec 2012 19:56:21 +0000 (11:56 -0800)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 11 Dec 2012 00:22:37 +0000 (19:22 -0500)
This fixes a number of crashes on r600g due to the fact that
lp_build_mul assumes vector types when optimizing mul to bit shifts.

This bug was uncovered by 0ad1fefd6951aa47ab58a41dc9ee73083cbcf85c

src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c

index cc4bd2e1647d00f6fb850a093ced17ed903a72a9..8159bebc89bfd9236e2e9e44ea52a825cccbd8b3 100644 (file)
@@ -580,8 +580,9 @@ mul_emit(
    struct lp_build_tgsi_context * bld_base,
    struct lp_build_emit_data * emit_data)
 {
-   emit_data->output[emit_data->chan] = lp_build_mul(&bld_base->base,
-                                   emit_data->args[0], emit_data->args[1]);
+   emit_data->output[emit_data->chan] = LLVMBuildFMul(
+                                   bld_base->base.gallivm->builder,
+                                   emit_data->args[0], emit_data->args[1], "");
 }
 
 /*.TGSI_OPCODE_DIV.*/