mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-12 02:20:36 +01:00
+ xtensa: make use of float.s instruction
git-svn-id: trunk@46962 -
This commit is contained in:
parent
4ced513363
commit
1c370ccde1
@ -33,6 +33,8 @@ interface
|
|||||||
protected
|
protected
|
||||||
function first_real_to_real: tnode;override;
|
function first_real_to_real: tnode;override;
|
||||||
procedure second_int_to_bool;override;
|
procedure second_int_to_bool;override;
|
||||||
|
procedure second_int_to_real;override;
|
||||||
|
function first_int_to_real: tnode;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -67,7 +69,7 @@ implementation
|
|||||||
left:=nil;
|
left:=nil;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
internalerror(200610151);
|
internalerror(2020092603);
|
||||||
end;
|
end;
|
||||||
s64real:
|
s64real:
|
||||||
case tfloatdef(resultdef).floattype of
|
case tfloatdef(resultdef).floattype of
|
||||||
@ -80,10 +82,10 @@ implementation
|
|||||||
left:=nil;
|
left:=nil;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
internalerror(200610152);
|
internalerror(2020092602);
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
internalerror(200610153);
|
internalerror(2020092601);
|
||||||
end;
|
end;
|
||||||
left:=nil;
|
left:=nil;
|
||||||
firstpass(result);
|
firstpass(result);
|
||||||
@ -94,7 +96,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure tcputypeconvnode.second_int_to_bool;
|
procedure tcputypeconvnode.second_int_to_bool;
|
||||||
var
|
var
|
||||||
hreg1, onereg: tregister;
|
hreg1, onereg: tregister;
|
||||||
@ -187,6 +188,41 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tcputypeconvnode.first_int_to_real: tnode;
|
||||||
|
var
|
||||||
|
fname: string[19];
|
||||||
|
begin
|
||||||
|
if (cs_fp_emulation in current_settings.moduleswitches) or
|
||||||
|
(current_settings.fputype=fpu_soft) or
|
||||||
|
not(FPUXTENSA_SINGLE in fpu_capabilities[current_settings.fputype]) or
|
||||||
|
((is_double(resultdef)) and not(FPUXTENSA_DOUBLE in fpu_capabilities[current_settings.fputype])) or
|
||||||
|
is_64bitint(left.resultdef) or
|
||||||
|
is_currency(left.resultdef) or
|
||||||
|
(is_32bit(left.resultdef) and not(is_signed(left.resultdef))) then
|
||||||
|
result:=inherited first_int_to_real
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ other integers are supposed to be 32 bit }
|
||||||
|
inserttypeconv(left,s32inttype);
|
||||||
|
firstpass(left);
|
||||||
|
result:=nil;
|
||||||
|
expectloc:=LOC_FPUREGISTER;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure tcputypeconvnode.second_int_to_real;
|
||||||
|
var
|
||||||
|
ai: taicpu;
|
||||||
|
begin
|
||||||
|
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||||
|
location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
|
||||||
|
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,s32inttype,true);
|
||||||
|
ai:=taicpu.op_reg_reg_const(A_FLOAT,location.register,left.location.register,0);
|
||||||
|
ai.oppostfix:=PF_S;
|
||||||
|
current_asmdata.CurrAsmList.concat(ai);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ctypeconvnode:=tcputypeconvnode;
|
ctypeconvnode:=tcputypeconvnode;
|
||||||
end.
|
end.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user