mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-20 03:50:36 +01:00
* Completely fixed float constants in softfloat mode when compiler was compiled in hardfloat mode on arm-linux host.
git-svn-id: trunk@8015 -
This commit is contained in:
parent
aadcefe08f
commit
1782305ae2
@ -66,11 +66,7 @@ interface
|
|||||||
location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
|
location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
|
||||||
lastlabel:=nil;
|
lastlabel:=nil;
|
||||||
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
||||||
hiloswapped:=(current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
hiloswapped:=is_double_hilo_swapped;
|
||||||
not(cs_fp_emulation in current_settings.moduleswitches);
|
|
||||||
{$ifdef FPC_DOUBLE_HILO_SWAPPED}
|
|
||||||
hiloswapped:=not hiloswapped;
|
|
||||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
|
||||||
{ const already used ? }
|
{ const already used ? }
|
||||||
if not assigned(lab_real) then
|
if not assigned(lab_real) then
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -340,6 +340,9 @@ interface
|
|||||||
{# Routine to get the required alignment for size of data, which will
|
{# Routine to get the required alignment for size of data, which will
|
||||||
be placed in data/const segment, according to the current alignment requirements }
|
be placed in data/const segment, according to the current alignment requirements }
|
||||||
function const_align(siz: longint): shortint;
|
function const_align(siz: longint): shortint;
|
||||||
|
{$ifdef ARM}
|
||||||
|
function is_double_hilo_swapped: boolean;{$ifdef USEINLINE}inline;{$endif}
|
||||||
|
{$endif ARM}
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -1005,6 +1008,17 @@ implementation
|
|||||||
const_align := used_align(siz,current_settings.alignment.constalignmin,current_settings.alignment.constalignmax);
|
const_align := used_align(siz,current_settings.alignment.constalignmin,current_settings.alignment.constalignmax);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifdef ARM}
|
||||||
|
function is_double_hilo_swapped: boolean;{$ifdef USEINLINE}inline;{$endif}
|
||||||
|
begin
|
||||||
|
result := (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
||||||
|
not(cs_fp_emulation in current_settings.moduleswitches);
|
||||||
|
{$ifdef FPC_DOUBLE_HILO_SWAPPED}
|
||||||
|
{ inverse result if compiler was compiled with swapped hilo already }
|
||||||
|
result := not result;
|
||||||
|
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
||||||
|
end;
|
||||||
|
{$endif ARM}
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
Init
|
Init
|
||||||
|
|||||||
@ -122,11 +122,7 @@ implementation
|
|||||||
lastlabel:=nil;
|
lastlabel:=nil;
|
||||||
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
||||||
{$ifdef ARM}
|
{$ifdef ARM}
|
||||||
hiloswapped:=(current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
hiloswapped:=is_double_hilo_swapped;
|
||||||
not(cs_fp_emulation in current_settings.moduleswitches);
|
|
||||||
{$ifdef FPC_DOUBLE_HILO_SWAPPED}
|
|
||||||
hiloswapped:=not hiloswapped;
|
|
||||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
|
||||||
{$endif ARM}
|
{$endif ARM}
|
||||||
{ const already used ? }
|
{ const already used ? }
|
||||||
if not assigned(lab_real) then
|
if not assigned(lab_real) then
|
||||||
|
|||||||
@ -283,8 +283,7 @@ implementation
|
|||||||
list.concat(Tai_real_32bit.Create(ts32real(value)));
|
list.concat(Tai_real_32bit.Create(ts32real(value)));
|
||||||
s64real :
|
s64real :
|
||||||
{$ifdef ARM}
|
{$ifdef ARM}
|
||||||
if (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
if is_double_hilo_swapped then
|
||||||
not(cs_fp_emulation in current_settings.moduleswitches) then
|
|
||||||
list.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
|
list.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
|
||||||
else
|
else
|
||||||
{$endif ARM}
|
{$endif ARM}
|
||||||
|
|||||||
@ -1529,8 +1529,7 @@ end;
|
|||||||
s32real : p.concat(Tai_real_32bit.Create(value));
|
s32real : p.concat(Tai_real_32bit.Create(value));
|
||||||
s64real :
|
s64real :
|
||||||
{$ifdef ARM}
|
{$ifdef ARM}
|
||||||
if (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
if is_double_hilo_swapped then
|
||||||
not(cs_fp_emulation in current_settings.moduleswitches) then
|
|
||||||
p.concat(Tai_real_64bit.Create_hiloswapped(value))
|
p.concat(Tai_real_64bit.Create_hiloswapped(value))
|
||||||
else
|
else
|
||||||
{$endif ARM}
|
{$endif ARM}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user