* also use LOC_CSUBSETREF

* set expectloc properly for packed arrays

git-svn-id: trunk@4480 -
This commit is contained in:
Jonas Maebe 2006-08-20 19:28:10 +00:00
parent 35c58e24b4
commit 1ab3d81541
2 changed files with 18 additions and 5 deletions

View File

@ -465,7 +465,10 @@ implementation
sref.bitindexreg := reg;
sref.startbit := 0;
sref.bitlen := resulttype.def.packedbitsize;
location.loc := LOC_SUBSETREF;
if (left.location.loc = LOC_REFERENCE) then
location.loc := LOC_SUBSETREF
else
location.loc := LOC_CSUBSETREF;
location.sref := sref;
end;
@ -731,7 +734,10 @@ implementation
subsetref.bitindexreg := NR_NO;
subsetref.startbit := (mulsize * (tordconstnode(right).value-tarraydef(left.resulttype.def).lowrange)) and ((1 shl (3+alignpow))-1);
subsetref.bitlen := resulttype.def.packedbitsize;
location.loc := LOC_SUBSETREF;
if (left.location.loc = LOC_REFERENCE) then
location.loc := LOC_SUBSETREF
else
location.loc := LOC_CSUBSETREF;
location.sref := subsetref;
end;
end

View File

@ -851,10 +851,17 @@ implementation
{$ifdef SUPPORT_MMX}
registersmmx:=max(left.registersmmx,right.registersmmx);
{$endif SUPPORT_MMX}
if left.expectloc=LOC_CREFERENCE then
expectloc:=LOC_CREFERENCE
if (not is_packed_array(left.resulttype.def)) or
((tarraydef(left.resulttype.def).elepackedbitsize mod 8) = 0) then
if left.expectloc=LOC_CREFERENCE then
expectloc:=LOC_CREFERENCE
else
expectloc:=LOC_REFERENCE
else
expectloc:=LOC_REFERENCE;
if left.expectloc=LOC_CREFERENCE then
expectloc:=LOC_CSUBSETREF
else
expectloc:=LOC_SUBSETREF;
end;