浏览代码

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 年之前
父节点
当前提交
a6d79950ff
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      source/FoxARMBackend.Mod

+ 1 - 0
source/FoxARMBackend.Mod

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