* introduce FPC_SUPPORT_X87_TYPES_ON_WIN64 define which allows to build

a win64 compiler support the x87 types extended and comp/currency handled by the FPU, this
  requires to use a i386 compiler as starting compiler and cross compilation because the starting
  compiler must support the 80 bit extended type

git-svn-id: trunk@23023 -
This commit is contained in:
florian 2012-11-18 17:30:51 +00:00
parent 45f60bc4b5
commit a42b934c69
2 changed files with 16 additions and 6 deletions

View File

@ -2845,12 +2845,14 @@ begin
def_system_macro('CPUX64'); def_system_macro('CPUX64');
{ not supported for now, afaik (FK) { not supported for now, afaik (FK)
def_system_macro('FPC_HAS_TYPE_FLOAT128'); } def_system_macro('FPC_HAS_TYPE_FLOAT128'); }
{ win64 doesn't support the legacy fpu } {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
{ normally, win64 doesn't support the legacy fpu }
if target_info.system=system_x86_64_win64 then if target_info.system=system_x86_64_win64 then
begin begin
def_system_macro('FPC_CURRENCY_IS_INT64'); def_system_macro('FPC_CURRENCY_IS_INT64');
def_system_macro('FPC_COMP_IS_INT64'); def_system_macro('FPC_COMP_IS_INT64');
end; end;
{$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
{$endif} {$endif}
{$ifdef sparc} {$ifdef sparc}
def_system_macro('CPUSPARC'); def_system_macro('CPUSPARC');
@ -3233,10 +3235,12 @@ if (target_info.abi = abi_eabihf) then
def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
{$endif} {$endif}
{$ifdef x86_64} {$ifdef x86_64}
{ win64 doesn't support the legacy fpu } {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
{ normally, win64 doesn't support the legacy fpu }
if target_info.system=system_x86_64_win64 then if target_info.system=system_x86_64_win64 then
undef_system_macro('FPC_HAS_TYPE_EXTENDED') undef_system_macro('FPC_HAS_TYPE_EXTENDED')
else else
{$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
def_system_macro('FPC_HAS_TYPE_EXTENDED'); def_system_macro('FPC_HAS_TYPE_EXTENDED');
{$endif} {$endif}
end; end;

View File

@ -220,13 +220,15 @@ implementation
tarraydef(openchararraytype).elementdef:=cansichartype; tarraydef(openchararraytype).elementdef:=cansichartype;
{$ifdef x86} {$ifdef x86}
create_fpu_types; create_fpu_types;
if target_info.system<>system_x86_64_win64 then {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
s64currencytype:=tfloatdef.create(s64currency) if target_info.system=system_x86_64_win64 then
else
begin begin
s64currencytype:=torddef.create(scurrency,low(int64),high(int64)); s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
pbestrealtype:=@s64floattype; pbestrealtype:=@s64floattype;
end; end
else
{$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
s64currencytype:=tfloatdef.create(s64currency);
{$endif x86} {$endif x86}
{$ifdef powerpc} {$ifdef powerpc}
create_fpu_types; create_fpu_types;
@ -303,7 +305,9 @@ implementation
addtype('CExtended',pbestrealtype^); addtype('CExtended',pbestrealtype^);
end; end;
{$ifdef x86} {$ifdef x86}
{$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
if target_info.system<>system_x86_64_win64 then if target_info.system<>system_x86_64_win64 then
{$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
addtype('Comp',tfloatdef.create(s64comp)); addtype('Comp',tfloatdef.create(s64comp));
{$endif x86} {$endif x86}
addtype('Currency',s64currencytype); addtype('Currency',s64currencytype);
@ -440,8 +444,10 @@ implementation
var var
oldcurrentmodule : tmodule; oldcurrentmodule : tmodule;
begin begin
{$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
if target_info.system=system_x86_64_win64 then if target_info.system=system_x86_64_win64 then
pbestrealtype:=@s64floattype; pbestrealtype:=@s64floattype;
{$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
oldcurrentmodule:=current_module; oldcurrentmodule:=current_module;
set_current_module(nil); set_current_module(nil);