Integer division remains expensive on today's processors as thecost of integer multiplication declines. We present code sequences fordivision by arbitrary nonzero integer constants and run-time invariantsusing integer multiplication. The algorithms assume a two's complementarchitecture. Most also require that the upper half of an integerproduct be quickly… (More)

This paper considers the problem of dividing a two-word integer by a single-word integer, together with a few extensions and applications. Due to lack of efficient division instructions in current processors, the division is performed as a multiplication using a precomputed single-word approximation of the reciprocal of the divisor, followed by a couple of… (More)

In 1987, Henry Massalin, of Columbia University, described a superoptimizer that generates optimal instruction sequences given a function to be performed [1]. The sequences are found by doing an exhaustive search over a subset of the instructions of the machine for which the optimization is made. Little or no mention of this important technique has occurred… (More)

A superoptimizer is a tool capable of generating an optimal program that computes a desired function. This thesis describes a superoptimizer that uses binary decision diagrams to determine if a generated candidate programs is equivalent to a given target program known to compute the desired function. The superoptimizer is shown to work well for generating… (More)