* x86_64 fixes

* cleanup of fpcdefs.icn
This commit is contained in:
peter 2004-09-21 19:59:51 +00:00
parent 33a834821f
commit 690f5e22d1
2 changed files with 69 additions and 54 deletions

View File

@ -1,20 +1,17 @@
{$ifdef FPC} {$ifdef FPC}
{$ifdef DELPHI} {$mode objfpc}
{$mode delphi} {$asmmode default}
{$asmmode intel} {$H-}
{$else} {$goto on}
{$mode objfpc} {$inline on}
{$H-}
{$goto on}
{$inline on}
{ 1Mb stack } { 1Mb stack }
{$MEMORY 1000000} {$MEMORY 1000000}
{ This reduces the memory requirements a lot } { This reduces the memory requirements a lot }
{$PACKENUM 1} {$PACKENUM 1}
{$ifndef VER1_0} {$ifndef VER1_0}
{ We don't use exceptions, so turn off the implicit { We don't use exceptions, so turn off the implicit
exceptions in the constructors } exceptions in the constructors }
{$IMPLICITEXCEPTIONS OFF} {$IMPLICITEXCEPTIONS OFF}
@ -22,46 +19,30 @@
{$ifndef EXTDEBUG} {$ifndef EXTDEBUG}
{$define USEINLINE} {$define USEINLINE}
{$endif EXTDEBUG} {$endif EXTDEBUG}
{$else} {$else}
{ Optimizer is broken when compiling with optimizations using 1.0.x } { Optimizer is broken when compiling with optimizations using 1.0.x }
{$ifndef USEOPT} {$ifndef USEOPT}
{$define NOOPT} {$define NOOPT}
{$endif} {$endif}
{$endif VER1_0} {$endif VER1_0}
{$define FPCPROCVAR} {$define FPCPROCVAR}
{$ifdef I386} {$define USEEXCEPT}
{$define USEEXCEPT}
{$endif} {$ifdef cpuarm}
{$endif} {$packrecords c}
{$ifdef cpuarm} {$endif cpuarm}
{$packrecords c}
{$endif cpuarm}
{$endif} {$endif}
{$ifdef DELPHI}
{$H-}
{$J+}
{$Z1}
{$undef FPCPROCVAR}
{$endif}
{ assume a processor with flags }
{$define cpuflags}
{$ifdef i386} {$ifdef i386}
{$ifdef delphi}
{$define oldset}
{$endif}
{$define x86} {$define x86}
{$define cpuflags}
{$define cpuextended} {$define cpuextended}
{$endif i386} {$endif i386}
{$ifdef x86_64} {$ifdef x86_64}
{$define x86} {$define x86}
{$define cpuflags}
{$define cpu64bit} {$define cpu64bit}
{$define cpuextended} {$define cpuextended}
{$define cpufloat128} {$define cpufloat128}
@ -71,43 +52,41 @@
{$ifdef alpha} {$ifdef alpha}
{$define cpu64bit} {$define cpu64bit}
{$undef cpuflags}
{$define noopt} {$define noopt}
{$define oldset}
{$endif alpha} {$endif alpha}
{$ifdef sparc} {$ifdef sparc}
{$define cpuflags}
{$define noopt} {$define noopt}
{$define oldset}
{$define cputargethasfixedstack} {$define cputargethasfixedstack}
{$endif sparc} {$endif sparc}
{$ifdef cpusparc}
{$undef useinline}
{$endif cpusparc}
{$ifdef powerpc} {$ifdef powerpc}
{$define cpuflags}
{$define noopt} {$define noopt}
{$define oldset}
{$define oldregvars} {$define oldregvars}
{$endif powerpc} {$endif powerpc}
{$ifdef arm} {$ifdef arm}
{$define cpuflags}
{$define cpuneedsdiv32helper} {$define cpuneedsdiv32helper}
{$define cputargethasfixedstack} {$define cputargethasfixedstack}
{$define noopt} {$define noopt}
{$define oldset}
{$endif arm} {$endif arm}
{$ifdef m68k} {$ifdef m68k}
{$define cpuflags}
{$define cpufpemu} {$define cpufpemu}
{$define noopt} {$define noopt}
{$define oldset}
{$endif m68k} {$endif m68k}
{ {
$Log$ $Log$
Revision 1.40 2004-09-21 17:25:12 peter Revision 1.41 2004-09-21 19:59:51 peter
* x86_64 fixes
* cleanup of fpcdefs.icn
Revision 1.40 2004/09/21 17:25:12 peter
* paraloc branch merged * paraloc branch merged
Revision 1.39.4.1 2004/08/31 20:43:06 peter Revision 1.39.4.1 2004/08/31 20:43:06 peter

View File

@ -1402,12 +1402,12 @@ implementation
{$endif} {$endif}
{$if defined(CPUI386) or defined(CPUX86_64)} {$ifdef CPUI386}
{$define HASSETFPUEXCEPTIONMASK} {$define HASSETFPUEXCEPTIONMASK}
{ later, this should be replaced by the math unit } { later, this should be replaced by the math unit }
const const
Default8087CW : word = $1332; Default8087CW : word = $1332;
{$ASMMODE ATT}
procedure Set8087CW(cw:word);assembler; procedure Set8087CW(cw:word);assembler;
asm asm
movw cw,%ax movw cw,%ax
@ -1432,7 +1432,39 @@ implementation
CtlWord:=Get8087CW; CtlWord:=Get8087CW;
Set8087CW( (CtlWord and $FFC0) or Byte(Longint(Mask)) ); Set8087CW( (CtlWord and $FFC0) or Byte(Longint(Mask)) );
end; end;
{$endif CPUI386 OR CPUX86_64} {$endif CPUI386}
{$ifdef CPUX86_64}
{$define HASSETFPUEXCEPTIONMASK}
{ later, this should be replaced by the math unit }
const
Default8087CW : word = $1332;
procedure Set8087CW(cw:word);assembler;
asm
movw cw,%ax
movw %ax,default8087cw
fnclex
fldcw default8087cw
end;
function Get8087CW:word;assembler;
asm
pushq $0
fnstcw (%rsp)
popq %rax
end;
procedure SetFPUExceptionMask(const Mask: TFPUExceptionMask);
var
CtlWord: Word;
begin
CtlWord:=Get8087CW;
Set8087CW( (CtlWord and $FFC0) or Byte(Longint(Mask)) );
end;
{$endif CPUX86_64}
{$ifdef CPUPOWERPC} {$ifdef CPUPOWERPC}
{$define HASSETFPUEXCEPTIONMASK} {$define HASSETFPUEXCEPTIONMASK}
@ -2013,7 +2045,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.139 2004-09-21 17:25:12 peter Revision 1.140 2004-09-21 19:59:51 peter
* x86_64 fixes
* cleanup of fpcdefs.icn
Revision 1.139 2004/09/21 17:25:12 peter
* paraloc branch merged * paraloc branch merged
Revision 1.138 2004/09/08 11:23:31 michael Revision 1.138 2004/09/08 11:23:31 michael