看板 Grad-ProbAsk 關於我們 聯絡資訊
1. 94成大電通 哪一項符合design principle的"simplicity favors regurality"? (a) Keeping all insturctions in a single size (b) Always requiring three operands in arithmetic instruction (c) Keeping the register fields in the same place in each instruction format (d) Having the same opcode field in the same place in each instruction format 答案: (a) (b) (c) 請問d為甚麼錯? 雖然課本舉例的"一致才會簡單"是舉前3個而已, 但d應該也是符合一致性吧? 2. 104台大資工 In each ISA's calling convention, the set of general purpose registers is usually divided into caller-save and callee-save two subsets. Which type of procedures could benefit most from such a register partition? 答案: If general purpose registers is not divided into caller-save and callee-save subsets, the caller must maintain all the registers allocated to the frequently used local variables even though the callee don’t have any local variables. That is, if the callee-procedure has no local variables, it could benefit most from such a register partition. 請問為何是對callee較好? 不是減輕caller的負擔嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.163.181.227 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1512807513.A.D0A.html
TampaBayRays: 我記得第一題老師上課的時候是說這個就算是不好的指 12/09 16:21
TampaBayRays: 令集也要遵守所以不算 12/09 16:21
TMDTMD2487: 第一個問題的d, 是無法改變的規格, 不然你不能解碼 12/09 16:27
TMDTMD2487: op放在那隨便但一定是要固定的不然無法解碼 12/09 16:28
謝謝, 但opcode固定不就是符合"一致"嗎? 是因為他的一致是因為"必要"而不是因為"簡單"? 是這樣嗎?
TMDTMD2487: 第二個的意思是說如果callee沒有local變數那對整體效 12/09 16:31
TMDTMD2487: 能會比較好因為就不需要把caller的存到stack 12/09 16:31
TMDTMD2487: 上述比較好就是跟caller存相比之下 12/09 16:31
TMDTMD2487: 這裡benefit是針對整個執行的效率吧 12/09 16:32
了解, 我語意理解有誤哈哈 ※ 編輯: clonsey1314 (1.163.181.227), 12/09/2017 16:53:51
TMDTMD2487: op的一致不是為了更好的ISA設計 是因為他不能不一致 12/09 17:05
TMDTMD2487: 四個設計原則基本上就是說,照這樣設計比較好 12/09 17:07
TMDTMD2487: 可是OP一致是必要的,感覺上就是不太能說是因為這四 12/09 17:08
TMDTMD2487: 個原則才變成如此 12/09 17:08
clonsey1314: 原來如此,感恩! 12/09 17:11