* cleaned up r10705 for ppc, improved comments

git-svn-id: trunk@10721 -
This commit is contained in:
tom_at_work 2008-04-19 19:54:09 +00:00
parent 714523866b
commit ee76679326
2 changed files with 18 additions and 19 deletions

View File

@ -352,14 +352,15 @@ const
fromsize := tosize;
op := loadinstr[fromsize,ref2.index<>NR_NO,false];
a_load_store(list,op,reg,ref2);
{ sign extend shortint if necessary, since there is no }
{ load instruction that does that automatically (JM) }
if (fromsize = OS_S8) then
begin
list.concat(taicpu.op_reg_reg(A_EXTSB,reg,reg));
if (tosize = OS_16) then
a_load_reg_reg(list,fromsize,tosize,reg,reg);
end;
{ sign extend shortint if necessary (because there is
no load instruction to sign extend an 8 bit value automatically)
and mask out extra sign bits when loading from a smaller signed
to a larger unsigned type }
if fromsize = OS_S8 then
begin
a_load_reg_reg(list, OS_8, OS_S8, reg, reg);
a_load_reg_reg(list, OS_S8, tosize, reg, reg);
end;
end;

View File

@ -734,17 +734,15 @@ begin
op := A_LWA;
end;
a_load_store(list, op, reg, ref2);
{ sign extend shortint if necessary, since there is no
load instruction that does that automatically (JM) }
if (fromsize = OS_S8) then
begin
list.concat(taicpu.op_reg_reg(A_EXTSB, reg, reg));
if (tosize in [OS_16,OS_32]) then
a_load_reg_reg(list,fromsize,tosize,reg,reg);
end
else if (fromsize = OS_S16) and
(tosize = OS_32) then
a_load_reg_reg(list,fromsize,tosize,reg,reg);
{ sign extend shortint if necessary (because there is
no load instruction to sign extend an 8 bit value automatically)
and mask out extra sign bits when loading from a smaller
signed to a larger unsigned type (where it matters) }
if (fromsize = OS_S8) then begin
a_load_reg_reg(list, OS_8, OS_S8, reg, reg);
a_load_reg_reg(list, OS_S8, tosize, reg, reg);
end else if (fromsize = OS_S16) and (tosize = OS_32) then
a_load_reg_reg(list, fromsize, tosize, reg, reg);
end;
procedure tcgppc.a_load_reg_reg(list: TAsmList; fromsize, tosize: tcgsize;