瀏覽代碼

m68k: when loading from a reference with zero extend, clear the register first, then load, instead of clearing with AND later, because this is faster on slow 68ks and also shorter

git-svn-id: trunk@34761 -
Károly Balogh 8 年之前
父節點
當前提交
4620d9b22c
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      compiler/m68k/cgcpu.pas

+ 8 - 1
compiler/m68k/cgcpu.pas

@@ -944,8 +944,15 @@ unit cgcpu;
            end
          else
            begin
+             if needsext and (fromsize in [OS_8,OS_16]) then
+               begin
+                 //list.concat(tai_comment.create(strpnew('a_load_ref_reg: zero ext')));
+                 a_load_const_reg(list,OS_32,0,hreg);
+                 needsext:=false;
+               end;
              list.concat(taicpu.op_ref_reg(A_MOVE,opsize,href,hreg));
-             sign_extend(list,size,hreg);
+             if needsext then
+               sign_extend(list,size,hreg);
            end;
 
          if hreg<>register then