* Fixed a_load_reg_reg for arm.

* Fixed sign/zero-extension in second_int_to_bool for all CPUs. x86 and pppc were not affected by this bug, but I fixed it for all CPUs for consistency.
* cg/tcnvint1 is passed on arm now.

git-svn-id: trunk@10669 -
This commit is contained in:
yury 2008-04-15 20:44:27 +00:00
parent 92d83f61a2
commit cf235145cb
6 changed files with 32 additions and 17 deletions

View File

@ -1033,7 +1033,7 @@ unit cgcpu;
instr: taicpu; instr: taicpu;
begin begin
conv_done:=false; conv_done:=false;
if tcgsize2size[tosize]<>tcgsize2size[fromsize] then if tosize<>fromsize then
begin begin
shifterop_reset(so); shifterop_reset(so);
if not do_conv(tosize) then if not do_conv(tosize) then

View File

@ -181,6 +181,7 @@ implementation
href : treference; href : treference;
resflags : tresflags; resflags : tresflags;
hlabel,oldTrueLabel,oldFalseLabel : tasmlabel; hlabel,oldTrueLabel,oldFalseLabel : tasmlabel;
newsize : tcgsize;
begin begin
oldTrueLabel:=current_procinfo.CurrTrueLabel; oldTrueLabel:=current_procinfo.CurrTrueLabel;
oldFalseLabel:=current_procinfo.CurrFalseLabel; oldFalseLabel:=current_procinfo.CurrFalseLabel;
@ -197,12 +198,14 @@ implementation
not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
begin begin
location_copy(location,left.location); location_copy(location,left.location);
location.size:=def_cgsize(resultdef); newsize:=def_cgsize(resultdef);
{ change of sign? Then we have to sign/zero-extend in } { change of sign? Then we have to sign/zero-extend in }
{ case of a loc_(c)register } { case of a loc_(c)register }
if (location.size<>left.location.size) and if (newsize<>left.location.size) and
(location.loc in [LOC_REGISTER,LOC_CREGISTER]) then (location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
location_force_reg(current_asmdata.CurrAsmList,location,location.size,true); location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;
current_procinfo.CurrTrueLabel:=oldTrueLabel; current_procinfo.CurrTrueLabel:=oldTrueLabel;
current_procinfo.CurrFalseLabel:=oldFalseLabel; current_procinfo.CurrFalseLabel:=oldFalseLabel;
exit; exit;

View File

@ -159,6 +159,7 @@ implementation
hreg2 : tregister; hreg2 : tregister;
resflags : tresflags; resflags : tresflags;
opsize : tcgsize; opsize : tcgsize;
newsize : tcgsize;
begin begin
secondpass(left); secondpass(left);
@ -171,13 +172,15 @@ implementation
not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
begin begin
location_copy(location,left.location); location_copy(location,left.location);
location.size:=def_cgsize(resultdef); newsize:=def_cgsize(resultdef);
{ change of sign? Then we have to sign/zero-extend in } { change of sign? Then we have to sign/zero-extend in }
{ case of a loc_(c)register } { case of a loc_(c)register }
if (location.size<>left.location.size) and if (newsize<>left.location.size) and
(location.loc in [LOC_REGISTER,LOC_CREGISTER]) then (location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
location_force_reg(current_asmdata.CurrAsmList,location,location.size,true); location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
{ ACTIVATE when loc_jump support is added else
location.size:=newsize;
{ ACTIVATE when loc_jump support is added
current_procinfo.CurrTrueLabel:=oldTrueLabel; current_procinfo.CurrTrueLabel:=oldTrueLabel;
current_procinfo.CurrFalseLabel:=oldFalseLabel; current_procinfo.CurrFalseLabel:=oldFalseLabel;
} }

View File

@ -76,6 +76,7 @@ implementation
resflags : tresflags; resflags : tresflags;
opsize : tcgsize; opsize : tcgsize;
hlabel, oldTrueLabel, oldFalseLabel : tasmlabel; hlabel, oldTrueLabel, oldFalseLabel : tasmlabel;
newsize : tcgsize;
begin begin
oldTrueLabel:=current_procinfo.CurrTrueLabel; oldTrueLabel:=current_procinfo.CurrTrueLabel;
oldFalseLabel:=current_procinfo.CurrFalseLabel; oldFalseLabel:=current_procinfo.CurrFalseLabel;
@ -92,12 +93,14 @@ implementation
not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
begin begin
location_copy(location,left.location); location_copy(location,left.location);
location.size:=def_cgsize(resultdef); newsize:=def_cgsize(resultdef);
{ change of sign? Then we have to sign/zero-extend in } { change of sign? Then we have to sign/zero-extend in }
{ case of a loc_(c)register } { case of a loc_(c)register }
if (location.size<>left.location.size) and if (newsize<>left.location.size) and
(location.loc in [LOC_REGISTER,LOC_CREGISTER]) then (location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
location_force_reg(current_asmdata.CurrAsmList,location,location.size,true); location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;
current_procinfo.CurrTrueLabel:=oldTrueLabel; current_procinfo.CurrTrueLabel:=oldTrueLabel;
current_procinfo.CurrFalseLabel:=oldFalseLabel; current_procinfo.CurrFalseLabel:=oldFalseLabel;
exit; exit;

View File

@ -224,6 +224,7 @@ implementation
resflags : tresflags; resflags : tresflags;
opsize : tcgsize; opsize : tcgsize;
hlabel,oldTrueLabel,oldFalseLabel : tasmlabel; hlabel,oldTrueLabel,oldFalseLabel : tasmlabel;
newsize : tcgsize;
begin begin
oldTrueLabel:=current_procinfo.CurrTrueLabel; oldTrueLabel:=current_procinfo.CurrTrueLabel;
oldFalseLabel:=current_procinfo.CurrFalseLabel; oldFalseLabel:=current_procinfo.CurrFalseLabel;
@ -240,12 +241,14 @@ implementation
not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
begin begin
location_copy(location,left.location); location_copy(location,left.location);
location.size:=def_cgsize(resultdef); newsize:=def_cgsize(resultdef);
{ change of sign? Then we have to sign/zero-extend in } { change of sign? Then we have to sign/zero-extend in }
{ case of a loc_(c)register } { case of a loc_(c)register }
if (location.size<>left.location.size) and if (newsize<>left.location.size) and
(location.loc in [LOC_REGISTER,LOC_CREGISTER]) then (location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
location_force_reg(current_asmdata.CurrAsmList,location,location.size,true); location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;
current_procinfo.CurrTrueLabel:=oldTrueLabel; current_procinfo.CurrTrueLabel:=oldTrueLabel;
current_procinfo.CurrFalseLabel:=oldFalseLabel; current_procinfo.CurrFalseLabel:=oldFalseLabel;
exit; exit;

View File

@ -94,6 +94,7 @@ implementation
{$endif not cpu64bitalu} {$endif not cpu64bitalu}
resflags : tresflags; resflags : tresflags;
hlabel,oldTrueLabel,oldFalseLabel : tasmlabel; hlabel,oldTrueLabel,oldFalseLabel : tasmlabel;
newsize : tcgsize;
begin begin
oldTrueLabel:=current_procinfo.CurrTrueLabel; oldTrueLabel:=current_procinfo.CurrTrueLabel;
oldFalseLabel:=current_procinfo.CurrFalseLabel; oldFalseLabel:=current_procinfo.CurrFalseLabel;
@ -109,12 +110,14 @@ implementation
not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
begin begin
location_copy(location,left.location); location_copy(location,left.location);
location.size:=def_cgsize(resultdef); newsize:=def_cgsize(resultdef);
{ change of sign? Then we have to sign/zero-extend in } { change of sign? Then we have to sign/zero-extend in }
{ case of a loc_(c)register } { case of a loc_(c)register }
if (location.size<>left.location.size) and if (newsize<>left.location.size) and
(location.loc in [LOC_REGISTER,LOC_CREGISTER]) then (location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
location_force_reg(current_asmdata.CurrAsmList,location,location.size,true); location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;
current_procinfo.CurrTrueLabel:=oldTrueLabel; current_procinfo.CurrTrueLabel:=oldTrueLabel;
current_procinfo.CurrFalseLabel:=oldFalseLabel; current_procinfo.CurrFalseLabel:=oldFalseLabel;
exit; exit;