swr: [rasterizer jitter] fix assert in AVX implementation of MASKLOADD
authorTim Rowley <timothy.o.rowley@intel.com>
Thu, 12 May 2016 00:05:23 +0000 (18:05 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 19 May 2016 21:27:12 +0000 (16:27 -0500)
llvm changed the mask type to vector of ints with 3.8.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp

index 3a304ecf57a9cf0266ff5058316b17bfeac7277c..7da4c025a7ad5b9400492ab1b5d95dc1d7dd9d22 100644 (file)
@@ -350,9 +350,14 @@ Value *Builder::MASKLOADD(Value* src,Value* mask)
     }
     else
     {
+        // maskload intrinsic expects integer mask operand in llvm >= 3.8
+#if (LLVM_VERSION_MAJOR > 3) || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8)
+        mask = BITCAST(mask,VectorType::get(mInt32Ty,mVWidth));
+#else
+        mask = BITCAST(mask,VectorType::get(mFP32Ty,mVWidth));
+#endif
         Function *func = Intrinsic::getDeclaration(JM()->mpCurrentModule,Intrinsic::x86_avx_maskload_ps_256);
-        Value* fMask = BITCAST(mask,VectorType::get(mInt32Ty,mVWidth));
-        vResult = BITCAST(CALL(func,{src,fMask}), VectorType::get(mInt32Ty,mVWidth));
+        vResult = BITCAST(CALL(func,{src,mask}), VectorType::get(mInt32Ty,mVWidth));
     }
     return vResult;
 }