mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:09:32 +02:00
+ support for unaligned function
git-svn-id: trunk@3350 -
This commit is contained in:
parent
9ad6409662
commit
9e00f894a9
@ -56,6 +56,9 @@ unit cgutils;
|
||||
{ (An)+ and -(An) }
|
||||
direction : tdirection;
|
||||
{$endif m68k}
|
||||
{$ifdef SUPPORT_UNALIGNED}
|
||||
alignment : byte;
|
||||
{$endif SUPPORT_UNALIGNED}
|
||||
end;
|
||||
|
||||
tlocation = record
|
||||
|
@ -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;
|
||||
|
@ -94,3 +94,4 @@
|
||||
|
||||
{ Use the internal linker by default }
|
||||
{ define INTERNALLINKER}
|
||||
{$define SUPPORT_UNALIGNED}
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user