Просмотр исходного кода

* avoid uncessary zero extensions in case code

git-svn-id: trunk@21979 -
florian 13 лет назад
Родитель
Сommit
c5ad1bce7b
1 измененных файлов с 12 добавлено и 4 удалено
  1. 12 4
      compiler/arm/narmset.pas

+ 12 - 4
compiler/arm/narmset.pas

@@ -180,7 +180,9 @@ implementation
                   else
                     begin
                       tcgarm(cg).cgsetflags:=true;
-                      cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, aint(int64(t^._low-last)), hregister);
+                      { use OS_32 here to avoid uncessary sign extensions, at this place hregister will never be negative, because
+                        then genlinearlist wouldn't be used }
+                      cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, OS_32, aint(int64(t^._low-last)), hregister);
                       tcgarm(cg).cgsetflags:=false;
                       cg.a_jmp_flags(current_asmdata.CurrAsmList,F_EQ,blocklabel(t^.blockid));
                     end;
@@ -198,7 +200,9 @@ implementation
                        if (t^._low>get_min_value(left.resultdef)) or (get_min_value(left.resultdef)<>0) then
                          begin
                            tcgarm(cg).cgsetflags:=true;
-                           cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, aint(int64(t^._low)), hregister);
+                           { use OS_32 here to avoid uncessary sign extensions, at this place hregister will never be negative, because
+                             then genlinearlist wouldn't be use }
+                           cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, OS_32, aint(int64(t^._low)), hregister);
                            tcgarm(cg).cgsetflags:=false;
                          end;
                     end
@@ -209,7 +213,9 @@ implementation
                       { immediately. else check the range in between:       }
 
                       tcgarm(cg).cgsetflags:=true;
-                      cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, aint(int64(t^._low-last)), hregister);
+                      { use OS_32 here to avoid uncessary sign extensions, at this place hregister will never be negative, because
+                        then genlinearlist wouldn't be use }
+                      cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, OS_32, aint(int64(t^._low-last)), hregister);
                       tcgarm(cg).cgsetflags:=false;
                       { no jump necessary here if the new range starts at }
                       { at the value following the previous one           }
@@ -218,7 +224,9 @@ implementation
                         cg.a_jmp_flags(current_asmdata.CurrAsmList,cond_lt,elselabel);
                     end;
                   tcgarm(cg).cgsetflags:=true;
-                  cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SUB,opcgsize,aint(int64(t^._high-t^._low)),hregister);
+                  { use OS_32 here to avoid uncessary sign extensions, at this place hregister will never be negative, because
+                    then genlinearlist wouldn't be use }
+                  cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SUB,OS_32,aint(int64(t^._high-t^._low)),hregister);
                   tcgarm(cg).cgsetflags:=false;
                   cg.a_jmp_flags(current_asmdata.CurrAsmList,cond_le,blocklabel(t^.blockid));