瀏覽代碼

Added support for comparing complex unsigned values

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7762 8c9fc860-2736-0410-a75d-ab315db34111
eth.negelef 7 年之前
父節點
當前提交
780c02bf0d
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      source/FoxAMDBackend.Mod

+ 8 - 5
source/FoxAMDBackend.Mod

@@ -2869,18 +2869,21 @@ TYPE
 						END;
 					END;
 				ELSE
-					Assert(instruction.op2.type.form = IntermediateCode.SignedInteger,"no unsigned integer64");
 					Cmp(High,reverse);
 					CASE instruction.opcode OF
 					IntermediateCode.breq: hit := 0; fail := InstructionSet.opJNE;
 					|IntermediateCode.brne: hit := InstructionSet.opJNE; fail := 0;
 					|IntermediateCode.brge:
-						IF reverse THEN hit := InstructionSet.opJL; fail := InstructionSet.opJG;
-						ELSE hit := InstructionSet.opJG; fail := InstructionSet.opJL
+						IF instruction.op2.type.form = IntermediateCode.SignedInteger THEN
+							IF reverse THEN hit := InstructionSet.opJL; fail := InstructionSet.opJG ELSE hit := InstructionSet.opJG; fail := InstructionSet.opJL END;
+						ELSIF instruction.op2.type.form = IntermediateCode.UnsignedInteger THEN
+							IF reverse THEN hit := InstructionSet.opJB; fail := InstructionSet.opJA ELSE hit := InstructionSet.opJA; fail := InstructionSet.opJB END;
 						END;
 					|IntermediateCode.brlt:
-						IF reverse THEN hit := InstructionSet.opJG; fail := InstructionSet.opJL
-						ELSE hit := InstructionSet.opJL; fail := InstructionSet.opJG
+						IF instruction.op2.type.form = IntermediateCode.SignedInteger THEN
+							IF reverse THEN hit := InstructionSet.opJG; fail := InstructionSet.opJL ELSE hit := InstructionSet.opJL; fail := InstructionSet.opJG END;
+						ELSIF instruction.op2.type.form = IntermediateCode.UnsignedInteger THEN
+							IF reverse THEN hit := InstructionSet.opJA; fail := InstructionSet.opJB ELSE hit := InstructionSet.opJB; fail := InstructionSet.opJA END;
 						END;
 					END;
 					IF hit # 0 THEN JmpDest(hit)	END;