Multiplication by Integer constants
Software—Practice & Experience
Integer multiplication and division on the HP precision architecture
ASPLOS II Proceedings of the second international conference on Architectual support for programming languages and operating systems
i486 microprocessor programmer's reference manual
i486 microprocessor programmer's reference manual
Hard-Wired Multipliers with Encoded Partial Products
IEEE Transactions on Computers
The art of computer programming, volume 2 (3rd ed.): seminumerical algorithms
The art of computer programming, volume 2 (3rd ed.): seminumerical algorithms
ACM Transactions on Programming Languages and Systems (TOPLAS)
Hi-index | 0.00 |
Replacing a multiplication of an integer constant by a sequence of simple instructions can be beneficial because it reduces the total number of cycles and also provides more opportunity for instruction level parallelism. In this paper we developed an algorithm that selectively replaces multiplications of integer constants with sequences of SUB, ADD, SHIFT, and LEA instructions. The algorithm runs fast and the generated instruction sequences are of high quality. The number of simple instructions generated for a multiplication of an integer constant is about 84.5% of the number of 1-bits in the binary representation of the constant. Also, for several popular processors, the simple instruction sequences significantly reduces the execution time to perform the multiplications.