|
@@ -39,8 +39,6 @@ unit aoptcpu;
|
|
|
function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
|
|
|
function PeepHoleOptPass2Cpu(var p: tai): boolean; override;
|
|
|
function PostPeepHoleOptsCpu(var p : tai) : boolean; override;
|
|
|
-
|
|
|
- procedure PostPeepHoleOpts; override;
|
|
|
end;
|
|
|
|
|
|
Var
|
|
@@ -299,6 +297,7 @@ unit aoptcpu;
|
|
|
taicpu(p).opcode := A_MOV;
|
|
|
taicpu(p).changeopsize(S_B);
|
|
|
setsubreg(taicpu(p).oper[1]^.reg,R_SUBL);
|
|
|
+ Result := True;
|
|
|
end;
|
|
|
end;
|
|
|
else
|
|
@@ -320,6 +319,7 @@ unit aoptcpu;
|
|
|
taicpu(p).changeopsize(S_B);
|
|
|
setsubreg(taicpu(p).oper[1]^.reg,R_SUBL);
|
|
|
InsertLLItem(p.previous, p, hp1);
|
|
|
+ Result := True;
|
|
|
end;
|
|
|
end;
|
|
|
A_TEST, A_OR:
|
|
@@ -329,6 +329,11 @@ unit aoptcpu;
|
|
|
else
|
|
|
;
|
|
|
end;
|
|
|
+
|
|
|
+ { Optimise any reference-type operands (if Result is True, the
|
|
|
+ instruction will be checked on the next iteration) }
|
|
|
+ if not Result then
|
|
|
+ OptimizeRefs(taicpu(p));
|
|
|
end;
|
|
|
else
|
|
|
;
|
|
@@ -336,13 +341,6 @@ unit aoptcpu;
|
|
|
end;
|
|
|
|
|
|
|
|
|
- procedure TCpuAsmOptimizer.PostPeepHoleOpts;
|
|
|
- begin
|
|
|
- inherited;
|
|
|
- OptReferences;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
begin
|
|
|
casmoptimizer:=TCpuAsmOptimizer;
|
|
|
end.
|