Browse Source

Made sure that multiplication by power of 2s is possible without runtime call

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6882 8c9fc860-2736-0410-a75d-ab315db34111
felixf 8 years ago
parent
commit
a6d79950ff
1 changed files with 1 additions and 0 deletions
  1. 1 0
      source/FoxARMBackend.Mod

+ 1 - 0
source/FoxARMBackend.Mod

@@ -645,6 +645,7 @@ TYPE
 				ELSE
 					result :=  ~IsFloat(irInstruction.op1) OR backend.useFPU32 & IsSinglePrecisionFloat(irInstruction.op1) OR backend.useFPU64 & IsDoublePrecisionFloat(irInstruction.op1);
 				END;
+				result := result OR (irInstruction.opcode = IntermediateCode.mul) & IntermediateCode.IsConstantInteger(irInstruction.op3,value) & IntermediateBackend.PowerOf2(value,exp)
 
 			| IntermediateCode.div:
 				result :=  backend.useFPU32 & IsSinglePrecisionFloat(irInstruction.op1)