mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 22:51:20 +02:00
- Cleaned out REGCALL defines
git-svn-id: trunk@19482 -
This commit is contained in:
parent
bbbc85bbf6
commit
b36a930f26
@ -95,7 +95,7 @@ function mmx_support : boolean;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifndef FPC_PIC}
|
{$ifndef FPC_PIC}
|
||||||
{$if not defined(FPC_SYSTEM_HAS_MOVE) and defined(REGCALL) }
|
{$ifndef FPC_SYSTEM_HAS_MOVE}
|
||||||
{$define USE_FASTMOVE}
|
{$define USE_FASTMOVE}
|
||||||
{$i fastmove.inc}
|
{$i fastmove.inc}
|
||||||
{$endif FPC_SYSTEM_HAS_MOVE}
|
{$endif FPC_SYSTEM_HAS_MOVE}
|
||||||
@ -137,15 +137,9 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%esi
|
movl %eax,%esi
|
||||||
movl %edx,%edi
|
movl %edx,%edi
|
||||||
movl %ecx,%edx
|
movl %ecx,%edx
|
||||||
{$else}
|
|
||||||
movl dest,%edi
|
|
||||||
movl source,%esi
|
|
||||||
movl count,%edx
|
|
||||||
{$endif}
|
|
||||||
movl %edi,%eax
|
movl %edi,%eax
|
||||||
{ check for zero or negative count }
|
{ check for zero or negative count }
|
||||||
cmpl $0,%edx
|
cmpl $0,%edx
|
||||||
@ -259,15 +253,9 @@ var
|
|||||||
saveedi : longint;
|
saveedi : longint;
|
||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
movzwl %cx,%eax
|
movzwl %cx,%eax
|
||||||
movl %edx,%ecx
|
movl %edx,%ecx
|
||||||
{$else}
|
|
||||||
movl x,%edi
|
|
||||||
movl count,%ecx
|
|
||||||
movzwl value,%eax
|
|
||||||
{$endif}
|
|
||||||
{ check for zero or negative count }
|
{ check for zero or negative count }
|
||||||
cmpl $0,%ecx
|
cmpl $0,%ecx
|
||||||
jle .LFillWordEnd
|
jle .LFillWordEnd
|
||||||
@ -296,15 +284,9 @@ var
|
|||||||
saveedi : longint;
|
saveedi : longint;
|
||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
movl %ecx,%eax
|
movl %ecx,%eax
|
||||||
movl %edx,%ecx
|
movl %edx,%ecx
|
||||||
{$else}
|
|
||||||
movl x,%edi
|
|
||||||
movl count,%ecx
|
|
||||||
movl value,%eax
|
|
||||||
{$endif}
|
|
||||||
{ check for zero or negative count }
|
{ check for zero or negative count }
|
||||||
cmpl $0,%ecx
|
cmpl $0,%ecx
|
||||||
jle .LFillDWordEnd
|
jle .LFillDWordEnd
|
||||||
@ -391,15 +373,9 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %ebx,saveebx
|
movl %ebx,saveebx
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
movl %ecx,%ebx
|
movl %ecx,%ebx
|
||||||
movl %edx,%ecx
|
movl %edx,%ecx
|
||||||
{$else}
|
|
||||||
movl Len,%ecx // Load len
|
|
||||||
movl Buf,%edi // Load String
|
|
||||||
movl b,%ebx
|
|
||||||
{$endif}
|
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
testl %ecx,%ecx
|
testl %ecx,%ecx
|
||||||
jz .Lcharposnotfound
|
jz .Lcharposnotfound
|
||||||
@ -645,14 +621,8 @@ asm
|
|||||||
movl %ebx,saveebx
|
movl %ebx,saveebx
|
||||||
// Can't use scasb, or will have to do it twice, think this
|
// Can't use scasb, or will have to do it twice, think this
|
||||||
// is faster for small "len"
|
// is faster for small "len"
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%esi // Load address
|
movl %eax,%esi // Load address
|
||||||
movzbl %cl,%ebx // Load searchpattern
|
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
|
testl %edx,%edx
|
||||||
je .LFound
|
je .LFound
|
||||||
xorl %ecx,%ecx // zero index in Buf
|
xorl %ecx,%ecx // zero index in Buf
|
||||||
@ -749,11 +719,7 @@ procedure fpc_shortstr_to_shortstr(out res:shortstring; const sstr: shortstring)
|
|||||||
cld
|
cld
|
||||||
movl res,%edi
|
movl res,%edi
|
||||||
movl sstr,%esi
|
movl sstr,%esi
|
||||||
{$ifdef regcall}
|
|
||||||
movl %edx,%ecx
|
movl %edx,%ecx
|
||||||
{$else regcall}
|
|
||||||
movl res+4,%ecx
|
|
||||||
{$endif regcall}
|
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
lodsb
|
lodsb
|
||||||
cmpl %ecx,%eax
|
cmpl %ecx,%eax
|
||||||
@ -1051,20 +1017,13 @@ asm
|
|||||||
movl %ebx,saveebx
|
movl %ebx,saveebx
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifdef regcall}
|
|
||||||
movl %ecx,%esi
|
movl %ecx,%esi
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
movl %edi,saveres
|
movl %edi,saveres
|
||||||
{$else}
|
|
||||||
movl p,%esi
|
|
||||||
{$endif}
|
|
||||||
movl $1,%ecx
|
movl $1,%ecx
|
||||||
testl %esi,%esi
|
testl %esi,%esi
|
||||||
movl %esi,%eax
|
movl %esi,%eax
|
||||||
jz .LStrPasDone
|
jz .LStrPasDone
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl res,%edi
|
|
||||||
{$endif}
|
|
||||||
leal 3(%esi),%edx
|
leal 3(%esi),%edx
|
||||||
andl $-4,%edx
|
andl $-4,%edx
|
||||||
// skip length byte
|
// skip length byte
|
||||||
@ -1127,11 +1086,7 @@ asm
|
|||||||
incb %cl
|
incb %cl
|
||||||
jnz .LStrPasEndLoop
|
jnz .LStrPasEndLoop
|
||||||
.LStrPasDone:
|
.LStrPasDone:
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl saveres,%edi
|
movl saveres,%edi
|
||||||
{$else}
|
|
||||||
movl res,%edi
|
|
||||||
{$endif}
|
|
||||||
addb $255,%cl
|
addb $255,%cl
|
||||||
movb %cl,(%edi)
|
movb %cl,(%edi)
|
||||||
movl saveesi,%esi
|
movl saveesi,%esi
|
||||||
@ -1159,11 +1114,7 @@ asm
|
|||||||
pop %eax
|
pop %eax
|
||||||
{$endif FPC_PROFILE}
|
{$endif FPC_PROFILE}
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
{$else}
|
|
||||||
movl p,%edi
|
|
||||||
{$endif}
|
|
||||||
movl $0xffffffff,%ecx
|
movl $0xffffffff,%ecx
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
test %edi,%edi
|
test %edi,%edi
|
||||||
@ -1190,9 +1141,6 @@ end;
|
|||||||
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
|
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
|
||||||
function get_caller_addr(framebp:pointer):pointer;nostackframe;assembler;
|
function get_caller_addr(framebp:pointer):pointer;nostackframe;assembler;
|
||||||
asm
|
asm
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl framebp,%eax
|
|
||||||
{$endif}
|
|
||||||
orl %eax,%eax
|
orl %eax,%eax
|
||||||
jz .Lg_a_null
|
jz .Lg_a_null
|
||||||
movl 4(%eax),%eax
|
movl 4(%eax),%eax
|
||||||
@ -1203,9 +1151,6 @@ end;
|
|||||||
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
|
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
|
||||||
function get_caller_frame(framebp:pointer):pointer;nostackframe;assembler;
|
function get_caller_frame(framebp:pointer):pointer;nostackframe;assembler;
|
||||||
asm
|
asm
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl framebp,%eax
|
|
||||||
{$endif}
|
|
||||||
orl %eax,%eax
|
orl %eax,%eax
|
||||||
jz .Lgnf_null
|
jz .Lgnf_null
|
||||||
movl (%eax),%eax
|
movl (%eax),%eax
|
||||||
@ -1344,9 +1289,6 @@ end;
|
|||||||
function cpudeclocked(var l : longint) : boolean;assembler;nostackframe;
|
function cpudeclocked(var l : longint) : boolean;assembler;nostackframe;
|
||||||
|
|
||||||
asm
|
asm
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl l,%eax
|
|
||||||
{$endif}
|
|
||||||
{ this check should be done because a lock takes a lot }
|
{ this check should be done because a lock takes a lot }
|
||||||
{ of time! }
|
{ of time! }
|
||||||
lock
|
lock
|
||||||
@ -1358,9 +1300,6 @@ function cpudeclocked(var l : longint) : boolean;assembler;nostackframe;
|
|||||||
procedure cpuinclocked(var l : longint);assembler;nostackframe;
|
procedure cpuinclocked(var l : longint);assembler;nostackframe;
|
||||||
|
|
||||||
asm
|
asm
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl l,%eax
|
|
||||||
{$endif}
|
|
||||||
lock
|
lock
|
||||||
incl (%eax)
|
incl (%eax)
|
||||||
end;
|
end;
|
||||||
@ -1392,13 +1331,8 @@ end;
|
|||||||
|
|
||||||
function InterLockedDecrement (var Target: longint) : longint; assembler;
|
function InterLockedDecrement (var Target: longint) : longint; assembler;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl $-1,%edx
|
movl $-1,%edx
|
||||||
xchgl %edx,%eax
|
xchgl %edx,%eax
|
||||||
{$else}
|
|
||||||
movl Target, %edx
|
|
||||||
movl $-1, %eax
|
|
||||||
{$endif}
|
|
||||||
lock
|
lock
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
decl %eax
|
decl %eax
|
||||||
@ -1407,13 +1341,8 @@ end;
|
|||||||
|
|
||||||
function InterLockedIncrement (var Target: longint) : longint; assembler;
|
function InterLockedIncrement (var Target: longint) : longint; assembler;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl $1,%edx
|
movl $1,%edx
|
||||||
xchgl %edx,%eax
|
xchgl %edx,%eax
|
||||||
{$else}
|
|
||||||
movl Target, %edx
|
|
||||||
movl $1, %eax
|
|
||||||
{$endif}
|
|
||||||
lock
|
lock
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
incl %eax
|
incl %eax
|
||||||
@ -1422,25 +1351,14 @@ end;
|
|||||||
|
|
||||||
function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
|
function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
xchgl (%eax),%edx
|
xchgl (%eax),%edx
|
||||||
movl %edx,%eax
|
movl %edx,%eax
|
||||||
{$else}
|
|
||||||
movl Target,%ecx
|
|
||||||
movl Source,%eax
|
|
||||||
xchgl (%ecx),%eax
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
|
function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
xchgl %eax,%edx
|
xchgl %eax,%edx
|
||||||
{$else}
|
|
||||||
movl Target,%edx
|
|
||||||
movl Source,%eax
|
|
||||||
{$endif}
|
|
||||||
lock
|
lock
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
end;
|
end;
|
||||||
@ -1448,13 +1366,7 @@ end;
|
|||||||
|
|
||||||
function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint; assembler;
|
function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint; assembler;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
xchgl %eax,%ecx
|
xchgl %eax,%ecx
|
||||||
{$else}
|
|
||||||
movl Target,%ecx
|
|
||||||
movl NewValue,%edx
|
|
||||||
movl Comperand,%eax
|
|
||||||
{$endif}
|
|
||||||
lock
|
lock
|
||||||
cmpxchgl %edx, (%ecx)
|
cmpxchgl %edx, (%ecx)
|
||||||
end;
|
end;
|
||||||
@ -1464,11 +1376,7 @@ function InterlockedCompareExchange64(var Target: int64; NewValue: int64; Comper
|
|||||||
asm
|
asm
|
||||||
pushl %ebx
|
pushl %ebx
|
||||||
pushl %edi
|
pushl %edi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
{$else}
|
|
||||||
movl Target,%edi
|
|
||||||
{$endif}
|
|
||||||
movl Comperand+4,%edx
|
movl Comperand+4,%edx
|
||||||
movl Comperand+0,%eax
|
movl Comperand+0,%eax
|
||||||
movl NewValue+4,%ecx
|
movl NewValue+4,%ecx
|
||||||
|
@ -30,13 +30,8 @@
|
|||||||
movl %ecx,%eax
|
movl %ecx,%eax
|
||||||
orl %ebx,%eax
|
orl %ebx,%eax
|
||||||
jnz .Lnodivzero
|
jnz .Lnodivzero
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %ebp,%edx
|
movl %ebp,%edx
|
||||||
movl $200,%eax
|
movl $200,%eax
|
||||||
{$else}
|
|
||||||
pushl %ebp
|
|
||||||
pushl $200
|
|
||||||
{$endif}
|
|
||||||
call HandleErrorFrame
|
call HandleErrorFrame
|
||||||
jmp .Lexit
|
jmp .Lexit
|
||||||
.Lnodivzero:
|
.Lnodivzero:
|
||||||
@ -104,13 +99,8 @@
|
|||||||
movl %ecx,%eax
|
movl %ecx,%eax
|
||||||
orl %ebx,%eax
|
orl %ebx,%eax
|
||||||
jnz .Lnodivzero
|
jnz .Lnodivzero
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %ebp,%edx
|
movl %ebp,%edx
|
||||||
movl $200,%eax
|
movl $200,%eax
|
||||||
{$else}
|
|
||||||
pushl %ebp
|
|
||||||
pushl $200
|
|
||||||
{$endif}
|
|
||||||
call HandleErrorFrame
|
call HandleErrorFrame
|
||||||
jmp .Lexit
|
jmp .Lexit
|
||||||
.Lnodivzero:
|
.Lnodivzero:
|
||||||
|
@ -28,10 +28,6 @@ procedure sincos(theta : float;out sinus,cosinus : float);assembler;
|
|||||||
asm
|
asm
|
||||||
fldt theta
|
fldt theta
|
||||||
fsincos
|
fsincos
|
||||||
{$ifndef regcall}
|
|
||||||
movl sinus, %eax
|
|
||||||
movl cosinus, %edx
|
|
||||||
{$endif}
|
|
||||||
fstpt (%edx)
|
fstpt (%edx)
|
||||||
fstpt (%eax)
|
fstpt (%eax)
|
||||||
fwait
|
fwait
|
||||||
|
@ -15,18 +15,11 @@
|
|||||||
|
|
||||||
Function fpc_SetJmp (Var S : Jmp_buf) : longint;assembler;nostackframe;[Public, alias : 'FPC_SETJMP']; compilerproc;
|
Function fpc_SetJmp (Var S : Jmp_buf) : longint;assembler;nostackframe;[Public, alias : 'FPC_SETJMP']; compilerproc;
|
||||||
asm
|
asm
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl 4(%esp),%eax
|
|
||||||
{$endif}
|
|
||||||
movl %ebx,Jmp_buf.ebx(%eax)
|
movl %ebx,Jmp_buf.ebx(%eax)
|
||||||
movl %esi,Jmp_buf.esi(%eax)
|
movl %esi,Jmp_buf.esi(%eax)
|
||||||
movl %edi,Jmp_buf.edi(%eax)
|
movl %edi,Jmp_buf.edi(%eax)
|
||||||
movl %ebp,Jmp_buf.bp(%eax)
|
movl %ebp,Jmp_buf.bp(%eax)
|
||||||
{$ifdef REGCALL}
|
|
||||||
leal 4(%esp),%edi
|
leal 4(%esp),%edi
|
||||||
{$else}
|
|
||||||
leal 8(%esp),%edi
|
|
||||||
{$endif}
|
|
||||||
movl %edi,Jmp_buf.sp(%eax)
|
movl %edi,Jmp_buf.sp(%eax)
|
||||||
movl (%esp),%edi
|
movl (%esp),%edi
|
||||||
movl %edi,Jmp_buf.pc(%eax)
|
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;
|
Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
|
||||||
asm
|
asm
|
||||||
{$ifdef REGCALL}
|
|
||||||
xchgl %edx,%eax
|
xchgl %edx,%eax
|
||||||
{$else}
|
|
||||||
movl 4(%esp),%edx
|
|
||||||
movl 8(%esp),%eax
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
movl Jmp_buf.ebx(%edx),%ebx
|
movl Jmp_buf.ebx(%edx),%ebx
|
||||||
movl Jmp_buf.esi(%edx),%esi
|
movl Jmp_buf.esi(%edx),%esi
|
||||||
movl Jmp_buf.edi(%edx),%edi
|
movl Jmp_buf.edi(%edx),%edi
|
||||||
|
@ -24,23 +24,15 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl %edx,%edi
|
movl %edx,%edi
|
||||||
{$else}
|
|
||||||
movl source,%edi
|
|
||||||
{$endif}
|
|
||||||
testl %edi,%edi
|
testl %edi,%edi
|
||||||
jz .LStrCopyDone
|
jz .LStrCopyDone
|
||||||
leal 3(%edi),%ecx
|
leal 3(%edi),%ecx
|
||||||
andl $-4,%ecx
|
andl $-4,%ecx
|
||||||
movl %edi,%esi
|
movl %edi,%esi
|
||||||
subl %edi,%ecx
|
subl %edi,%ecx
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi
|
movl %eax,%edi
|
||||||
{$else}
|
|
||||||
movl dest,%edi
|
|
||||||
{$endif}
|
|
||||||
jz .LStrCopyAligned
|
jz .LStrCopyAligned
|
||||||
.LStrCopyAlignLoop:
|
.LStrCopyAlignLoop:
|
||||||
movb (%esi),%al
|
movb (%esi),%al
|
||||||
@ -84,11 +76,7 @@ asm
|
|||||||
.LStrCopyByte:
|
.LStrCopyByte:
|
||||||
movb %al,(%edi)
|
movb %al,(%edi)
|
||||||
.LStrCopyDone:
|
.LStrCopyDone:
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl saveeax,%eax
|
movl saveeax,%eax
|
||||||
{$else}
|
|
||||||
movl dest,%eax
|
|
||||||
{$endif}
|
|
||||||
movl saveedi,%edi
|
movl saveedi,%edi
|
||||||
movl saveesi,%esi
|
movl saveesi,%esi
|
||||||
end;
|
end;
|
||||||
@ -197,10 +185,8 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl %edx,saveedx
|
movl %edx,saveedx
|
||||||
{$endif}
|
|
||||||
movl str2,%edi
|
movl str2,%edi
|
||||||
movl $0xffffffff,%ecx
|
movl $0xffffffff,%ecx
|
||||||
cld
|
cld
|
||||||
@ -208,13 +194,8 @@ asm
|
|||||||
repne
|
repne
|
||||||
scasb
|
scasb
|
||||||
not %ecx
|
not %ecx
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl saveedx,%edi
|
movl saveedx,%edi
|
||||||
movl saveeax,%esi
|
movl saveeax,%esi
|
||||||
{$else}
|
|
||||||
movl str2,%edi
|
|
||||||
movl str1,%esi
|
|
||||||
{$endif}
|
|
||||||
repe
|
repe
|
||||||
cmpsb
|
cmpsb
|
||||||
movb -1(%esi),%al
|
movb -1(%esi),%al
|
||||||
@ -235,11 +216,9 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl %edx,saveedx
|
movl %edx,saveedx
|
||||||
movl %ecx,saveecx
|
movl %ecx,saveecx
|
||||||
{$endif}
|
|
||||||
movl str2,%edi
|
movl str2,%edi
|
||||||
movl $0xffffffff,%ecx
|
movl $0xffffffff,%ecx
|
||||||
cld
|
cld
|
||||||
@ -247,21 +226,12 @@ asm
|
|||||||
repne
|
repne
|
||||||
scasb
|
scasb
|
||||||
not %ecx
|
not %ecx
|
||||||
{$ifdef REGCALL}
|
|
||||||
cmpl saveecx,%ecx
|
cmpl saveecx,%ecx
|
||||||
jl .LSTRLCOMP1
|
jl .LSTRLCOMP1
|
||||||
movl saveecx,%ecx
|
movl saveecx,%ecx
|
||||||
.LSTRLCOMP1:
|
.LSTRLCOMP1:
|
||||||
movl saveedx,%edi
|
movl saveedx,%edi
|
||||||
movl saveeax,%esi
|
movl saveeax,%esi
|
||||||
{$else}
|
|
||||||
cmpl l,%ecx
|
|
||||||
jl .LSTRLCOMP1
|
|
||||||
movl l,%ecx
|
|
||||||
.LSTRLCOMP1:
|
|
||||||
movl str2,%edi
|
|
||||||
movl str1,%esi
|
|
||||||
{$endif}
|
|
||||||
repe
|
repe
|
||||||
cmpsb
|
cmpsb
|
||||||
movb -1(%esi),%al
|
movb -1(%esi),%al
|
||||||
@ -282,10 +252,8 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl %edx,saveedx
|
movl %edx,saveedx
|
||||||
{$endif}
|
|
||||||
movl str2,%edi
|
movl str2,%edi
|
||||||
movl $0xffffffff,%ecx
|
movl $0xffffffff,%ecx
|
||||||
cld
|
cld
|
||||||
@ -293,13 +261,8 @@ asm
|
|||||||
repne
|
repne
|
||||||
scasb
|
scasb
|
||||||
not %ecx
|
not %ecx
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl saveedx,%edi
|
movl saveedx,%edi
|
||||||
movl saveeax,%esi
|
movl saveeax,%esi
|
||||||
{$else}
|
|
||||||
movl str2,%edi
|
|
||||||
movl str1,%esi
|
|
||||||
{$endif}
|
|
||||||
.LSTRICOMP2:
|
.LSTRICOMP2:
|
||||||
repe
|
repe
|
||||||
cmpsb
|
cmpsb
|
||||||
@ -336,11 +299,9 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl %edx,saveedx
|
movl %edx,saveedx
|
||||||
movl %ecx,saveecx
|
movl %ecx,saveecx
|
||||||
{$endif}
|
|
||||||
movl str2,%edi
|
movl str2,%edi
|
||||||
movl $0xffffffff,%ecx
|
movl $0xffffffff,%ecx
|
||||||
cld
|
cld
|
||||||
@ -348,21 +309,12 @@ asm
|
|||||||
repne
|
repne
|
||||||
scasb
|
scasb
|
||||||
not %ecx
|
not %ecx
|
||||||
{$ifdef REGCALL}
|
|
||||||
cmpl saveecx,%ecx
|
cmpl saveecx,%ecx
|
||||||
jl .LSTRLICOMP5
|
jl .LSTRLICOMP5
|
||||||
movl saveecx,%ecx
|
movl saveecx,%ecx
|
||||||
.LSTRLICOMP5:
|
.LSTRLICOMP5:
|
||||||
movl saveedx,%edi
|
movl saveedx,%edi
|
||||||
movl saveeax,%esi
|
movl saveeax,%esi
|
||||||
{$else}
|
|
||||||
cmpl l,%ecx
|
|
||||||
jl .LSTRLICOMP5
|
|
||||||
movl l,%ecx
|
|
||||||
.LSTRLICOMP5:
|
|
||||||
movl str2,%edi
|
|
||||||
movl str1,%esi
|
|
||||||
{$endif}
|
|
||||||
.LSTRLICOMP2:
|
.LSTRLICOMP2:
|
||||||
repe
|
repe
|
||||||
cmpsb
|
cmpsb
|
||||||
@ -399,9 +351,6 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl p,%eax
|
|
||||||
{$endif}
|
|
||||||
xorl %ecx,%ecx
|
xorl %ecx,%ecx
|
||||||
testl %eax,%eax
|
testl %eax,%eax
|
||||||
jz .LSTRSCAN
|
jz .LSTRSCAN
|
||||||
@ -524,15 +473,11 @@ end;
|
|||||||
{$define FPC_UNIT_HAS_STRRSCAN}
|
{$define FPC_UNIT_HAS_STRRSCAN}
|
||||||
function strrscan(p : pchar;c : char) : pchar;assembler;
|
function strrscan(p : pchar;c : char) : pchar;assembler;
|
||||||
var
|
var
|
||||||
{$ifdef regcall}
|
|
||||||
saveeax,
|
saveeax,
|
||||||
{$endif}
|
|
||||||
saveedi : longint;
|
saveedi : longint;
|
||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifdef regcall}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
{$endif regcall}
|
|
||||||
movl p,%edi
|
movl p,%edi
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
orl %edi,%edi
|
orl %edi,%edi
|
||||||
@ -544,11 +489,7 @@ asm
|
|||||||
scasb
|
scasb
|
||||||
not %ecx
|
not %ecx
|
||||||
movb c,%al
|
movb c,%al
|
||||||
{$ifdef regcall}
|
|
||||||
movl saveeax,%edi
|
movl saveeax,%edi
|
||||||
{$else}
|
|
||||||
movl p,%edi
|
|
||||||
{$endif}
|
|
||||||
addl %ecx,%edi
|
addl %ecx,%edi
|
||||||
decl %edi
|
decl %edi
|
||||||
std
|
std
|
||||||
@ -573,9 +514,6 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl p,%eax
|
|
||||||
{$endif}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl p,%esi
|
movl p,%esi
|
||||||
orl %esi,%esi
|
orl %esi,%esi
|
||||||
@ -608,9 +546,6 @@ var
|
|||||||
asm
|
asm
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl p,%eax
|
|
||||||
{$endif}
|
|
||||||
movl %eax,saveeax
|
movl %eax,saveeax
|
||||||
movl p,%esi
|
movl p,%esi
|
||||||
orl %esi,%esi
|
orl %esi,%esi
|
||||||
|
@ -24,21 +24,14 @@ asm
|
|||||||
movl %edi,saveedi
|
movl %edi,saveedi
|
||||||
movl %esi,saveesi
|
movl %esi,saveesi
|
||||||
cld
|
cld
|
||||||
{$ifdef REGCALL}
|
|
||||||
movl %eax,%edi // load destination address
|
movl %eax,%edi // load destination address
|
||||||
movl %edx,%esi // Load Source adress
|
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
|
movzbl (%esi),%ecx // load length in ECX
|
||||||
incl %esi
|
incl %esi
|
||||||
rep
|
rep
|
||||||
movsb
|
movsb
|
||||||
movb $0,(%edi)
|
movb $0,(%edi)
|
||||||
{$ifndef REGCALL}
|
|
||||||
movl d,%eax // return value to EAX
|
|
||||||
{$endif}
|
|
||||||
movl saveedi,%edi
|
movl saveedi,%edi
|
||||||
movl saveesi,%esi
|
movl saveesi,%esi
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user