Question: Compilers on some processors will replace multiplications with a short sequence of shifts and adds, if possible. For example if variable Y is to be
Compilers on some processors will replace multiplications with a short sequence of shifts and adds, if possible. For example if variable Y is to be multiplied by the replacement code could shift Y left by bits equivalent to multiplying by and then add the original Y In this case, the combination of one shift and one add replaced the original multiply. The motivation is performance a short sequence of simpler operations is often faster than a single multiplication instruction.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
