Parcourir la source

* is_calljmp really means calls and jmp
* is_calljmpuncondret includes ret

florian il y a 3 ans
Parent
commit
5a2d884fe3
2 fichiers modifiés avec 6 ajouts et 7 suppressions
  1. 2 2
      compiler/x86/aoptx86.pas
  2. 4 5
      compiler/x86/cpubase.pas

+ 2 - 2
compiler/x86/aoptx86.pas

@@ -411,7 +411,7 @@ unit aoptx86;
       repeat
         Result := GetNextInstruction(Next,Next);
         if Result and (Next.typ=ait_instruction) and is_calljmp(taicpu(Next).opcode) then
-          if is_calljmpuncond(taicpu(Next).opcode) then
+          if is_calljmpuncondret(taicpu(Next).opcode) then
             begin
               Result := False;
               Exit;
@@ -3020,7 +3020,7 @@ unit aoptx86;
           end;
 
         { search further than the next instruction for a mov (as long as it's not a jump) }
-        if not is_calljmpuncond(taicpu(hp1).opcode) and
+        if not is_calljmpuncondret(taicpu(hp1).opcode) and
           { check as much as possible before the expensive GetNextInstructionUsingRegCond call }
           (taicpu(p).oper[1]^.typ = top_reg) and
           (taicpu(p).oper[0]^.typ in [top_reg,top_const]) and

+ 4 - 5
compiler/x86/cpubase.pas

@@ -340,7 +340,7 @@ topsize2memsize: array[topsize] of integer =
     function reg2opsize(r:Tregister):topsize;
     function reg_cgsize(const reg: tregister): tcgsize;
     function is_calljmp(o:tasmop):boolean;
-    function is_calljmpuncond(o:tasmop):boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
+    function is_calljmpuncondret(o:tasmop):boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     procedure inverse_flags(var f: TResFlags);
     function flags_to_cond(const f: TResFlags) : TAsmCond;
     function is_segment_reg(r:tregister):boolean;
@@ -570,7 +570,6 @@ implementation
           A_LOOPZ,
           A_LCALL,
           A_LJMP,
-          A_RET,
           A_Jcc :
             is_calljmp:=true;
           else
@@ -579,7 +578,7 @@ implementation
       end;
 
 
-    function is_calljmpuncond(o:tasmop):boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
+    function is_calljmpuncondret(o:tasmop):boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
       begin
         case o of
           A_CALL,
@@ -587,9 +586,9 @@ implementation
           A_RET,
           A_LCALL,
           A_LJMP:
-            is_calljmpuncond:=true;
+            Result:=true;
           else
-            is_calljmpuncond:=false;
+            Result:=false;
         end;
       end;