瀏覽代碼

Updated localalign values, and changed the behaviour of alignment of load/stores to not break aligned half-word copies

git-svn-id: branches/laksen/arm-embedded@22828 -
Jeppe Johansen 12 年之前
父節點
當前提交
818b43c060
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 8 2
      compiler/arm/cgcpu.pas
  2. 2 2
      compiler/systems/i_embed.pas

+ 8 - 2
compiler/arm/cgcpu.pas

@@ -2213,6 +2213,12 @@ unit cgcpu;
             a_load_ref_reg(list,OS_32,OS_32,source,tmpreg);
             a_load_reg_ref(list,OS_32,OS_32,tmpreg,dest);
           end
+        else if aligned and (len=2) then
+          begin
+            tmpreg:=getintregister(list,OS_16);
+            a_load_ref_reg(list,OS_16,OS_16,source,tmpreg);
+            a_load_reg_ref(list,OS_16,OS_16,tmpreg,dest);
+          end
         else if (len<=helpsize) and aligned then
           begin
             tmpregi:=0;
@@ -2337,8 +2343,8 @@ unit cgcpu;
 
     procedure tcgarm.g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);
       begin
-        if (source.alignment in [1..3]) or
-          (dest.alignment in [1..3]) then
+        if (source.alignment in [1,3]) or
+          (dest.alignment in [1,3]) then
           g_concatcopy_internal(list,source,dest,len,false)
         else
           g_concatcopy_internal(list,source,dest,len,true);

+ 2 - 2
compiler/systems/i_embed.pas

@@ -79,8 +79,8 @@ unit i_embed;
                 constalignmax   : 4;
                 varalignmin     : 0;
                 varalignmax     : 4;
-                localalignmin   : 4;
-                localalignmax   : 8;
+                localalignmin   : 0;
+                localalignmax   : 4;
                 recordalignmin  : 0;
                 recordalignmax  : 4;
                 maxCrecordalign : 4