gallivm: prefer blendvb for integer arguments
authorKeith Whitwell <keithw@vmware.com>
Wed, 6 Oct 2010 18:10:30 +0000 (19:10 +0100)
committerKeith Whitwell <keithw@vmware.com>
Sat, 9 Oct 2010 10:44:45 +0000 (11:44 +0100)
src/gallium/auxiliary/gallivm/lp_bld_logic.c

index ce5d0214b436a9508170be87bc9913a7b759fa8d..026b60ac36ef28b872896c9ab8fc80d1e730990d 100644 (file)
@@ -462,10 +462,12 @@ lp_build_select(struct lp_build_context *bld,
       LLVMTypeRef arg_type;
       LLVMValueRef args[3];
 
-      if (type.width == 64) {
+      if (type.floating &&
+          type.width == 64) {
          intrinsic = "llvm.x86.sse41.blendvpd";
          arg_type = LLVMVectorType(LLVMDoubleType(), 2);
-      } else if (type.width == 32) {
+      } else if (type.floating &&
+                 type.width == 32) {
          intrinsic = "llvm.x86.sse41.blendvps";
          arg_type = LLVMVectorType(LLVMFloatType(), 4);
       } else {