mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 14:51:27 +02:00
* cleaned up r10705 for ppc, improved comments
git-svn-id: trunk@10721 -
This commit is contained in:
parent
714523866b
commit
ee76679326
@ -352,14 +352,15 @@ const
|
|||||||
fromsize := tosize;
|
fromsize := tosize;
|
||||||
op := loadinstr[fromsize,ref2.index<>NR_NO,false];
|
op := loadinstr[fromsize,ref2.index<>NR_NO,false];
|
||||||
a_load_store(list,op,reg,ref2);
|
a_load_store(list,op,reg,ref2);
|
||||||
{ sign extend shortint if necessary, since there is no }
|
{ sign extend shortint if necessary (because there is
|
||||||
{ load instruction that does that automatically (JM) }
|
no load instruction to sign extend an 8 bit value automatically)
|
||||||
if (fromsize = OS_S8) then
|
and mask out extra sign bits when loading from a smaller signed
|
||||||
begin
|
to a larger unsigned type }
|
||||||
list.concat(taicpu.op_reg_reg(A_EXTSB,reg,reg));
|
if fromsize = OS_S8 then
|
||||||
if (tosize = OS_16) then
|
begin
|
||||||
a_load_reg_reg(list,fromsize,tosize,reg,reg);
|
a_load_reg_reg(list, OS_8, OS_S8, reg, reg);
|
||||||
end;
|
a_load_reg_reg(list, OS_S8, tosize, reg, reg);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -734,17 +734,15 @@ begin
|
|||||||
op := A_LWA;
|
op := A_LWA;
|
||||||
end;
|
end;
|
||||||
a_load_store(list, op, reg, ref2);
|
a_load_store(list, op, reg, ref2);
|
||||||
{ sign extend shortint if necessary, since there is no
|
{ sign extend shortint if necessary (because there is
|
||||||
load instruction that does that automatically (JM) }
|
no load instruction to sign extend an 8 bit value automatically)
|
||||||
if (fromsize = OS_S8) then
|
and mask out extra sign bits when loading from a smaller
|
||||||
begin
|
signed to a larger unsigned type (where it matters) }
|
||||||
list.concat(taicpu.op_reg_reg(A_EXTSB, reg, reg));
|
if (fromsize = OS_S8) then begin
|
||||||
if (tosize in [OS_16,OS_32]) then
|
a_load_reg_reg(list, OS_8, OS_S8, reg, reg);
|
||||||
a_load_reg_reg(list,fromsize,tosize,reg,reg);
|
a_load_reg_reg(list, OS_S8, tosize, reg, reg);
|
||||||
end
|
end else if (fromsize = OS_S16) and (tosize = OS_32) then
|
||||||
else if (fromsize = OS_S16) and
|
a_load_reg_reg(list, fromsize, tosize, reg, reg);
|
||||||
(tosize = OS_32) then
|
|
||||||
a_load_reg_reg(list,fromsize,tosize,reg,reg);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure tcgppc.a_load_reg_reg(list: TAsmList; fromsize, tosize: tcgsize;
|
procedure tcgppc.a_load_reg_reg(list: TAsmList; fromsize, tosize: tcgsize;
|
||||||
|
Loading…
Reference in New Issue
Block a user