Просмотр исходного кода

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 лет назад
Родитель
Сommit
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;