1. A system for performing a multiplication, the system comprising a controller, wherein the controller comprises: a decision unit configured to determine whether a first data value has been used in a prior multiplication; a distributed loop buffer (DLB) configured to store instructions; and at least one processor, wherein the at least one processor is configured to execute the instructions so as to carry out operations, the operations comprising: receiving the first data value used in the prior multiplication; at run time and responsive to receiving the first data value, determining a sequence of shift-add/sub instructions for performing a multiplication using the first data value, wherein at least one instruction from the sequence of shift-add/sub instructions comprises a subtraction instruction; responsive to determining the sequence of shift-add/sub instructions, storing the sequence of shift-add/sub instructions in the DLB; receiving a second data value; and performing a multiplication using the first data value, the second data value, and at least one instruction from the stored sequence of shift-add/sub instructions.