[Mesa-dev] suspect rcp code in llvmpipe

Dave Airlie airlied at gmail.com
Fri Nov 30 02:10:43 PST 2012


coverity pointed out the below as suspect, since num_iterations = 0,
and we do a loop from 0..0

Dave.

 if (FALSE && ((util_cpu_caps.has_sse && type.width == 32 &&
type.length == 4) ||
         (util_cpu_caps.has_avx && type.width == 32 && type.length == 8))){
      const unsigned num_iterations = 0;
      LLVMValueRef res;
      unsigned i;
      const char *intrinsic = NULL;

      if (type.length == 4) {
         intrinsic = "llvm.x86.sse.rcp.ps";
      }
      else {
         intrinsic = "llvm.x86.avx.rcp.ps.256";
      }

      res = lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);

      for (i = 0; i < num_iterations; ++i) {
         res = lp_build_rcp_refine(bld, a, res);
      }


More information about the mesa-dev mailing list