看板 Grad-ProbAsk 關於我們 聯絡資訊
consider program P, which runs on a 1GHz machine M in 10 seconds. An optimization is made to P, replacing all instances of multiplying a value by 4 (mult X, X, 4) with two instructions that set x to x+x twice (add X,X; and X,X) Call this new optimized program P'. The CPI of a multiply instruction is 4, and the CPI of an add is 1. After recompiling, the program now runs in 9 seconds on machine M. How many multiplies were replaced by the new compiler? 張凡上冊248頁 張凡答案給5 * 10^8 請問這題要怎麼解? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.166.113.236
s90413k64:1G*(10-9)/(4-1-1) 08/06 23:06
懂了! ※ 編輯: mqazz1 來自: 192.192.13.101 (08/07 14:22)
cola1230:懂了! 趕快寫下來 08/07 18:05