Browse Source

* x86-64: do not jump in inc/declocked to return but return directly

florian 3 years ago
parent
commit
bdc826cc18
1 changed files with 14 additions and 8 deletions
  1. 14 8
      rtl/x86_64/x86_64.inc

+ 14 - 8
rtl/x86_64/x86_64.inc

@@ -691,10 +691,12 @@ function declocked(var l : longint) : boolean;assembler; nostackframe;
      jz         .Ldeclockednolock
      jz         .Ldeclockednolock
      lock
      lock
      decl       (%rcx)
      decl       (%rcx)
-     jmp        .Ldeclockedend
+     setzb      %al
+     ret
+// not supported yet by the internal assembler:   .p2align 4,,10
+    .p2align 3
 .Ldeclockednolock:
 .Ldeclockednolock:
      decl       (%rcx)
      decl       (%rcx)
-.Ldeclockedend:
      setzb      %al
      setzb      %al
   end;
   end;
 
 
@@ -716,10 +718,12 @@ function declocked(var l : int64) : boolean;assembler; nostackframe;
      jz         .Ldeclockednolock
      jz         .Ldeclockednolock
      lock
      lock
      decq       (%rcx)
      decq       (%rcx)
-     jmp        .Ldeclockedend
+     setzb      %al
+     ret
+// not supported yet by the internal assembler:    .p2align 4,,10
+    .p2align 3
 .Ldeclockednolock:
 .Ldeclockednolock:
      decq       (%rcx)
      decq       (%rcx)
-.Ldeclockedend:
      setzb      %al
      setzb      %al
   end;
   end;
 
 
@@ -742,10 +746,11 @@ procedure inclocked(var l : longint);assembler; nostackframe;
      jz         .Linclockednolock
      jz         .Linclockednolock
      lock
      lock
      incl       (%rcx)
      incl       (%rcx)
-     jmp        .Linclockedend
+     ret
+// not supported yet by the internal assembler:    .p2align 4,,10
+    .p2align 3
 .Linclockednolock:
 .Linclockednolock:
      incl       (%rcx)
      incl       (%rcx)
-.Linclockedend:
   end;
   end;
 
 
 
 
@@ -767,10 +772,11 @@ procedure inclocked(var l : int64);assembler; nostackframe;
      jz         .Linclockednolock
      jz         .Linclockednolock
      lock
      lock
      incq       (%rcx)
      incq       (%rcx)
-     jmp        .Linclockedend
+     ret
+// not supported yet by the internal assembler:    .p2align 4,,10
+    .p2align 3
 .Linclockednolock:
 .Linclockednolock:
      incq       (%rcx)
      incq       (%rcx)
-.Linclockedend:
   end;
   end;