|
@@ -1386,7 +1386,10 @@ implementation
|
|
|
|
|
|
procedure thlcgllvm.a_loadfpu_reg_ref(list: TAsmList; fromsize, tosize: tdef; reg: tregister; const ref: treference);
|
|
|
var
|
|
|
+ pd: tprocdef;
|
|
|
+ roundpara, respara: tcgpara;
|
|
|
tmpreg: tregister;
|
|
|
+ tmploc: tlocation;
|
|
|
href: treference;
|
|
|
fromcompcurr,
|
|
|
tocompcurr: boolean;
|
|
@@ -1407,8 +1410,23 @@ implementation
|
|
|
begin
|
|
|
tmpreg:=getfpuregister(list,tosize);
|
|
|
if tocompcurr then
|
|
|
- { store back an int64 rather than an extended }
|
|
|
- list.concat(taillvm.op_reg_size_reg_size(la_fptosi,tmpreg,fromsize,reg,tosize))
|
|
|
+ begin
|
|
|
+ { store back an int64 rather than an extended }
|
|
|
+ pd:=search_system_proc('fpc_round_real');
|
|
|
+ roundpara.init;
|
|
|
+ paramanager.getcgtempparaloc(list,pd,1,roundpara);
|
|
|
+ a_load_reg_cgpara(list,fromsize,reg,roundpara);
|
|
|
+ respara:=g_call_system_proc(list,pd,[@roundpara],nil);
|
|
|
+ if not assigned(respara.location) or
|
|
|
+ (respara.location^.loc<>LOC_REGISTER) then
|
|
|
+ internalerror(2023120510);
|
|
|
+ location_reset(tmploc,respara.location^.loc,def_cgsize(tosize));
|
|
|
+ tmploc.register:=tmpreg;
|
|
|
+ gen_load_cgpara_loc(list,respara.location^.def,respara,tmploc,false);
|
|
|
+ respara.resetiftemp;
|
|
|
+ respara.done;
|
|
|
+ roundpara.done;
|
|
|
+ end
|
|
|
else
|
|
|
a_loadfpu_reg_reg(list,fromsize,tosize,reg,tmpreg);
|
|
|
end
|