MCPcopy Create free account
hub / github.com/ablab/spades / RoundingUDiv

Method RoundingUDiv

ext/src/llvm/APInt.cpp:2815–2831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2813}
2814
2815APInt llvm::APIntOps::RoundingUDiv(const APInt &A, const APInt &B,
2816 APInt::Rounding RM) {
2817 // Currently udivrem always rounds down.
2818 switch (RM) {
2819 case APInt::Rounding::DOWN:
2820 case APInt::Rounding::TOWARD_ZERO:
2821 return A.udiv(B);
2822 case APInt::Rounding::UP: {
2823 APInt Quo, Rem;
2824 APInt::udivrem(A, B, Quo, Rem);
2825 if (Rem == 0)
2826 return Quo;
2827 return Quo + 1;
2828 }
2829 }
2830 llvm_unreachable("Unknown APInt::Rounding enum");
2831}
2832
2833APInt llvm::APIntOps::RoundingSDiv(const APInt &A, const APInt &B,
2834 APInt::Rounding RM) {

Callers

nothing calls this directly

Calls 1

udivMethod · 0.80

Tested by

no test coverage detected