正在加载图片...
The Code-Generation Algorithm Machine Instructions for Copy Statements -For x=y,getReg will always choose the same register for both xand y. Ify is not in that register Ry,generate instruction LD Ry,y. Ify was in Ry,do nothing. -Need to adjust the register description for Ry so that it includes x as one of the values. Ending the Basic Block - generate the instruction STx,R,where R is a register in which x's value exists at the end of the block ifx is live on exit from the block. CS308 Compiler Theory 6The Code-Generation Algorithm • Machine Instructions for Copy Statements – For x=y, getReg will always choose the same register for both xand y. – If y is not in that register Ry , generate instruction LD Ry , y. – If y was in Ry , do nothing do nothing. – Need to adjust the register description for Ry so that it includes x as one of the values. • Ending the Basic Block – generate the instruction ST x, R, where R is a register in which x's value exists at the end of the block if the block if x is live on exit from the block is live on exit from the block. CS308 Compiler Theory 6
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有