Преглед изворни кода

m68k: do not generate LEA instructions with explicitly specified size. only long is possible anyway.

Karoly Balogh пре 2 година
родитељ
комит
6bbb10e64d
2 измењених фајлова са 8 додато и 7 уклоњено
  1. 2 1
      compiler/m68k/aoptcpu.pas
  2. 6 6
      compiler/m68k/cgcpu.pas

+ 2 - 1
compiler/m68k/aoptcpu.pas

@@ -408,7 +408,7 @@ unit aoptcpu;
         (taicpu(p).oper[0]^.ref^.symbol=nil) and
         (taicpu(p).oper[0]^.ref^.symbol=nil) and
         (taicpu(p).oper[0]^.ref^.direction=dir_none) and
         (taicpu(p).oper[0]^.ref^.direction=dir_none) and
         GetNextInstruction(p,next) and
         GetNextInstruction(p,next) and
-        MatchInstruction(next,A_LEA,[S_L]) and
+        MatchInstruction(next,A_LEA,[S_NO]) and
         (taicpu(next).oper[1]^.reg=NR_A7) and
         (taicpu(next).oper[1]^.reg=NR_A7) and
         (taicpu(next).oper[0]^.ref^.base=NR_A7) and
         (taicpu(next).oper[0]^.ref^.base=NR_A7) and
         (taicpu(next).oper[0]^.ref^.index=NR_NO) and
         (taicpu(next).oper[0]^.ref^.index=NR_NO) and
@@ -469,6 +469,7 @@ unit aoptcpu;
                           else
                           else
                             reference_reset_base(tmpref,taicpu(p).oper[1]^.reg,taicpu(p).oper[0]^.val,ctempposinvalid,0,[]);
                             reference_reset_base(tmpref,taicpu(p).oper[1]^.reg,taicpu(p).oper[0]^.val,ctempposinvalid,0,[]);
                           taicpu(p).opcode:=A_LEA;
                           taicpu(p).opcode:=A_LEA;
+                          taicpu(p).opsize:=S_NO;
                           taicpu(p).loadref(0,tmpref);
                           taicpu(p).loadref(0,tmpref);
                           result:=true;
                           result:=true;
                         end;
                         end;

+ 6 - 6
compiler/m68k/cgcpu.pas

@@ -459,7 +459,7 @@ unit cgcpu;
                    href.base:=NR_PC;
                    href.base:=NR_PC;
                end;
                end;
 
 
-             list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+             list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,hreg));
              ref.offset:=0;
              ref.offset:=0;
              ref.symbol:=nil;
              ref.symbol:=nil;
 
 
@@ -496,7 +496,7 @@ unit cgcpu;
                      href.offset:=ref.offset;
                      href.offset:=ref.offset;
                      ref.offset:=0;
                      ref.offset:=0;
                    end;
                    end;
-                 list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+                 list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,hreg));
                  ref.base:=hreg;
                  ref.base:=hreg;
                  ref.index:=NR_NO;
                  ref.index:=NR_NO;
                  result:=true;
                  result:=true;
@@ -527,7 +527,7 @@ unit cgcpu;
                  if isvalue16bit(ref.offset) then
                  if isvalue16bit(ref.offset) then
                    begin
                    begin
                      reference_reset_base(href,ref.base,ref.offset,ref.temppos,ref.alignment,ref.volatility);
                      reference_reset_base(href,ref.base,ref.offset,ref.temppos,ref.alignment,ref.volatility);
-                     list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+                     list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,hreg));
                    end
                    end
                  else
                  else
                    begin
                    begin
@@ -557,7 +557,7 @@ unit cgcpu;
                  else
                  else
                    ref.base:=NR_PC;
                    ref.base:=NR_PC;
                end;
                end;
-             list.concat(taicpu.op_ref_reg(A_LEA,S_L,ref,hreg));
+             list.concat(taicpu.op_ref_reg(A_LEA,S_NO,ref,hreg));
              ref.base:=hreg;
              ref.base:=hreg;
              ref.index:=NR_NO;
              ref.index:=NR_NO;
              ref.scalefactor:=1;
              ref.scalefactor:=1;
@@ -1041,11 +1041,11 @@ unit cgcpu;
         if not isaddressregister(r) then
         if not isaddressregister(r) then
           begin
           begin
             hreg:=getaddressregister(list);
             hreg:=getaddressregister(list);
-            list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+            list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,hreg));
             a_load_reg_reg(list, OS_ADDR, OS_ADDR, hreg, r);
             a_load_reg_reg(list, OS_ADDR, OS_ADDR, hreg, r);
           end
           end
         else
         else
-          list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
+          list.concat(taicpu.op_ref_reg(A_LEA,S_NO,href,r));
       end;
       end;