Browse Source

* SPARC: convert carry flag into register without branching.

git-svn-id: trunk@27619 -
sergei 11 years ago
parent
commit
f20b6c73ef
1 changed files with 15 additions and 5 deletions
  1. 15 5
      compiler/sparc/cgcpu.pas

+ 15 - 5
compiler/sparc/cgcpu.pas

@@ -935,11 +935,21 @@ implementation
       var
       var
         hl : tasmlabel;
         hl : tasmlabel;
       begin
       begin
-        current_asmdata.getjumplabel(hl);
-        a_load_const_reg(list,size,1,reg);
-        a_jmp_flags(list,f,hl);
-        a_load_const_reg(list,size,0,reg);
-        a_label(list,hl);
+        if (f in [F_B]) then
+          list.concat(taicpu.op_reg_reg_reg(A_ADDX,NR_G0,NR_G0,reg))
+        else if (f in [F_AE]) then
+          begin
+            a_load_const_reg(list,size,1,reg);
+            list.concat(taicpu.op_reg_reg_reg(A_SUBX,reg,NR_G0,reg));
+          end
+        else
+          begin
+            current_asmdata.getjumplabel(hl);
+            a_load_const_reg(list,size,1,reg);
+            a_jmp_flags(list,f,hl);
+            a_load_const_reg(list,size,0,reg);
+            a_label(list,hl);
+          end;
       end;
       end;