浏览代码

better version of the ColdFire TST.L 123(dX) fix, fixes regressions in tcnvint1 and 2

git-svn-id: trunk@25651 -
Károly Balogh 11 年之前
父节点
当前提交
55be015a4e
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 6 0
      compiler/m68k/cpubase.pas
  2. 1 1
      compiler/m68k/n68kcnv.pas

+ 6 - 0
compiler/m68k/cpubase.pas

@@ -347,6 +347,7 @@ unit cpubase;
     function std_regname(r:Tregister):string;
 
     function isaddressregister(reg : tregister) : boolean;
+    function isintregister(reg : tregister) : boolean;
 
     function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function conditions_equal(const c1, c2: TAsmCond): boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
@@ -502,6 +503,11 @@ implementation
         result:=getregtype(reg)=R_ADDRESSREGISTER;
       end;
 
+    function isintregister(reg : tregister) : boolean;
+      begin
+        result:=getregtype(reg)=R_INTREGISTER;
+      end;
+
 
     function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
       const

+ 1 - 1
compiler/m68k/n68kcnv.pas

@@ -212,7 +212,7 @@ implementation
                       begin
                         { Coldfire cannot handle tst.l 123(dX) }
                         if (current_settings.cputype in cpu_coldfire) and
-                           not (isaddressregister(left.location.reference.base)) then
+                           isintregister(left.location.reference.base) then
                           begin
                             tmpreference:=left.location.reference;
                             hreg2:=cg.getaddressregister(current_asmdata.CurrAsmList);