http://llvm.org/bugs/show_bug.cgi?id=13615
Benjamin Kramer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution| |INVALID --- Comment #1 from Benjamin Kramer <[email protected]> 2012-08-18 04:30:23 CDT --- This is an artifact of the default APInt constructor. It creates an APInt with bit width 1, and with that width 1 is equal to -1. The right usage of udivrem is: APInt a(32, 1), b(32, 1), c(32, 0), d(32, 0); APInt::udivrem(a, b, c, d); dbgs() << "dividing " << a << " by " << b << " yields " << c << " rem " << d << "\n"; and it prints: dividing 1 by 1 yields 1 rem 0 I agree that it is very easy to misuse this API but I'm not sure how to fix it. -- Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
