+ some initial darwin/x86 stuff:

* align stack to 16 bytes
    * extended takes 16 bytes
    * <= 8 byte records are passed in registers

git-svn-id: trunk@1224 -
This commit is contained in:
Jonas Maebe 2005-09-29 11:31:26 +00:00
parent 6499d65c39
commit f3384bab09
5 changed files with 91 additions and 2 deletions

View File

@ -111,6 +111,19 @@ unit cpupara;
end;
end;
end;
system_i386_darwin :
begin
case def.deftype of
recorddef :
begin
if (def.size <= 8) then
begin
result := false;
exit;
end;
end;
end;
end;
end;
result:=inherited ret_in_param(def,calloption);
end;

View File

@ -56,7 +56,10 @@ unit cpupi;
begin
{ align to 4 bytes at least
otherwise all those subl $2,%esp are meaningless PM }
result:=Align(tg.direction*tg.lasttemp,min(aktalignment.localalignmin,4));
if (target_info.system <> target_i386_darwin) then
result:=Align(tg.direction*tg.lasttemp,min(aktalignment.localalignmin,4))
else
result:=Align(tg.direction*tg.lasttemp,min(aktalignment.localalgnmin,16));
end;

View File

@ -1055,6 +1055,10 @@ 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;

View File

@ -120,7 +120,9 @@ interface
system_i386_wince, { 40 }
system_x86_6432_linux, { 41 }
system_arm_gba, { 42 }
system_powerpc64_linux { 43 }
system_arm_gba, { 42 }
system_powerpc64_linux, { 43 }
system_i386_darwin { 44 }
);
tasm = (as_none

View File

@ -470,6 +470,70 @@ unit i_bsd;
abi : abi_powerpc_aix;
);
system_i386_darwin_info : tsysteminfo =
(
system : system_i386_darwin;
name : 'Darwin for i386';
shortname : 'Darwin';
flags : [];
cpu : cpu_i386;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
exeext : '';
defext : '.def';
scriptext : '.sh';
smartext : '.sl';
unitext : '.ppu';
unitlibext : '.ppl';
asmext : '.s';
objext : '.o';
resext : '.res';
resobjext : '.or';
sharedlibext : '.dylib';
staticlibext : '.a';
staticlibprefix : 'libp';
sharedlibprefix : 'lib';
sharedClibext : '.dylib';
staticClibext : '.a';
staticClibprefix : 'lib';
sharedClibprefix : 'lib';
p_ext_support : true;
Cprefix : '_';
newline : #10;
dirsep : '/';
files_case_relevent : true;
assem : as_darwin;
assemextern : as_darwin;
link : nil;
linkextern : nil;
ar : ar_gnu_ar;
res : res_none;
dbg : dbg_stabs;
script : script_unix;
endian : endian_big;
alignment :
(
procalign : 16;
loopalign : 4;
jumpalign : 0;
constalignmin : 0;
constalignmax : 4;
varalignmin : 0;
varalignmax : 4;
localalignmin : 0;
localalignmax : 4;
recordalignmin : 0;
recordalignmax : 16;
maxCrecordalign : 16
);
first_parm_offset : 8;
stacksize : 262144;
DllScanSupported:false;
use_function_relative_addresses : true;
);
implementation
initialization
@ -483,6 +547,9 @@ initialization
{$ifdef OpenBSD}
set_source_info(system_i386_NetBSD_info);
{$endif}
{$ifdef Darwin}
set_source_info(system_i386_Darwin_info);
{$endif Darwin}
{$endif cpu86}
{$ifdef cpux86_64}
{$ifdef FreeBSD}