* fixed alignment of double, extended, int64 and qword on i386-darwin

git-svn-id: trunk@2870 -
This commit is contained in:
Jonas Maebe 2006-03-11 22:01:11 +00:00
parent eb5d494b12
commit 659d3e106d
2 changed files with 28 additions and 4 deletions

View File

@ -365,6 +365,7 @@ interface
procedure ppuwrite(ppufile:tcompilerppufile);override;
function is_publishable : boolean;override;
function gettypename:string;override;
function alignment:longint;override;
procedure setsize;
function getvartype : longint;override;
{ rtti }
@ -379,6 +380,7 @@ interface
procedure ppuwrite(ppufile:tcompilerppufile);override;
function gettypename:string;override;
function is_publishable : boolean;override;
function alignment:longint;override;
procedure setsize;
function getvartype:longint;override;
{ rtti }
@ -1620,6 +1622,16 @@ implementation
end;
function torddef.alignment:longint;
begin
if (target_info.system = system_i386_darwin) and
(typ in [s64bit,u64bit]) then
result := 4
else
result := inherited alignment;
end;
procedure torddef.setsize;
const
sizetbl : array[tbasetype] of longint = (
@ -1786,6 +1798,22 @@ implementation
end;
function tfloatdef.alignment:longint;
begin
if (target_info.system = system_i386_darwin) then
case typ of
s80real : result:=16;
s64real,
s64currency,
s64comp : result:=4;
else
result := inherited alignment;
end
else
result := inherited alignment;
end;
procedure tfloatdef.setsize;
begin
case typ of

View File

@ -941,10 +941,6 @@ implementation
fieldalignment:=4
else if (varalign>1) and (fieldalignment<2) then
fieldalignment:=2;
{ darwin/x86 aligns long doubles on 16 bytes }
if (target_info.system = system_i386_darwin) and
(fieldalignment = 12) then
fieldalignment := 16;
end;
fieldalignment:=min(fieldalignment,aktalignment.maxCrecordalign);
end;