瀏覽代碼

- Cleaned out REGCALL defines

git-svn-id: trunk@19482 -
sergei 14 年之前
父節點
當前提交
b36a930f26
共有 6 個文件被更改,包括 2 次插入193 次删除
  1. 1 93
      rtl/i386/i386.inc
  2. 0 10
      rtl/i386/int64p.inc
  3. 0 4
      rtl/i386/mathu.inc
  4. 0 13
      rtl/i386/setjump.inc
  5. 0 65
      rtl/i386/strings.inc
  6. 1 8
      rtl/i386/stringss.inc

+ 1 - 93
rtl/i386/i386.inc

@@ -95,7 +95,7 @@ function mmx_support : boolean;
   end;
 
 {$ifndef FPC_PIC}
-{$if not defined(FPC_SYSTEM_HAS_MOVE) and defined(REGCALL) }
+{$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define USE_FASTMOVE}
 {$i fastmove.inc}
 {$endif FPC_SYSTEM_HAS_MOVE}
@@ -137,15 +137,9 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,%esi
         movl    %edx,%edi
         movl    %ecx,%edx
-{$else}
-        movl    dest,%edi
-        movl    source,%esi
-        movl    count,%edx
-{$endif}
         movl    %edi,%eax
 { check for zero or negative count }
         cmpl    $0,%edx
@@ -259,15 +253,9 @@ var
   saveedi : longint;
 asm
         movl    %edi,saveedi
-{$ifdef REGCALL}
         movl    %eax,%edi
         movzwl  %cx,%eax
         movl    %edx,%ecx
-{$else}
-        movl    x,%edi
-        movl    count,%ecx
-        movzwl  value,%eax
-{$endif}
 { check for zero or negative count }
         cmpl    $0,%ecx
         jle     .LFillWordEnd
@@ -296,15 +284,9 @@ var
   saveedi : longint;
 asm
         movl    %edi,saveedi
-{$ifdef REGCALL}
         movl    %eax,%edi
         movl    %ecx,%eax
         movl    %edx,%ecx
-{$else}
-        movl    x,%edi
-        movl    count,%ecx
-        movl    value,%eax
-{$endif}
 { check for zero or negative count }
         cmpl    $0,%ecx
         jle     .LFillDWordEnd
@@ -391,15 +373,9 @@ var
 asm
         movl    %edi,saveedi
         movl    %ebx,saveebx
-{$ifdef REGCALL}
         movl    %eax,%edi
         movl    %ecx,%ebx
         movl    %edx,%ecx
-{$else}
-        movl    Len,%ecx       // Load len
-        movl    Buf,%edi       // Load String
-        movl    b,%ebx
-{$endif}
         xorl    %eax,%eax
         testl   %ecx,%ecx
         jz      .Lcharposnotfound
@@ -645,14 +621,8 @@ asm
         movl    %ebx,saveebx
 // Can't use scasb, or will have to do it twice, think this
 //   is faster for small "len"
-{$ifdef REGCALL}
         movl    %eax,%esi        // Load address
         movzbl  %cl,%ebx          // Load searchpattern
-{$else}
-        movl    Buf,%esi        // Load address
-        movl    len,%edx        // load maximal searchdistance
-        movzbl  b,%ebx          // Load searchpattern
-{$endif}
         testl   %edx,%edx
         je      .LFound
         xorl    %ecx,%ecx       // zero index in Buf
@@ -749,11 +719,7 @@ procedure fpc_shortstr_to_shortstr(out res:shortstring; const sstr: shortstring)
         cld
         movl    res,%edi
         movl    sstr,%esi
-{$ifdef regcall}
         movl    %edx,%ecx
-{$else regcall}
-        movl    res+4,%ecx
-{$endif regcall}
         xorl    %eax,%eax
         lodsb
         cmpl    %ecx,%eax
@@ -1051,20 +1017,13 @@ asm
         movl    %ebx,saveebx
         movl    %esi,saveesi
         movl    %edi,saveedi
-{$ifdef regcall}
         movl    %ecx,%esi
         movl    %eax,%edi
         movl    %edi,saveres
-{$else}
-        movl    p,%esi
-{$endif}
         movl    $1,%ecx
         testl   %esi,%esi
         movl    %esi,%eax
         jz      .LStrPasDone
-{$ifndef REGCALL}
-        movl    res,%edi
-{$endif}
         leal    3(%esi),%edx
         andl    $-4,%edx
         // skip length byte
@@ -1127,11 +1086,7 @@ asm
         incb    %cl
         jnz     .LStrPasEndLoop
 .LStrPasDone:
-{$ifdef REGCALL}
         movl    saveres,%edi
-{$else}
-        movl    res,%edi
-{$endif}
         addb    $255,%cl
         movb    %cl,(%edi)
         movl    saveesi,%esi
@@ -1159,11 +1114,7 @@ asm
         pop   %eax
 {$endif FPC_PROFILE}
         movl    %edi,saveedi
-{$ifdef REGCALL}
         movl    %eax,%edi
-{$else}
-        movl    p,%edi
-{$endif}
         movl    $0xffffffff,%ecx
         xorl    %eax,%eax
 	test    %edi,%edi
@@ -1190,9 +1141,6 @@ end;
 {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
 function get_caller_addr(framebp:pointer):pointer;nostackframe;assembler;
 asm
-{$ifndef REGCALL}
-        movl    framebp,%eax
-{$endif}
         orl     %eax,%eax
         jz      .Lg_a_null
         movl    4(%eax),%eax
@@ -1203,9 +1151,6 @@ end;
 {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
 function get_caller_frame(framebp:pointer):pointer;nostackframe;assembler;
 asm
-{$ifndef REGCALL}
-        movl    framebp,%eax
-{$endif}
         orl     %eax,%eax
         jz      .Lgnf_null
         movl    (%eax),%eax
@@ -1344,9 +1289,6 @@ end;
 function cpudeclocked(var l : longint) : boolean;assembler;nostackframe;
 
   asm
-{$ifndef REGCALL}
-     movl       l,%eax
-{$endif}
      { this check should be done because a lock takes a lot }
      { of time!                                             }
      lock
@@ -1358,9 +1300,6 @@ function cpudeclocked(var l : longint) : boolean;assembler;nostackframe;
 procedure cpuinclocked(var l : longint);assembler;nostackframe;
 
   asm
-{$ifndef REGCALL}
-     movl       l,%eax
-{$endif}
      lock
      incl       (%eax)
   end;
@@ -1392,13 +1331,8 @@ end;
 
 function InterLockedDecrement (var Target: longint) : longint; assembler;
 asm
-{$ifdef REGCALL}
         movl    $-1,%edx
         xchgl   %edx,%eax
-{$else}
-        movl    Target, %edx
-        movl    $-1, %eax
-{$endif}
         lock
         xaddl   %eax, (%edx)
         decl    %eax
@@ -1407,13 +1341,8 @@ end;
 
 function InterLockedIncrement (var Target: longint) : longint; assembler;
 asm
-{$ifdef REGCALL}
         movl    $1,%edx
         xchgl   %edx,%eax
-{$else}
-        movl    Target, %edx
-        movl    $1, %eax
-{$endif}
         lock
         xaddl   %eax, (%edx)
         incl    %eax
@@ -1422,25 +1351,14 @@ end;
 
 function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
 asm
-{$ifdef REGCALL}
         xchgl   (%eax),%edx
         movl    %edx,%eax
-{$else}
-        movl    Target,%ecx
-        movl    Source,%eax
-        xchgl   (%ecx),%eax
-{$endif}
 end;
 
 
 function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
 asm
-{$ifdef REGCALL}
         xchgl   %eax,%edx
-{$else}
-        movl    Target,%edx
-        movl    Source,%eax
-{$endif}
         lock
         xaddl   %eax, (%edx)
 end;
@@ -1448,13 +1366,7 @@ end;
 
 function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint; assembler;
 asm
-{$ifdef REGCALL}
         xchgl   %eax,%ecx
-{$else}
-        movl    Target,%ecx
-        movl    NewValue,%edx
-        movl    Comperand,%eax
-{$endif}
         lock
         cmpxchgl   %edx, (%ecx)
 end;
@@ -1464,11 +1376,7 @@ function InterlockedCompareExchange64(var Target: int64; NewValue: int64; Comper
 asm
         pushl       %ebx
         pushl       %edi
-{$ifdef REGCALL}
         movl        %eax,%edi
-{$else}
-        movl        Target,%edi
-{$endif}
         movl        Comperand+4,%edx
         movl        Comperand+0,%eax
         movl        NewValue+4,%ecx

+ 0 - 10
rtl/i386/int64p.inc

@@ -30,13 +30,8 @@
             movl %ecx,%eax
             orl %ebx,%eax
             jnz .Lnodivzero
-{$ifdef REGCALL}
             movl  %ebp,%edx
             movl  $200,%eax
-{$else}
-            pushl %ebp
-            pushl $200
-{$endif}
             call HandleErrorFrame
             jmp .Lexit
 .Lnodivzero:
@@ -104,13 +99,8 @@
             movl %ecx,%eax
             orl %ebx,%eax
             jnz .Lnodivzero
-{$ifdef REGCALL}
             movl  %ebp,%edx
             movl  $200,%eax
-{$else}
-            pushl %ebp
-            pushl $200
-{$endif}
             call HandleErrorFrame
             jmp .Lexit
 .Lnodivzero:

+ 0 - 4
rtl/i386/mathu.inc

@@ -28,10 +28,6 @@ procedure sincos(theta : float;out sinus,cosinus : float);assembler;
   asm
     fldt theta
     fsincos
-{$ifndef regcall}
-    movl  sinus, %eax
-    movl  cosinus, %edx
-{$endif}
     fstpt (%edx)
     fstpt (%eax)
     fwait

+ 0 - 13
rtl/i386/setjump.inc

@@ -15,18 +15,11 @@
 
 Function fpc_SetJmp (Var S : Jmp_buf) : longint;assembler;nostackframe;[Public, alias : 'FPC_SETJMP']; compilerproc;
 asm
-{$ifndef REGCALL}
-  movl 4(%esp),%eax
-{$endif}
   movl %ebx,Jmp_buf.ebx(%eax)
   movl %esi,Jmp_buf.esi(%eax)
   movl %edi,Jmp_buf.edi(%eax)
   movl %ebp,Jmp_buf.bp(%eax)
-{$ifdef REGCALL}
   leal 4(%esp),%edi
-{$else}
-  leal 8(%esp),%edi
-{$endif}
   movl %edi,Jmp_buf.sp(%eax)
   movl (%esp),%edi
   movl %edi,Jmp_buf.pc(%eax)
@@ -37,13 +30,7 @@ end;
 
 Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
 asm
-{$ifdef REGCALL}
   xchgl %edx,%eax
-{$else}
-  movl 4(%esp),%edx
-  movl 8(%esp),%eax
-{$endif}
-
   movl Jmp_buf.ebx(%edx),%ebx
   movl Jmp_buf.esi(%edx),%esi
   movl Jmp_buf.edi(%edx),%edi

+ 0 - 65
rtl/i386/strings.inc

@@ -24,23 +24,15 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,saveeax
         movl    %edx,%edi
-{$else}
-        movl    source,%edi
-{$endif}
         testl   %edi,%edi
         jz      .LStrCopyDone
         leal    3(%edi),%ecx
         andl    $-4,%ecx
         movl    %edi,%esi
         subl    %edi,%ecx
-{$ifdef REGCALL}
         movl    %eax,%edi
-{$else}
-        movl    dest,%edi
-{$endif}
         jz      .LStrCopyAligned
 .LStrCopyAlignLoop:
         movb    (%esi),%al
@@ -84,11 +76,7 @@ asm
 .LStrCopyByte:
         movb    %al,(%edi)
 .LStrCopyDone:
-{$ifdef REGCALL}
         movl    saveeax,%eax
-{$else}
-        movl    dest,%eax
-{$endif}
         movl    saveedi,%edi
         movl    saveesi,%esi
 end;
@@ -197,10 +185,8 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,saveeax
         movl    %edx,saveedx
-{$endif}
         movl    str2,%edi
         movl    $0xffffffff,%ecx
         cld
@@ -208,13 +194,8 @@ asm
         repne
         scasb
         not     %ecx
-{$ifdef REGCALL}
         movl    saveedx,%edi
         movl    saveeax,%esi
-{$else}
-        movl    str2,%edi
-        movl    str1,%esi
-{$endif}
         repe
         cmpsb
         movb    -1(%esi),%al
@@ -235,11 +216,9 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,saveeax
         movl    %edx,saveedx
         movl    %ecx,saveecx
-{$endif}
         movl    str2,%edi
         movl    $0xffffffff,%ecx
         cld
@@ -247,21 +226,12 @@ asm
         repne
         scasb
         not     %ecx
-{$ifdef REGCALL}
         cmpl    saveecx,%ecx
         jl      .LSTRLCOMP1
         movl    saveecx,%ecx
 .LSTRLCOMP1:
         movl    saveedx,%edi
         movl    saveeax,%esi
-{$else}
-        cmpl    l,%ecx
-        jl      .LSTRLCOMP1
-        movl    l,%ecx
-.LSTRLCOMP1:
-        movl    str2,%edi
-        movl    str1,%esi
-{$endif}
         repe
         cmpsb
         movb    -1(%esi),%al
@@ -282,10 +252,8 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,saveeax
         movl    %edx,saveedx
-{$endif}
         movl    str2,%edi
         movl    $0xffffffff,%ecx
         cld
@@ -293,13 +261,8 @@ asm
         repne
         scasb
         not     %ecx
-{$ifdef REGCALL}
         movl    saveedx,%edi
         movl    saveeax,%esi
-{$else}
-        movl    str2,%edi
-        movl    str1,%esi
-{$endif}
 .LSTRICOMP2:
         repe
         cmpsb
@@ -336,11 +299,9 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifdef REGCALL}
         movl    %eax,saveeax
         movl    %edx,saveedx
         movl    %ecx,saveecx
-{$endif}
         movl    str2,%edi
         movl    $0xffffffff,%ecx
         cld
@@ -348,21 +309,12 @@ asm
         repne
         scasb
         not     %ecx
-{$ifdef REGCALL}
         cmpl    saveecx,%ecx
         jl      .LSTRLICOMP5
         movl    saveecx,%ecx
 .LSTRLICOMP5:
         movl    saveedx,%edi
         movl    saveeax,%esi
-{$else}
-        cmpl    l,%ecx
-        jl      .LSTRLICOMP5
-        movl    l,%ecx
-.LSTRLICOMP5:
-        movl    str2,%edi
-        movl    str1,%esi
-{$endif}
 .LSTRLICOMP2:
         repe
         cmpsb
@@ -399,9 +351,6 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifndef REGCALL}
-        movl    p,%eax
-{$endif}
         xorl    %ecx,%ecx
         testl   %eax,%eax
         jz      .LSTRSCAN
@@ -524,15 +473,11 @@ end;
 {$define FPC_UNIT_HAS_STRRSCAN}
 function strrscan(p : pchar;c : char) : pchar;assembler;
 var
-  {$ifdef regcall}
   saveeax,
-  {$endif}
   saveedi : longint;
 asm
         movl    %edi,saveedi
-{$ifdef regcall}
         movl    %eax,saveeax
-{$endif regcall}
         movl    p,%edi
         xorl    %eax,%eax
         orl     %edi,%edi
@@ -544,11 +489,7 @@ asm
         scasb
         not     %ecx
         movb    c,%al
-{$ifdef regcall}
         movl    saveeax,%edi
-{$else}
-        movl    p,%edi
-{$endif}
         addl    %ecx,%edi
         decl    %edi
         std
@@ -573,9 +514,6 @@ var
 asm
         movl    %edi,saveedi
         movl    %esi,saveesi
-{$ifndef REGCALL}
-        movl    p,%eax
-{$endif}
         movl    %eax,saveeax
         movl    p,%esi
         orl     %esi,%esi
@@ -608,9 +546,6 @@ var
 asm
         movl    %esi,saveesi
         movl    %edi,saveedi
-{$ifndef REGCALL}
-        movl    p,%eax
-{$endif}
         movl    %eax,saveeax
         movl    p,%esi
         orl     %esi,%esi

+ 1 - 8
rtl/i386/stringss.inc

@@ -24,21 +24,14 @@ asm
         movl    %edi,saveedi
         movl    %esi,saveesi
         cld
-{$ifdef REGCALL}
+
         movl    %eax,%edi          // load destination address
         movl    %edx,%esi          // Load Source adress
-{$else}
-        movl    s,%esi          // Load Source adress
-        movl    d,%edi          // load destination address
-{$endif}
         movzbl  (%esi),%ecx        // load length in ECX
         incl    %esi
         rep
         movsb
         movb    $0,(%edi)
-{$ifndef REGCALL}
-        movl    d,%eax       // return value to EAX
-{$endif}
         movl    saveedi,%edi
         movl    saveesi,%esi
 end;