https://bugs.freedesktop.org/show_bug.cgi?id=83570

--- Comment #10 from rcond...@hotmail.com ---
Could be totally borked, but this is what I have at the moment:

   if (type.floating) {
      return LLVMBuildFDiv(builder, a, b, "");
   }
   else {
      //The spec says divide by zero is undefined, but shouldn't throw an
exception
      LLVMValueRef zeromask = lp_build_cmp(bld,
                                           PIPE_FUNC_EQUAL,
                                           b,
                                           lp_build_zero(bld->gallivm,type));
      if (type.sign) {
         return lp_build_select(bld,
                                zeromask,
                                bld->undef,
                                LLVMBuildSDiv(builder, a, b, ""));
      }
      else {
         return lp_build_select(bld,
                                zeromask,
                                bld->undef,
                                LLVMBuildUDiv(builder, a, b, ""));
      }
   }

I'll take a look at udiv_emit_cpu

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to