浏览代码

Same register allocation scheme for 32 and 64 Bit.
Reason: in one case the register spilling was different (and wrong in 64-bit) such that Streams.Reader.RawNum produced wrong results. Problem was the spilling on one branch (no spilling on the other) resulting in register confusion. This needs a more general handling.

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7428 8c9fc860-2736-0410-a75d-ab315db34111

felixf 7 年之前
父节点
当前提交
4f19b4ed93
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      source/FoxAMDBackend.Mod

+ 8 - 0
source/FoxAMDBackend.Mod

@@ -439,21 +439,29 @@ TYPE
 			IF type.form IN IntermediateCode.Integer THEN
 				IF type.sizeInBits = IntermediateCode.Bits8 THEN
 					i := GetHint(AL);
+					IF i = none THEN i := Get(BL, AL) END;
+					IF i = none THEN i := Get(BH, AH) END;
 					IF i = none THEN
 						i := Get(AL,R15B)
 					END;
 				ELSIF type.sizeInBits = IntermediateCode.Bits16 THEN
 					i := GetHint(AX);
+					IF i = none THEN i := Get(DI, SI) END;
+					IF i = none THEN i := Get(BX, AX) END;
 					IF i = none THEN
 						i := Get(AX,R15W);
 					END;
 				ELSIF type.sizeInBits = IntermediateCode.Bits32 THEN
 					i := GetHint(EAX);
+					IF i = none THEN i := Get(EDI,ESI) END;
+					IF i = none THEN i := Get(EBX,EAX) END;
 					IF i = none THEN
 						i := Get(EAX,R15D);
 					END;
 				ELSIF type.sizeInBits = IntermediateCode.Bits64 THEN
 					i := GetHint(RAX);
+					IF i = none THEN i := Get(RDI,RSI) END;
+					IF i = none THEN i := Get(RBX,RAX) END;
 					IF i = none THEN
 						i := Get(RAX, R15)
 					END;