mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-18 22:59:28 +01:00
* refactored cg64f32.splitparaloc64 to use cgpara.locations_count
git-svn-id: trunk@24531 -
This commit is contained in:
parent
3e22ec43b5
commit
49bd829ffc
@ -143,107 +143,110 @@ unit cg64f32;
|
|||||||
cgparalo.intsize:=4;
|
cgparalo.intsize:=4;
|
||||||
cgparalo.alignment:=cgpara.alignment;
|
cgparalo.alignment:=cgpara.alignment;
|
||||||
paraloclo:=cgparalo.add_location;
|
paraloclo:=cgparalo.add_location;
|
||||||
{ 4 parameter fields? }
|
case cgpara.locations_count of
|
||||||
if assigned(cgpara.location^.next) and assigned(cgpara.location^.next^.next) and assigned(cgpara.location^.next^.next^.next) then
|
4:
|
||||||
begin
|
begin
|
||||||
{ Order for multiple locations is always
|
{ 4 parameter fields? }
|
||||||
paraloc^ -> high
|
{ Order for multiple locations is always
|
||||||
paraloc^.next -> low }
|
paraloc^ -> high
|
||||||
if (target_info.endian=ENDIAN_BIG) then
|
|
||||||
begin
|
|
||||||
{ paraloc^ -> high }
|
|
||||||
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
|
||||||
paralochi^.next:=nil;
|
|
||||||
paralochi2:=cgparahi.add_location;
|
|
||||||
move(cgpara.location^.next,paralochi2^,sizeof(paralochi2^));
|
|
||||||
|
|
||||||
{ paraloc^.next^.next^ -> low }
|
|
||||||
move(cgpara.location^.next^.next^,paraloclo^,sizeof(paraloclo^));
|
|
||||||
paraloclo^.next:=nil;
|
|
||||||
paraloclo2:=cgparalo.add_location;
|
|
||||||
move(cgpara.location^.next^.next^.next^,paraloclo2^,sizeof(paraloclo2^));
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
{ paraloc^ -> low }
|
|
||||||
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
|
||||||
paraloclo^.next:=nil;
|
|
||||||
paraloclo2:=cgparalo.add_location;
|
|
||||||
move(cgpara.location^.next^,paraloclo2^,sizeof(paraloclo2^));
|
|
||||||
|
|
||||||
{ paraloc^.next^.next -> high }
|
|
||||||
move(cgpara.location^.next^.next^,paralochi^,sizeof(paralochi^));
|
|
||||||
paralochi^.next:=nil;
|
|
||||||
paralochi2:=cgparahi.add_location;
|
|
||||||
move(cgpara.location^.next^.next^.next^,paralochi2^,sizeof(paralochi2^));
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ fix size }
|
|
||||||
paraloclo^.size:=OS_16;
|
|
||||||
paraloclo2^.size:=OS_16;
|
|
||||||
paraloclo2^.next:=nil;
|
|
||||||
paralochi^.size:=OS_16;
|
|
||||||
paralochi2^.size:=OS_16;
|
|
||||||
paralochi2^.next:=nil;
|
|
||||||
if cgpara.size=OS_S64 then
|
|
||||||
if target_info.endian=ENDIAN_BIG then
|
|
||||||
paralochi^.size:=OS_S16
|
|
||||||
else
|
|
||||||
paraloclo2^.size:=OS_S16;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
{ 2 parameter fields? }
|
|
||||||
if assigned(cgpara.location^.next) then
|
|
||||||
begin
|
|
||||||
{ Order for multiple locations is always
|
|
||||||
paraloc^ -> high
|
|
||||||
paraloc^.next -> low }
|
|
||||||
if (target_info.endian=ENDIAN_BIG) then
|
|
||||||
begin
|
|
||||||
{ paraloc^ -> high
|
|
||||||
paraloc^.next -> low }
|
paraloc^.next -> low }
|
||||||
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
if (target_info.endian=ENDIAN_BIG) then
|
||||||
move(cgpara.location^.next^,paraloclo^,sizeof(paraloclo^));
|
begin
|
||||||
end
|
{ paraloc^ -> high }
|
||||||
else
|
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
||||||
begin
|
paralochi^.next:=nil;
|
||||||
{ paraloc^ -> low
|
paralochi2:=cgparahi.add_location;
|
||||||
paraloc^.next -> high }
|
move(cgpara.location^.next,paralochi2^,sizeof(paralochi2^));
|
||||||
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
|
||||||
move(cgpara.location^.next^,paralochi^,sizeof(paralochi^));
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ fix size }
|
{ paraloc^.next^.next^ -> low }
|
||||||
paraloclo^.size:=cgparalo.size;
|
move(cgpara.location^.next^.next^,paraloclo^,sizeof(paraloclo^));
|
||||||
paraloclo^.next:=nil;
|
paraloclo^.next:=nil;
|
||||||
paralochi^.size:=cgparahi.size;
|
paraloclo2:=cgparalo.add_location;
|
||||||
paralochi^.next:=nil;
|
move(cgpara.location^.next^.next^.next^,paraloclo2^,sizeof(paraloclo2^));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ single parameter, this can only be in memory }
|
{ paraloc^ -> low }
|
||||||
if cgpara.location^.loc<>LOC_REFERENCE then
|
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
||||||
internalerror(200408282);
|
paraloclo^.next:=nil;
|
||||||
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
paraloclo2:=cgparalo.add_location;
|
||||||
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
move(cgpara.location^.next^,paraloclo2^,sizeof(paraloclo2^));
|
||||||
{ for big endian low is at +4, for little endian high }
|
|
||||||
if target_info.endian = endian_big then
|
|
||||||
begin
|
|
||||||
inc(cgparalo.location^.reference.offset,4);
|
|
||||||
cgparalo.alignment:=newalignment(cgparalo.alignment,4);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
inc(cgparahi.location^.reference.offset,4);
|
|
||||||
cgparahi.alignment:=newalignment(cgparahi.alignment,4);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ fix size }
|
{ paraloc^.next^.next -> high }
|
||||||
paraloclo^.size:=cgparalo.size;
|
move(cgpara.location^.next^.next^,paralochi^,sizeof(paralochi^));
|
||||||
paraloclo^.next:=nil;
|
paralochi^.next:=nil;
|
||||||
paralochi^.size:=cgparahi.size;
|
paralochi2:=cgparahi.add_location;
|
||||||
paralochi^.next:=nil;
|
move(cgpara.location^.next^.next^.next^,paralochi2^,sizeof(paralochi2^));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ fix size }
|
||||||
|
paraloclo^.size:=OS_16;
|
||||||
|
paraloclo2^.size:=OS_16;
|
||||||
|
paraloclo2^.next:=nil;
|
||||||
|
paralochi^.size:=OS_16;
|
||||||
|
paralochi2^.size:=OS_16;
|
||||||
|
paralochi2^.next:=nil;
|
||||||
|
if cgpara.size=OS_S64 then
|
||||||
|
if target_info.endian=ENDIAN_BIG then
|
||||||
|
paralochi^.size:=OS_S16
|
||||||
|
else
|
||||||
|
paraloclo2^.size:=OS_S16;
|
||||||
|
end;
|
||||||
|
2:
|
||||||
|
begin
|
||||||
|
{ 2 parameter fields? }
|
||||||
|
{ Order for multiple locations is always
|
||||||
|
paraloc^ -> high
|
||||||
|
paraloc^.next -> low }
|
||||||
|
if (target_info.endian=ENDIAN_BIG) then
|
||||||
|
begin
|
||||||
|
{ paraloc^ -> high
|
||||||
|
paraloc^.next -> low }
|
||||||
|
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
||||||
|
move(cgpara.location^.next^,paraloclo^,sizeof(paraloclo^));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ paraloc^ -> low
|
||||||
|
paraloc^.next -> high }
|
||||||
|
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
||||||
|
move(cgpara.location^.next^,paralochi^,sizeof(paralochi^));
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ fix size }
|
||||||
|
paraloclo^.size:=cgparalo.size;
|
||||||
|
paraloclo^.next:=nil;
|
||||||
|
paralochi^.size:=cgparahi.size;
|
||||||
|
paralochi^.next:=nil;
|
||||||
|
end;
|
||||||
|
1:
|
||||||
|
begin
|
||||||
|
{ single parameter, this can only be in memory }
|
||||||
|
if cgpara.location^.loc<>LOC_REFERENCE then
|
||||||
|
internalerror(200408282);
|
||||||
|
move(cgpara.location^,paraloclo^,sizeof(paraloclo^));
|
||||||
|
move(cgpara.location^,paralochi^,sizeof(paralochi^));
|
||||||
|
{ for big endian low is at +4, for little endian high }
|
||||||
|
if target_info.endian = endian_big then
|
||||||
|
begin
|
||||||
|
inc(cgparalo.location^.reference.offset,4);
|
||||||
|
cgparalo.alignment:=newalignment(cgparalo.alignment,4);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
inc(cgparahi.location^.reference.offset,4);
|
||||||
|
cgparahi.alignment:=newalignment(cgparahi.alignment,4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ fix size }
|
||||||
|
paraloclo^.size:=cgparalo.size;
|
||||||
|
paraloclo^.next:=nil;
|
||||||
|
paralochi^.size:=cgparahi.size;
|
||||||
|
paralochi^.next:=nil;
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
internalerror(2013051901);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user