Browse Source

* do not generate an andi if the constant is 255

git-svn-id: trunk@37608 -
florian 7 years ago
parent
commit
cb087279d6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/avr/cgcpu.pas

+ 1 - 1
compiler/avr/cgcpu.pas

@@ -840,7 +840,7 @@ unit cgcpu;
                  begin
                  begin
                    if ((qword(a) and mask) shr shift)=0 then
                    if ((qword(a) and mask) shr shift)=0 then
                      list.concat(taicpu.op_reg_reg(A_MOV,reg,NR_R1))
                      list.concat(taicpu.op_reg_reg(A_MOV,reg,NR_R1))
-                   else
+                   else if ((qword(a) and mask) shr shift)<>$ff then
                      list.concat(taicpu.op_reg_const(A_ANDI,reg,(qword(a) and mask) shr shift));
                      list.concat(taicpu.op_reg_const(A_ANDI,reg,(qword(a) and mask) shr shift));
                    { check if we are not in the last iteration to avoid an internalerror in GetNextReg }
                    { check if we are not in the last iteration to avoid an internalerror in GetNextReg }
                    if i<tcgsize2size[size] then
                    if i<tcgsize2size[size] then