gallivm: make sure we return the correct type when approximating log's
authorZack Rusin <zackr@vmware.com>
Thu, 22 Apr 2010 17:00:48 +0000 (13:00 -0400)
committerZack Rusin <zackr@vmware.com>
Thu, 22 Apr 2010 17:57:18 +0000 (13:57 -0400)
src/gallium/auxiliary/gallivm/lp_bld_arit.c

index 8e8fcccf564ead77eae89145de1df7bbd7946622..d69676331727e72ec12cc62a05b2d3177bd67ddc 100644 (file)
@@ -1502,8 +1502,10 @@ lp_build_log2_approx(struct lp_build_context *bld,
       res = LLVMBuildAdd(bld->builder, logmant, logexp, "");
    }
 
-   if(p_exp)
+   if(p_exp) {
+      exp = LLVMConstBitCast(exp, vec_type);
       *p_exp = exp;
+   }
 
    if(p_floor_log2)
       *p_floor_log2 = logexp;