Many optimizations Strength reduction



there more optimizations go. register r3 main variable in innermost loop (0140-0260); gets incremented 1 each time through loop. register r8 (which invariant in innermost loop) added r3. instead of using r3, compiler can eliminate r3 , use r9. loop, instead of being controlled r3 = 0 n-1, can controlled r9=r8+0 r8+n-1. adds 4 instructions , kills 4 instructions, there s 1 fewer instruction inside loop.



now r9 loop variable, interacts multiply 8. here strength reduction. multiply 8 can reduced successive additions of 8. there no multiplications inside loop.



registers r9 , r10 (= 8*r9) aren t both needed; r9 can eliminated in loop. loop 5 instructions.








Comments

Popular posts from this blog

Discography Kassav'

History New York State Route 133

History Women in science