gallivm: Use the wrappers for SSE pack intrinsics.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 4 Oct 2010 16:42:18 +0000 (17:42 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 8 Oct 2010 16:30:08 +0000 (17:30 +0100)
Fixes assertion failures on LLVM 2.6.

src/gallium/auxiliary/gallivm/lp_bld_conv.c

index 605eb043c736045884e1cb9beb3d28d6e23d8da7..40c661875201fa150992a918d6abff8d5562e560 100644 (file)
@@ -306,21 +306,9 @@ lp_build_conv(LLVMBuilderRef builder,
                                     LLVMBuildFMul(builder, src[3], const_255f, ""),
                                     int32_vec_type, "");
 
-#if HAVE_LLVM >= 0x0207
-         lo = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128",
-                                        int16_vec_type, src_int0, src_int1);
-         hi = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128",
-                                        int16_vec_type, src_int2, src_int3);
-         dst[i] = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packuswb.128",
-                                            dst_vec_type, lo, hi);
-#else
-         lo = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128",
-                                        int32_vec_type, src_int0, src_int1);
-         hi = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128",
-                                        int32_vec_type, src_int2, src_int3);
-         dst[i] = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packuswb.128",
-                                            int16_vec_type, lo, hi);
-#endif
+         lo = lp_build_pack2(builder, int32_type, int16_type, src_int0, src_int1);
+         hi = lp_build_pack2(builder, int32_type, int16_type, src_int2, src_int3);
+         dst[i] = lp_build_pack2(builder, int16_type, dst_type, lo, hi);
       }
       return; 
    }