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

Method magic

lib/Support/APInt.cpp:1423–1459  ·  view source on GitHub ↗

Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts. Requires that the divisor not be 0, 1, or -1. Taken from "Hacker's Delight", Henry S. Warren, Jr., chapter 10.

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

BuildSDIVMethod · 0.80
TESTFunction · 0.80

Calls 8

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

Tested by 1

TESTFunction · 0.64