MCPcopy Create free account
hub / github.com/GoSSIP-SJTU/Armariris / magicu

Method magicu

lib/Support/APInt.cpp:1467–1509  ·  view source on GitHub ↗

Calculate the magic numbers required to implement an unsigned integer division by a constant as a sequence of multiplies, adds and shifts. Requires that the divisor not be 0. Taken from "Hacker's Delight", Henry S. Warren, Jr., chapter 10. LeadingZeros can be used to simplify the calculation if the upper bits of the divided value are known zero.

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

BuildUDIVMethod · 0.80
TESTFunction · 0.80

Calls 6

uremMethod · 0.80
lshrMethod · 0.45
getBitWidthMethod · 0.45
udivMethod · 0.45
ugeMethod · 0.45
ultMethod · 0.45

Tested by 1

TESTFunction · 0.64