[理工] 計組兩題 caller/callee 和 設計原則

作者: clonsey1314 (Clonsey)   2017-12-09 16:18:31
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的負擔嗎?
作者: TampaBayRays (光芒今年拿冠軍)   2017-12-09 16:21:00
我記得第一題老師上課的時候是說這個就算是不好的指令集也要遵守所以不算
作者: TMDTMD2487 (ㄚ冰)   2017-12-09 16:27:00
第一個問題的d, 是無法改變的規格, 不然你不能解碼op放在那隨便但一定是要固定的不然無法解碼第二個的意思是說如果callee沒有local變數那對整體效能會比較好因為就不需要把caller的存到stack上述比較好就是跟caller存相比之下這裡benefit是針對整個執行的效率吧op的一致不是為了更好的ISA設計 是因為他不能不一致四個設計原則基本上就是說,照這樣設計比較好可是OP一致是必要的,感覺上就是不太能說是因為這四個原則才變成如此
作者: clonsey1314 (Clonsey)   2017-12-09 17:11:00
原來如此,感恩!

Links booklink

Contact Us: admin [ a t ] ucptt.com