Browse Source

* use volatile registers first
* fix some range check errors

git-svn-id: trunk@30444 -

florian 10 years ago
parent
commit
63bf17440c
1 changed files with 6 additions and 9 deletions
  1. 6 9
      compiler/avr/cgcpu.pas

+ 6 - 9
compiler/avr/cgcpu.pas

@@ -135,12 +135,9 @@ unit cgcpu;
       begin
       begin
         inherited init_register_allocators;
         inherited init_register_allocators;
         rg[R_INTREGISTER]:=trgintcpu.create(R_INTREGISTER,R_SUBWHOLE,
         rg[R_INTREGISTER]:=trgintcpu.create(R_INTREGISTER,R_SUBWHOLE,
-            [RS_R8,RS_R9,
-             RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15,RS_R16,RS_R17,RS_R18,RS_R19,
-             RS_R20,RS_R21,RS_R22,RS_R23,RS_R24,RS_R25,
-             RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7],first_int_imreg,[]);
-        { rg[R_ADDRESSREGISTER]:=trgintcpu.create(R_ADDRESSREGISTER,R_SUBWHOLE,
-            [RS_R26,RS_R30],first_int_imreg,[]); }
+            [RS_R18,RS_R19,RS_R20,RS_R21,RS_R22,RS_R23,RS_R24,RS_R25,
+             RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,RS_R9,
+             RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15,RS_R16,RS_R17],first_int_imreg,[]);
       end;
       end;
 
 
 
 
@@ -683,7 +680,7 @@ unit cgcpu;
              begin
              begin
                for i:=1 to tcgsize2size[size] do
                for i:=1 to tcgsize2size[size] do
                  begin
                  begin
-                   list.concat(taicpu.op_reg_const(A_ORI,reg,(a and mask) shr shift));
+                   list.concat(taicpu.op_reg_const(A_ORI,reg,(qword(a) and mask) shr shift));
                    NextReg;
                    NextReg;
                    mask:=mask shl 8;
                    mask:=mask shl 8;
                    inc(shift,8);
                    inc(shift,8);
@@ -693,7 +690,7 @@ unit cgcpu;
              begin
              begin
                for i:=1 to tcgsize2size[size] do
                for i:=1 to tcgsize2size[size] do
                  begin
                  begin
-                   list.concat(taicpu.op_reg_const(A_ANDI,reg,(a and mask) shr shift));
+                   list.concat(taicpu.op_reg_const(A_ANDI,reg,(qword(a) and mask) shr shift));
                    NextReg;
                    NextReg;
                    mask:=mask shl 8;
                    mask:=mask shl 8;
                    inc(shift,8);
                    inc(shift,8);
@@ -709,7 +706,7 @@ unit cgcpu;
                        NextReg;
                        NextReg;
                        mask:=mask shl 8;
                        mask:=mask shl 8;
                        inc(shift,8);
                        inc(shift,8);
-                       list.concat(taicpu.op_reg_const(A_SBCI,reg,(a and mask) shr shift));
+                       list.concat(taicpu.op_reg_const(A_SBCI,reg,(qword(a) and mask) shr shift));
                      end;
                      end;
                  end;
                  end;
              end;
              end;