4.57
A.
consider load/use hazard
E_icode in { IMRMOVQ, IPOPQ } && E_dstM in { d_srcA, d_srcB };
situation | 1 | 2 | 3 | 4 |
---|---|---|---|---|
E_dstM == d_srcA | 1 | 1 | 0 | 0 |
E_dstM == d_srcB | 1 | 0 | 1 | 0 |
situation 4:
normal, no hazard happens
situation 1,2,3:
load/use hazard happens
if E_icode in { IMRMOVQ, IPOPQ }, then E_dstM must not be RNONE
consider situation 1 and 3, E_dstM == d_srcB, then d_srcB is not RNONE and must
be used in phase E, so load-forward can’t work. load-forward only work in situation 2!
consider all the instructions that d_srcA is not RNONE
instructions | d_srcA | valA used in phase E? | load-forward works? |
---|---|---|---|
rrmovq | rA | Y | N |
rmmovq | rA | N | Y |
opq | rA | Y | N |
pushq | rA | N | Y |
ret | rsp | N | N |
popq | rsp | N | N |
ret and popq can’t work because d_srcA == d_srcB == %rsp, that’s not in
situation 2!!
finally, load/use only work in condition:
E_icode in { IMRMOVQ, IPOPQ } &&
(
E_dstM == d_srcB ||
(
E_dstM == d_srcA && !(D_icode in { IRMMOVQ, IPUSHQ })
)
);
B.
check file ./chapter4/code/sim/pipe/pipe-lf.hcl
only watch changes with origin pipe-lf.hcl
(cd ./chapter4/code/sim/pipe; diff -u origin-pipe-lf.hcl pipe-lf.hcl)
!INCLUDE './code/sim/pipe/pipe-lf.diff'
当前内容版权归 DreamAndDead 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 DreamAndDead .