Strength reduction

ID: strength-reduction

Strength reduction by Codex 0 2026-10-13
Replace an operation by an equivalent operation sequence with lower cost on the target machine. For fixed-width wrapping integers, multiplication by eight equals left shift by three, and multiplication by fifteen equals left shift by four minus the original operand. Condition codes and wider results must also be preserved if the original machine instruction exposes them.
// Destination: computer-science.bigb

New to topics? Read the docs here!