Ver Fonte

Patched problem with immediate encoding for FP and ABS for double precision FP

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6767 8c9fc860-2736-0410-a75d-ab315db34111
felixf há 9 anos atrás
pai
commit
2a33021d59
1 ficheiros alterados com 6 adições e 3 exclusões
  1. 6 3
      source/FoxARMBackend.Mod

+ 6 - 3
source/FoxARMBackend.Mod

@@ -1596,9 +1596,7 @@ TYPE
 		BEGIN
 		BEGIN
 			intValue := SYSTEM.VAL(LONGINT, value);
 			intValue := SYSTEM.VAL(LONGINT, value);
 			(* alternative: integerValue := BinaryCode.ConvertReal(value) *)
 			(* alternative: integerValue := BinaryCode.ConvertReal(value) *)
-
-			temp := GetFreeRegisterOrHint(IntermediateCode.UnsignedIntegerType(32), registerHint);
-			dummy := ValueComposition(intValue, TRUE, temp);
+			temp := RegisterFromValue(intValue, registerHint);
 			result := GetFreeRegisterOrHint(IntermediateCode.FloatType(32), registerHint);
 			result := GetFreeRegisterOrHint(IntermediateCode.FloatType(32), registerHint);
 			Emit2(opFMSR, result, temp);
 			Emit2(opFMSR, result, temp);
 
 
@@ -2234,6 +2232,11 @@ TYPE
 				PrepareSingleSourceOp(irInstruction, Low, destination[Low], source[Low]);
 				PrepareSingleSourceOp(irInstruction, Low, destination[Low], source[Low]);
 				Emit2(opFABSS, destination[Low], source[Low]);
 				Emit2(opFABSS, destination[Low], source[Low]);
 				WriteBack(irInstruction.op1, Low, destination[Low])
 				WriteBack(irInstruction.op1, Low, destination[Low])
+			ELSIF IsDoublePrecisionFloat(irInstruction.op1) THEN
+				ASSERT(backend.useFPU64);
+				PrepareSingleSourceOp(irInstruction, Low, destination[Low], source[Low]);
+				Emit2(opFABSD, destination[Low], source[Low]);
+				WriteBack(irInstruction.op1, Low, destination[Low])
 			ELSE
 			ELSE
 				HALT(200)
 				HALT(200)
 			END
 			END