Browse Source

* make use of not_zero in tbasecgarm.a_bit_scan_reg_reg

florian 5 months ago
parent
commit
490c431bf9
1 changed files with 9 additions and 6 deletions
  1. 9 6
      compiler/arm/cgcpu.pas

+ 9 - 6
compiler/arm/cgcpu.pas

@@ -1841,12 +1841,15 @@ unit cgcpu;
           begin
           begin
             list.Concat(taicpu.op_reg_reg(A_RBIT,dst,src));
             list.Concat(taicpu.op_reg_reg(A_RBIT,dst,src));
             list.Concat(taicpu.op_reg_reg(A_CLZ,dst,dst));
             list.Concat(taicpu.op_reg_reg(A_CLZ,dst,dst));
-            a_reg_alloc(list,NR_DEFAULTFLAGS);
-            list.Concat(taicpu.op_reg_const(A_CMP,dst,32));
-            if GenerateThumb2Code then
-              list.Concat(taicpu.op_cond(A_IT, C_EQ));
-            list.Concat(setcondition(taicpu.op_reg_const(A_MOV,dst,$ff),C_EQ));
-            a_reg_dealloc(list,NR_DEFAULTFLAGS);
+            if not(not_zero) then
+              begin
+                a_reg_alloc(list,NR_DEFAULTFLAGS);
+                list.Concat(taicpu.op_reg_const(A_CMP,dst,32));
+                if GenerateThumb2Code then
+                  list.Concat(taicpu.op_cond(A_IT, C_EQ));
+                list.Concat(setcondition(taicpu.op_reg_const(A_MOV,dst,$ff),C_EQ));
+                a_reg_dealloc(list,NR_DEFAULTFLAGS);
+              end;
           end;
           end;
       end;
       end;