mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 18:25:58 +02:00
* arm: more fixes for fpu_fpv4_sp_d16
* take care of FPUARM_HAS_VFP_DOUBLE * use FPUARM_HAS_VFP_EXTENSION instead of checking fpu_vfp_first and ...last git-svn-id: trunk@44707 -
This commit is contained in:
parent
9d7261a60b
commit
d772a42375
@ -116,6 +116,7 @@ unit agarmgas;
|
|||||||
result:='-mfpu=neon-vfpv3 '+result;
|
result:='-mfpu=neon-vfpv3 '+result;
|
||||||
fpu_vfpv3_d16:
|
fpu_vfpv3_d16:
|
||||||
result:='-mfpu=vfpv3-d16 '+result;
|
result:='-mfpu=vfpv3-d16 '+result;
|
||||||
|
fpu_fpv4_sp_d16,
|
||||||
fpu_fpv4_s16:
|
fpu_fpv4_s16:
|
||||||
result:='-mfpu=fpv4-sp-d16 '+result;
|
result:='-mfpu=fpv4-sp-d16 '+result;
|
||||||
fpu_vfpv4:
|
fpu_vfpv4:
|
||||||
|
@ -149,7 +149,7 @@ unit cpupara;
|
|||||||
getparaloc:=LOC_MMREGISTER
|
getparaloc:=LOC_MMREGISTER
|
||||||
else if (calloption in cdecl_pocalls) or
|
else if (calloption in cdecl_pocalls) or
|
||||||
(cs_fp_emulation in current_settings.moduleswitches) or
|
(cs_fp_emulation in current_settings.moduleswitches) or
|
||||||
(current_settings.fputype in [fpu_vfp_first..fpu_vfp_last]) then
|
(FPUARM_HAS_VFP_EXTENSION in fpu_capabilities[current_settings.fputype]) then
|
||||||
{ the ARM eabi also allows passing VFP values via VFP registers,
|
{ the ARM eabi also allows passing VFP values via VFP registers,
|
||||||
but Mac OS X doesn't seem to do that and linux only does it if
|
but Mac OS X doesn't seem to do that and linux only does it if
|
||||||
built with the "-mfloat-abi=hard" option }
|
built with the "-mfloat-abi=hard" option }
|
||||||
@ -782,7 +782,7 @@ unit cpupara;
|
|||||||
end
|
end
|
||||||
else if (p.proccalloption in [pocall_softfloat]) or
|
else if (p.proccalloption in [pocall_softfloat]) or
|
||||||
(cs_fp_emulation in current_settings.moduleswitches) or
|
(cs_fp_emulation in current_settings.moduleswitches) or
|
||||||
(current_settings.fputype in [fpu_vfp_first..fpu_vfp_last]) then
|
(FPUARM_HAS_VFP_EXTENSION in fpu_capabilities[current_settings.fputype]) then
|
||||||
begin
|
begin
|
||||||
case retcgsize of
|
case retcgsize of
|
||||||
OS_64,
|
OS_64,
|
||||||
|
@ -576,77 +576,19 @@ interface
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tarmaddnode.first_addfloat: tnode;
|
function tarmaddnode.first_addfloat: tnode;
|
||||||
var
|
|
||||||
procname: string[31];
|
|
||||||
{ do we need to reverse the result ? }
|
|
||||||
notnode : boolean;
|
|
||||||
fdef : tdef;
|
|
||||||
begin
|
begin
|
||||||
result := nil;
|
result := nil;
|
||||||
notnode := false;
|
|
||||||
|
|
||||||
if not(FPUARM_HAS_VFP_DOUBLE in fpu_capabilities[current_settings.fputype]) then
|
if (FPUARM_HAS_VFP_EXTENSION in fpu_capabilities[current_settings.fputype]) and
|
||||||
|
not(FPUARM_HAS_VFP_DOUBLE in fpu_capabilities[current_settings.fputype]) then
|
||||||
begin
|
begin
|
||||||
case tfloatdef(left.resultdef).floattype of
|
case tfloatdef(left.resultdef).floattype of
|
||||||
s32real:
|
s32real:
|
||||||
begin
|
;
|
||||||
result:=nil;
|
|
||||||
notnode:=false;
|
|
||||||
end;
|
|
||||||
s64real:
|
s64real:
|
||||||
begin
|
result:=first_addfloat_soft;
|
||||||
fdef:=search_system_type('FLOAT64').typedef;
|
|
||||||
procname:='float64';
|
|
||||||
|
|
||||||
case nodetype of
|
|
||||||
addn:
|
|
||||||
procname:=procname+'_add';
|
|
||||||
muln:
|
|
||||||
procname:=procname+'_mul';
|
|
||||||
subn:
|
|
||||||
procname:=procname+'_sub';
|
|
||||||
slashn:
|
|
||||||
procname:=procname+'_div';
|
|
||||||
ltn:
|
|
||||||
procname:=procname+'_lt';
|
|
||||||
lten:
|
|
||||||
procname:=procname+'_le';
|
|
||||||
gtn:
|
|
||||||
begin
|
|
||||||
procname:=procname+'_lt';
|
|
||||||
swapleftright;
|
|
||||||
end;
|
|
||||||
gten:
|
|
||||||
begin
|
|
||||||
procname:=procname+'_le';
|
|
||||||
swapleftright;
|
|
||||||
end;
|
|
||||||
equaln:
|
|
||||||
procname:=procname+'_eq';
|
|
||||||
unequaln:
|
|
||||||
begin
|
|
||||||
procname:=procname+'_eq';
|
|
||||||
notnode:=true;
|
|
||||||
end;
|
|
||||||
else
|
|
||||||
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),left.resultdef.typename,right.resultdef.typename);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
|
|
||||||
resultdef:=pasbool1type;
|
|
||||||
result:=ctypeconvnode.create_internal(ccallnode.createintern(procname,ccallparanode.create(
|
|
||||||
ctypeconvnode.create_internal(right,fdef),
|
|
||||||
ccallparanode.create(
|
|
||||||
ctypeconvnode.create_internal(left,fdef),nil))),resultdef);
|
|
||||||
|
|
||||||
left:=nil;
|
|
||||||
right:=nil;
|
|
||||||
|
|
||||||
{ do we need to reverse the result }
|
|
||||||
if notnode then
|
|
||||||
result:=cnotnode.create(result);
|
|
||||||
end;
|
|
||||||
else
|
else
|
||||||
internalerror(2019050933);
|
internalerror(2019050933);
|
||||||
end;
|
end;
|
||||||
|
@ -55,7 +55,9 @@ interface
|
|||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
if (FPUARM_HAS_VMOV_CONST in fpu_capabilities[current_settings.fputype]) and
|
if (FPUARM_HAS_VMOV_CONST in fpu_capabilities[current_settings.fputype]) and
|
||||||
IsVFPFloatImmediate(tfloatdef(resultdef).floattype,value_real) then
|
IsVFPFloatImmediate(tfloatdef(resultdef).floattype,value_real) and
|
||||||
|
((tfloatdef(resultdef).floattype=s32real) or
|
||||||
|
(FPUARM_HAS_VFP_DOUBLE in fpu_capabilities[init_settings.fputype])) then
|
||||||
expectloc:=LOC_MMREGISTER
|
expectloc:=LOC_MMREGISTER
|
||||||
else
|
else
|
||||||
expectloc:=LOC_CREFERENCE;
|
expectloc:=LOC_CREFERENCE;
|
||||||
@ -76,7 +78,9 @@ interface
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (FPUARM_HAS_VMOV_CONST in fpu_capabilities[current_settings.fputype]) and
|
if (FPUARM_HAS_VMOV_CONST in fpu_capabilities[current_settings.fputype]) and
|
||||||
IsVFPFloatImmediate(tfloatdef(resultdef).floattype,value_real) then
|
IsVFPFloatImmediate(tfloatdef(resultdef).floattype,value_real) and
|
||||||
|
((tfloatdef(resultdef).floattype=s32real) or
|
||||||
|
(FPUARM_HAS_VFP_DOUBLE in fpu_capabilities[init_settings.fputype])) then
|
||||||
begin
|
begin
|
||||||
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
||||||
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
|
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
|
||||||
|
@ -2361,6 +2361,10 @@ implementation
|
|||||||
{$ifdef xtensa}
|
{$ifdef xtensa}
|
||||||
and (FPUXTENSA_SINGLE in fpu_capabilities[init_settings.fputype]) and (tfloatdef(self).floattype=s32real)
|
and (FPUXTENSA_SINGLE in fpu_capabilities[init_settings.fputype]) and (tfloatdef(self).floattype=s32real)
|
||||||
{$endif xtensa}
|
{$endif xtensa}
|
||||||
|
{$ifdef arm}
|
||||||
|
and (((FPUARM_HAS_VFP_EXTENSION in fpu_capabilities[init_settings.fputype]) and (tfloatdef(self).floattype=s32real)) or
|
||||||
|
(FPUARM_HAS_VFP_DOUBLE in fpu_capabilities[init_settings.fputype]))
|
||||||
|
{$endif arm}
|
||||||
;
|
;
|
||||||
{$endif x86}
|
{$endif x86}
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user