mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +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;
|
||||
fpu_vfpv3_d16:
|
||||
result:='-mfpu=vfpv3-d16 '+result;
|
||||
fpu_fpv4_sp_d16,
|
||||
fpu_fpv4_s16:
|
||||
result:='-mfpu=fpv4-sp-d16 '+result;
|
||||
fpu_vfpv4:
|
||||
|
@ -149,7 +149,7 @@ unit cpupara;
|
||||
getparaloc:=LOC_MMREGISTER
|
||||
else if (calloption in cdecl_pocalls) 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,
|
||||
but Mac OS X doesn't seem to do that and linux only does it if
|
||||
built with the "-mfloat-abi=hard" option }
|
||||
@ -782,7 +782,7 @@ unit cpupara;
|
||||
end
|
||||
else if (p.proccalloption in [pocall_softfloat]) 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
|
||||
case retcgsize of
|
||||
OS_64,
|
||||
|
@ -576,77 +576,19 @@ interface
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function tarmaddnode.first_addfloat: tnode;
|
||||
var
|
||||
procname: string[31];
|
||||
{ do we need to reverse the result ? }
|
||||
notnode : boolean;
|
||||
fdef : tdef;
|
||||
begin
|
||||
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
|
||||
case tfloatdef(left.resultdef).floattype of
|
||||
s32real:
|
||||
begin
|
||||
result:=nil;
|
||||
notnode:=false;
|
||||
end;
|
||||
;
|
||||
s64real:
|
||||
begin
|
||||
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;
|
||||
result:=first_addfloat_soft;
|
||||
else
|
||||
internalerror(2019050933);
|
||||
end;
|
||||
|
@ -55,7 +55,9 @@ interface
|
||||
begin
|
||||
result:=nil;
|
||||
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
|
||||
else
|
||||
expectloc:=LOC_CREFERENCE;
|
||||
@ -76,7 +78,9 @@ interface
|
||||
|
||||
begin
|
||||
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
|
||||
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
||||
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
|
||||
|
@ -2361,6 +2361,10 @@ implementation
|
||||
{$ifdef xtensa}
|
||||
and (FPUXTENSA_SINGLE in fpu_capabilities[init_settings.fputype]) and (tfloatdef(self).floattype=s32real)
|
||||
{$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}
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user