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 9, the replacement code could shift Y left by 3 bits (equivalent to multiplying by 8) 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!