end;
LOC_FPUREGISTER,LOC_CFPUREGISTER:
begin
- a_loadfpu_ref_reg(list,size,location^.size,tmpref,location^.register);
+ a_loadfpu_ref_reg(list,location^.size,location^.size,tmpref,location^.register);
end
else
internalerror(2010053111);
procedure tcg.a_loadfpu_ref_cgpara(list : TAsmList;size : tcgsize;const ref : treference;const cgpara : TCGPara);
var
- href : treference;
- hsize: tcgsize;
- paraloc: PCGParaLocation;
+ srcref,
+ href : treference;
+ hsize: tcgsize;
+ paraloc: PCGParaLocation;
+ sizeleft: tcgint;
begin
- case cgpara.location^.loc of
- LOC_FPUREGISTER,LOC_CFPUREGISTER:
- begin
- paramanager.alloccgpara(list,cgpara);
- paraloc:=cgpara.location;
- href:=ref;
- while assigned(paraloc) do
- begin
- if not(paraloc^.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
- internalerror(2015031501);
- a_loadfpu_ref_reg(list,paraloc^.size,paraloc^.size,href,paraloc^.register);
- inc(href.offset,tcgsize2size[paraloc^.size]);
- paraloc:=paraloc^.next;
- end;
- end;
- LOC_REFERENCE,LOC_CREFERENCE:
- begin
- cgpara.check_simple_location;
- reference_reset_base(href,cgpara.location^.reference.index,cgpara.location^.reference.offset,ctempposinvalid,cgpara.alignment,[]);
- { concatcopy should choose the best way to copy the data }
- g_concatcopy(list,ref,href,tcgsize2size[size]);
- end;
- LOC_REGISTER,LOC_CREGISTER:
- begin
- { force integer size }
- hsize:=int_cgsize(tcgsize2size[size]);
-{$ifndef cpu64bitalu}
- if (hsize in [OS_S64,OS_64]) then
- cg64.a_load64_ref_cgpara(list,ref,cgpara)
- else
-{$endif not cpu64bitalu}
- begin
- cgpara.check_simple_location;
- a_load_ref_cgpara(list,hsize,ref,cgpara)
- end;
- end
- else
- internalerror(200402201);
- end;
+ sizeleft:=cgpara.intsize;
+ paraloc:=cgpara.location;
+ paramanager.alloccgpara(list,cgpara);
+ srcref:=ref;
+ repeat
+ case paraloc^.loc of
+ LOC_FPUREGISTER,LOC_CFPUREGISTER:
+ begin
+ { force fpu size }
+ hsize:=int_float_cgsize(tcgsize2size[paraloc^.size]);
+ a_loadfpu_ref_reg(list,hsize,hsize,srcref,paraloc^.register);
+ end;
+ LOC_REFERENCE,LOC_CREFERENCE:
+ begin
+ if assigned(paraloc^.next) then
+ internalerror(2020050101);
+ reference_reset_base(href,paraloc^.reference.index,paraloc^.reference.offset,ctempposinvalid,newalignment(cgpara.alignment,cgpara.intsize-sizeleft),[]);
+ { concatcopy should choose the best way to copy the data }
+ g_concatcopy(list,srcref,href,sizeleft);
+ end;
+ LOC_REGISTER,LOC_CREGISTER:
+ begin
+ { force integer size }
+ hsize:=int_cgsize(tcgsize2size[paraloc^.size]);
+ {$ifndef cpu64bitalu}
+ if (hsize in [OS_S64,OS_64]) then
+ begin
+ { if this is not a simple location, we'll have to add support to cg64 to load parts of a cgpara }
+ cgpara.check_simple_location;
+ cg64.a_load64_ref_cgpara(list,srcref,cgpara)
+ end
+ else
+ {$endif not cpu64bitalu}
+ begin
+ a_load_ref_reg(list,hsize,hsize,srcref,paraloc^.register)
+ end;
+ end
+ else
+ internalerror(200402201);
+ end;
+ inc(srcref.offset,tcgsize2size[paraloc^.size]);
+ dec(sizeleft,tcgsize2size[paraloc^.size]);
+ paraloc:=paraloc^.next;
+ until not assigned(paraloc);
end;