[理工] 計組-data dependency

看板Grad-ProbAsk作者 (古月小楓)時間14年前 (2011/11/13 00:36), 編輯推噓3(307)
留言10則, 3人參與, 最新討論串1/2 (看更多)
Given 4 instructions , how many unique comparions (between register source and destinations) are necessary to find all of the RAW,WAR,WAW data dependences, Answer for the case of 4 instructions , and then derive a general equations for N instructions . Assume that all instructions have one register destination and two register source. (answer) For four instructions , the number of unique comparions: (2(3) + 2(2) + 2(1)) + (2(3) + 2(2) + 2(1)) + (3 + 2 + 1 ) = 30 ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ↑RAW ↑WAR ↑WAW n-1 The general equation for N instructions = 5 * Σ i = (5*(n -1)*n) / 2 i=1 想請問的是4道指令答案是怎麼推導的呢? 還有一般式如何推導出來? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.41.129.247

11/13 01:26, , 1F
A=B+C
11/13 01:26, 1F

11/13 01:26, , 2F
C=A-B
11/13 01:26, 2F

11/13 01:26, , 3F
D=A+C
11/13 01:26, 3F

11/13 01:26, , 4F
A=B*C
11/13 01:26, 4F

11/13 01:28, , 5F
已RAW為例:第一輪A與下面3個指令等號左邊的2個Reg比2(3)
11/13 01:28, 5F

11/13 01:29, , 6F
第二輪C與下面2個指令等號左邊的2個Reg比2(2)
11/13 01:29, 6F

11/13 01:31, , 7F
再來應該會了
11/13 01:31, 7F

11/13 17:20, , 8F
太清楚了....樓上好強大~~
11/13 17:20, 8F

11/13 19:37, , 9F
不好意思 請問等號左邊有兩個reg @@???
11/13 19:37, 9F

11/13 22:06, , 10F
右邊,不好意思打錯
11/13 22:06, 10F
文章代碼(AID): #1Elg1pjq (Grad-ProbAsk)
文章代碼(AID): #1Elg1pjq (Grad-ProbAsk)