mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 20:09:29 +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));
|
||||
lastlabel:=nil;
|
||||
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
||||
hiloswapped:=(current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
||||
not(cs_fp_emulation in current_settings.moduleswitches);
|
||||
{$ifdef FPC_DOUBLE_HILO_SWAPPED}
|
||||
hiloswapped:=not hiloswapped;
|
||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
||||
hiloswapped:=is_double_hilo_swapped;
|
||||
{ const already used ? }
|
||||
if not assigned(lab_real) then
|
||||
begin
|
||||
|
||||
@ -340,6 +340,9 @@ interface
|
||||
{# Routine to get the required alignment for size of data, which will
|
||||
be placed in data/const segment, according to the current alignment requirements }
|
||||
function const_align(siz: longint): shortint;
|
||||
{$ifdef ARM}
|
||||
function is_double_hilo_swapped: boolean;{$ifdef USEINLINE}inline;{$endif}
|
||||
{$endif ARM}
|
||||
|
||||
implementation
|
||||
|
||||
@ -1005,6 +1008,17 @@ implementation
|
||||
const_align := used_align(siz,current_settings.alignment.constalignmin,current_settings.alignment.constalignmax);
|
||||
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
|
||||
|
||||
@ -122,11 +122,7 @@ implementation
|
||||
lastlabel:=nil;
|
||||
realait:=floattype2ait[tfloatdef(resultdef).floattype];
|
||||
{$ifdef ARM}
|
||||
hiloswapped:=(current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
||||
not(cs_fp_emulation in current_settings.moduleswitches);
|
||||
{$ifdef FPC_DOUBLE_HILO_SWAPPED}
|
||||
hiloswapped:=not hiloswapped;
|
||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
||||
hiloswapped:=is_double_hilo_swapped;
|
||||
{$endif ARM}
|
||||
{ const already used ? }
|
||||
if not assigned(lab_real) then
|
||||
|
||||
@ -283,8 +283,7 @@ implementation
|
||||
list.concat(Tai_real_32bit.Create(ts32real(value)));
|
||||
s64real :
|
||||
{$ifdef ARM}
|
||||
if (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
||||
not(cs_fp_emulation in current_settings.moduleswitches) then
|
||||
if is_double_hilo_swapped then
|
||||
list.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
|
||||
else
|
||||
{$endif ARM}
|
||||
|
||||
@ -1529,8 +1529,7 @@ end;
|
||||
s32real : p.concat(Tai_real_32bit.Create(value));
|
||||
s64real :
|
||||
{$ifdef ARM}
|
||||
if (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) and
|
||||
not(cs_fp_emulation in current_settings.moduleswitches) then
|
||||
if is_double_hilo_swapped then
|
||||
p.concat(Tai_real_64bit.Create_hiloswapped(value))
|
||||
else
|
||||
{$endif ARM}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user