powerpc: improved version of int_to_bool casting. now both also passes the improved version of tb0625

git-svn-id: trunk@35109 -
This commit is contained in:
Károly Balogh 2016-12-11 16:00:27 +00:00
parent df38fd18e0
commit 1dd375cd61

View File

@ -59,7 +59,7 @@ implementation
uses
verbose,globtype,globals,systems,
symconst,symdef,aasmbase,aasmtai,aasmdata,
defutil,
defutil,cutils,
cgbase,cgutils,pass_1,pass_2,
ncgutil,procinfo,
cpubase,aasmcpu,
@ -91,34 +91,19 @@ implementation
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
if (tcgsize2size[newsize]>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
begin
{$ifndef cpu64bitalu}
if (left.location.size in [OS_64,OS_S64]) and (left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
begin
hreg1:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,left.location.reference,hreg1);
hreg2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
href:=left.location.reference;
inc(href.offset,4);
cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_INT,OS_INT,href,hreg2);
cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,hreg1,hreg2,hreg1);
if left.location.loc<>LOC_CREGISTER then
location_reset(location,LOC_REGISTER,def_cgsize(resultdef))
else
location_reset(location,LOC_CREGISTER,def_cgsize(resultdef));
location.register:=hreg1;
{ Release temp if it was a reference }
if left.location.loc=LOC_REFERENCE then
location_freetemp(current_asmdata.CurrAsmList,left.location);
end
else
{$endif not cpu64bitalu}
hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,true)
end
hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,true)
else
location.size:=newsize;
begin
location.size:=newsize;
if (target_info.endian = ENDIAN_BIG) and
(location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
begin
inc(location.reference.offset,TCGSize2Size[left.location.size]-TCGSize2Size[location.size]);
location.reference.alignment:=newalignment(location.reference.alignment,TCGSize2Size[left.location.size]-TCGSize2Size[location.size]);
end;
end;
exit;
end;