فهرست منبع

m68k: fixed the signedness of conditional jumps while creating the jump list for case statements

git-svn-id: trunk@36210 -
Károly Balogh 8 سال پیش
والد
کامیت
ca1ec0435d
2فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 1 2
      compiler/m68k/cgcpu.pas
  2. 4 4
      compiler/m68k/n68kset.pas

+ 1 - 2
compiler/m68k/cgcpu.pas

@@ -75,6 +75,7 @@ unit cgcpu;
         procedure a_jmp_name(list : TAsmList;const s : string); override;
         procedure a_jmp_always(list : TAsmList;l: tasmlabel); override;
         procedure a_jmp_flags(list : TAsmList;const f : TResFlags;l: tasmlabel); override;
+        procedure a_jmp_cond(list : TAsmList;cond : TOpCmp;l: tasmlabel);
         procedure g_flags2reg(list: TAsmList; size: TCgSize; const f: tresflags; reg: TRegister); override;
 
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);override;
@@ -106,8 +107,6 @@ unit cgcpu;
         procedure call_rtl_mul_const_reg(list:tasmlist;size:tcgsize;a:tcgint;reg:tregister;const name:string);
         procedure call_rtl_mul_reg_reg(list:tasmlist;reg1,reg2:tregister;const name:string);
         procedure check_register_size(size:tcgsize;reg:tregister);
-     private
-        procedure a_jmp_cond(list : TAsmList;cond : TOpCmp;l: tasmlabel);
      end;
 
      tcg64f68k = class(tcg64f32)

+ 4 - 4
compiler/m68k/n68kset.pas

@@ -45,7 +45,7 @@ implementation
       aasmtai,aasmdata,
       nflw,constexp,
       cgutils,cgobj,hlcgobj,
-      defutil;
+      defutil,cgcpu;
 
     procedure tcpucasenode.genlinearlist(hp : pcaselabel);
 
@@ -71,7 +71,7 @@ implementation
                else
                  begin
                    hlcg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, tcgint(t^._low.svalue-last.svalue), hregister);
-                   hlcg.a_jmp_flags(current_asmdata.CurrAsmList,F_E,blocklabel(t^.blockid));
+                   tcg68k(cg).a_jmp_cond(current_asmdata.CurrAsmList,OC_EQ,blocklabel(t^.blockid));
                  end;
                last:=t^._low;
              end
@@ -92,10 +92,10 @@ implementation
                     { present label then the lower limit can be checked    }
                     { immediately. else check the range in between:       }
                     hlcg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, tcgint(t^._low.svalue-last.svalue), hregister);
-                    hlcg.a_jmp_flags(current_asmdata.CurrAsmList,F_L,elselabel);
+                    tcg68k(cg).a_jmp_cond(current_asmdata.CurrAsmList, jmp_lt, elselabel);
                   end;
                 hlcg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, tcgint(t^._high.svalue-t^._low.svalue), hregister);
-                hlcg.a_jmp_flags(current_asmdata.CurrAsmList,F_LE,blocklabel(t^.blockid));
+                tcg68k(cg).a_jmp_cond(current_asmdata.CurrAsmList, jmp_le, blocklabel(t^.blockid));
                 last:=t^._high;
              end;
            first:=false;