* x86_64 updates

This commit is contained in:
peter 2004-12-12 14:30:27 +00:00
parent ed9f8f54e7
commit 64cd72bc5a
5 changed files with 124 additions and 30 deletions

View File

@ -21,7 +21,7 @@ const
type type
PEventState = pointer; PEventState = pointer;
TThreadFunc = function(parameter : pointer) : longint; TThreadFunc = function(parameter : pointer) : ptrint;
// Function prototypes for TThreadManager Record. // Function prototypes for TThreadManager Record.
TBeginThreadHandler = Function (sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : THandle) : DWord; TBeginThreadHandler = Function (sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : THandle) : DWord;
@ -145,7 +145,10 @@ function basiceventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
{ {
$Log$ $Log$
Revision 1.19 2004-09-19 18:55:30 armin Revision 1.20 2004-12-12 14:30:27 peter
* x86_64 updates
Revision 1.19 2004/09/19 18:55:30 armin
* added define DISABLE_NO_THREAD_MANAGER to avoid warnings if thread manager is always present * added define DISABLE_NO_THREAD_MANAGER to avoid warnings if thread manager is always present
Revision 1.18 2004/05/23 20:26:20 marco Revision 1.18 2004/05/23 20:26:20 marco

View File

@ -127,7 +127,7 @@ end;
{$define WRITE_DEBUG := //} // just comment out those lines {$define WRITE_DEBUG := //} // just comment out those lines
{$ENDIF} {$ENDIF}
function ThreadFunc(parameter: Pointer): LongInt; function ThreadFunc(parameter: Pointer): PtrInt;
var var
LThread: TThread; LThread: TThread;
c: char; c: char;
@ -325,7 +325,10 @@ end;
{ {
$Log$ $Log$
Revision 1.7 2004-03-03 22:00:37 peter Revision 1.8 2004-12-12 14:30:27 peter
* x86_64 updates
Revision 1.7 2004/03/03 22:00:37 peter
* remove cdecl * remove cdecl
Revision 1.6 2003/11/22 11:04:08 marco Revision 1.6 2003/11/22 11:04:08 marco

View File

@ -27,7 +27,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -53,7 +53,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -80,7 +80,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -108,7 +108,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -137,7 +137,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -167,7 +167,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -199,7 +199,7 @@ asm
jnae .LSyscOK { Jump to error handler if error. } jnae .LSyscOK { Jump to error handler if error. }
negq %rax negq %rax
movq %rax,%rdx movq %rax,%rdx
movq FPC_THREADVAR_RELOCATE,%rax movq fpc_threadvar_relocate_proc,%rax
testq %rax,%rax testq %rax,%rax
jne .LThread jne .LThread
movq %rdx,Errno+8 movq %rdx,Errno+8
@ -224,7 +224,10 @@ end;
{ {
$Log$ $Log$
Revision 1.8 2004-05-28 21:37:34 peter Revision 1.9 2004-12-12 14:30:27 peter
* x86_64 updates
Revision 1.8 2004/05/28 21:37:34 peter
* fix errno for multithread * fix errno for multithread
Revision 1.7 2004/05/18 20:13:12 peter Revision 1.7 2004/05/18 20:13:12 peter

View File

@ -245,7 +245,7 @@ Uses
begin begin
DoneThread; DoneThread;
pthread_detach(pthread_t(pthread_self())); pthread_detach(pthread_t(pthread_self()));
pthread_exit(pointer(ExitCode)); pthread_exit(pointer(ptrint(ExitCode)));
end; end;
@ -561,7 +561,10 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.13 2004-10-14 17:39:33 florian Revision 1.14 2004-12-12 14:30:27 peter
* x86_64 updates
Revision 1.13 2004/10/14 17:39:33 florian
+ added system.align + added system.align
+ threadvars are now aligned + threadvars are now aligned

View File

@ -37,25 +37,88 @@
EXTENDED data type routines EXTENDED data type routines
****************************************************************************} ****************************************************************************}
{$ifdef INTERNCONSTINTF}
{$define FPC_SYSTEM_HAS_PI} {$define FPC_SYSTEM_HAS_PI}
function pi : extended;[internproc:fpc_in_pi]; function fpc_pi_real : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_ABS} {$define FPC_SYSTEM_HAS_ABS}
function abs(d : extended) : extended;[internproc:fpc_in_abs_real]; function fpc_abs_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_SQR} {$define FPC_SYSTEM_HAS_SQR}
function sqr(d : extended) : extended;[internproc:fpc_in_sqr_real]; function fpc_sqr_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_SQRT} {$define FPC_SYSTEM_HAS_SQRT}
function sqrt(d : extended) : extended;[internproc:fpc_in_sqrt_real]; function fpc_sqrt_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_ARCTAN} {$define FPC_SYSTEM_HAS_ARCTAN}
function arctan(d : extended) : extended;[internproc:fpc_in_arctan_real]; function fpc_arctan_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_LN} {$define FPC_SYSTEM_HAS_LN}
function ln(d : extended) : extended;[internproc:fpc_in_ln_real]; function fpc_ln_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_SIN} {$define FPC_SYSTEM_HAS_SIN}
function sin(d : extended) : extended;[internproc:fpc_in_sin_real]; function fpc_sin_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$define FPC_SYSTEM_HAS_COS} {$define FPC_SYSTEM_HAS_COS}
function cos(d : extended) : extended;[internproc:fpc_in_cos_real]; function fpc_cos_real(d : ValReal) : ValReal;compilerproc;
begin
{ Function is handled internal in the compiler }
runerror(207);
result:=0;
end;
{$else}
{$define FPC_SYSTEM_HAS_PI}
function pi : ValReal;[internproc:fpc_in_pi];
{$define FPC_SYSTEM_HAS_ABS}
function abs(d : ValReal) : ValReal;[internproc:fpc_in_abs_real];
{$define FPC_SYSTEM_HAS_SQR}
function sqr(d : ValReal) : ValReal;[internproc:fpc_in_sqr_real];
{$define FPC_SYSTEM_HAS_SQRT}
function sqrt(d : ValReal) : ValReal;[internproc:fpc_in_sqrt_real];
{$define FPC_SYSTEM_HAS_ARCTAN}
function arctan(d : ValReal) : ValReal;[internproc:fpc_in_arctan_real];
{$define FPC_SYSTEM_HAS_LN}
function ln(d : ValReal) : ValReal;[internproc:fpc_in_ln_real];
{$define FPC_SYSTEM_HAS_SIN}
function sin(d : ValReal) : ValReal;[internproc:fpc_in_sin_real];
{$define FPC_SYSTEM_HAS_COS}
function cos(d : ValReal) : ValReal;[internproc:fpc_in_cos_real];
{$endif}
{$define FPC_SYSTEM_HAS_EXP} {$define FPC_SYSTEM_HAS_EXP}
function exp(d : extended) : extended;assembler;[internconst:fpc_in_const_exp]; {$ifdef INTERNCONSTINTF}
function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
{$else}
function exp(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_exp];
{$endif}
asm asm
// comes from DJ GPP // comes from DJ GPP
fldt d fldt d
@ -89,7 +152,11 @@
{$define FPC_SYSTEM_HAS_FRAC} {$define FPC_SYSTEM_HAS_FRAC}
function frac(d : extended) : extended;assembler;[internconst:fpc_in_const_frac]; {$ifdef INTERNCONSTINTF}
function fpc_frac_real(d : ValReal) : ValReal;assembler;compilerproc;
{$else}
function frac(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_frac];
{$endif}
asm asm
subq $16,%rsp subq $16,%rsp
fnstcw -4(%rbp) fnstcw -4(%rbp)
@ -110,7 +177,11 @@
{$define FPC_SYSTEM_HAS_INT} {$define FPC_SYSTEM_HAS_INT}
function int(d : extended) : extended;assembler;[internconst:fpc_in_const_int]; {$ifdef INTERNCONSTINTF}
function fpc_int_real(d : ValReal) : ValReal;assembler;compilerproc;
{$else}
function int(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_int];
{$endif}
asm asm
subq $16,%rsp subq $16,%rsp
fnstcw -4(%rbp) fnstcw -4(%rbp)
@ -129,7 +200,11 @@
{$define FPC_SYSTEM_HAS_TRUNC} {$define FPC_SYSTEM_HAS_TRUNC}
function trunc(d : extended) : int64;assembler;[internconst:fpc_in_const_trunc]; {$ifdef INTERNCONSTINTF}
function fpc_trunc_real(d : ValReal) : int64;assembler;compilerproc;
{$else}
function trunc(d : ValReal) : int64;assembler;[internconst:fpc_in_const_trunc];
{$endif}
var var
oldcw, oldcw,
newcw : word; newcw : word;
@ -150,13 +225,17 @@
{$define FPC_SYSTEM_HAS_ROUND} {$define FPC_SYSTEM_HAS_ROUND}
{$ifdef hascompilerproc} {$ifdef internconstintf}
function fpc_round_real(d : ValReal) : int64;assembler;compilerproc;
{$else}
{$ifdef hascompilerproc}
function round(d : extended) : int64;[internconst:fpc_in_const_round, external name 'FPC_ROUND']; function round(d : extended) : int64;[internconst:fpc_in_const_round, external name 'FPC_ROUND'];
function fpc_round(d : extended) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc} function fpc_round(d : extended) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
{$else} {$else}
function round(d : extended) : int64;assembler;[internconst:fpc_in_const_round]; function round(d : extended) : int64;assembler;[internconst:fpc_in_const_round];
{$endif hascompilerproc} {$endif hascompilerproc}
{$endif}
var var
oldcw, oldcw,
newcw : word; newcw : word;
@ -196,7 +275,10 @@
{ {
$Log$ $Log$
Revision 1.5 2004-12-12 12:41:46 peter Revision 1.6 2004-12-12 14:30:27 peter
* x86_64 updates
Revision 1.5 2004/12/12 12:41:46 peter
* updated for latest rtl changes * updated for latest rtl changes
Revision 1.4 2004/04/24 18:31:25 florian Revision 1.4 2004/04/24 18:31:25 florian