+ support for unaligned function

git-svn-id: trunk@3350 -
This commit is contained in:
florian 2006-04-29 11:15:29 +00:00
parent 9ad6409662
commit 9e00f894a9
7 changed files with 45 additions and 3 deletions

View File

@ -56,6 +56,9 @@ unit cgutils;
{ (An)+ and -(An) }
direction : tdirection;
{$endif m68k}
{$ifdef SUPPORT_UNALIGNED}
alignment : byte;
{$endif SUPPORT_UNALIGNED}
end;
tlocation = record

View File

@ -62,6 +62,7 @@ const
in_leave = 51; {macpas}
in_cycle = 52; {macpas}
in_slice_x = 53;
in_unaligned_x = 54;
{ Internal constant functions }
in_const_sqr = 100;

View File

@ -94,3 +94,4 @@
{ Use the internal linker by default }
{ define INTERNALLINKER}
{$define SUPPORT_UNALIGNED}

View File

@ -150,6 +150,15 @@ implementation
begin
second_assigned;
end;
{$ifdef SUPPORT_UNALIGNED}
in_unaligned_x:
begin
secondpass(tcallparanode(left).left);
location:=tcallparanode(left).left.location;
if location.loc in [LOC_CREFERENCE,LOC_REFERENCE] then
location.reference.alignment:=1;
end;
{$endif SUPPORT_UNALIGNED}
{$ifdef SUPPORT_MMX}
in_mmx_pcmpeqb..in_mmx_pcmpgtw:
begin

View File

@ -2012,15 +2012,21 @@ implementation
end;
end;
{$ifdef SUPPORT_MMX}
{$ifdef SUPPORT_MMX}
in_mmx_pcmpeqb..in_mmx_pcmpgtw:
begin
end;
{$endif SUPPORT_MMX}
{$endif SUPPORT_MMX}
in_prefetch_var:
begin
resulttype:=voidtype;
end;
{$ifdef SUPPORT_UNALIGNED}
in_unaligned_x:
begin
resulttype:=left.resulttype;
end;
{$endif SUPPORT_UNALIGNED}
in_assert_x_y :
begin
resulttype:=voidtype;
@ -2409,7 +2415,12 @@ implementation
begin
expectloc:=LOC_VOID;
end;
{$ifdef SUPPORT_UNALIGNED}
in_unaligned_x:
begin
expectloc:=left.expectloc;
end;
{$endif SUPPORT_UNALIGNED}
else
internalerror(8);
end;

View File

@ -520,6 +520,20 @@ implementation
statement_syssym:=p2;
end;
{$ifdef SUPPORT_UNALIGNED}
in_unaligned_x :
begin
err:=false;
consume(_LKLAMMER);
in_args:=true;
p1:=comp_expr(true);
p2:=ccallparanode.create(p1,nil);
p2:=geninlinenode(in_unaligned_x,false,p2);
consume(_RKLAMMER);
statement_syssym:=p2;
end;
{$endif SUPPORT_UNALIGNED}
in_assigned_x :
begin
err:=false;

View File

@ -90,6 +90,9 @@ implementation
systemunit.insert(tsyssym.create('Length',in_length_x));
systemunit.insert(tsyssym.create('New',in_new_x));
systemunit.insert(tsyssym.create('Dispose',in_dispose_x));
{$ifdef SUPPORT_UNALIGNED}
systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x));
{$endif SUPPORT_UNALIGNED}
end;