mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 10:18:25 +02:00
+ support unsigned sign extension in tcgz80.a_load_reg_reg
git-svn-id: branches/z80@44646 -
This commit is contained in:
parent
7d9658e2ba
commit
d0166242b3
@ -1375,19 +1375,30 @@ unit cgcpu;
|
|||||||
begin
|
begin
|
||||||
if (tcgsize2size[fromsize]>32) or (tcgsize2size[tosize]>32) or (fromsize=OS_NO) or (tosize=OS_NO) then
|
if (tcgsize2size[fromsize]>32) or (tcgsize2size[tosize]>32) or (fromsize=OS_NO) or (tosize=OS_NO) then
|
||||||
internalerror(2011021310);
|
internalerror(2011021310);
|
||||||
|
if tcgsize2size[fromsize]>tcgsize2size[tosize] then
|
||||||
|
internalerror(2020040803);
|
||||||
|
|
||||||
if tosize=fromsize then
|
if (tosize=fromsize) or (fromsize in [OS_8,OS_16,OS_32]) then
|
||||||
begin
|
begin
|
||||||
if reg1<>reg2 then
|
if reg1<>reg2 then
|
||||||
for i:=tcgsize2size[fromsize] downto 1 do
|
for i:=1 to tcgsize2size[fromsize] do
|
||||||
begin
|
begin
|
||||||
emit_mov(list,reg2,reg1);
|
emit_mov(list,reg2,reg1);
|
||||||
if i<>1 then
|
if i<>tcgsize2size[fromsize] then
|
||||||
begin
|
reg1:=GetNextReg(reg1);
|
||||||
reg1:=GetNextReg(reg1);
|
if i<>tcgsize2size[tosize] then
|
||||||
reg2:=GetNextReg(reg2);
|
reg2:=GetNextReg(reg2);
|
||||||
end;
|
end
|
||||||
end;
|
else
|
||||||
|
for i:=1 to tcgsize2size[fromsize] do
|
||||||
|
if i<>tcgsize2size[tosize] then
|
||||||
|
reg2:=GetNextReg(reg2);
|
||||||
|
for i:=tcgsize2size[fromsize]+1 to tcgsize2size[tosize] do
|
||||||
|
begin
|
||||||
|
list.Concat(taicpu.op_reg_const(A_LD,reg2,0));
|
||||||
|
if i<>tcgsize2size[tosize] then
|
||||||
|
reg2:=GetNextReg(reg2);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
list.Concat(tai_comment.Create(strpnew('WARNING! not implemented: a_load_reg_reg')));
|
list.Concat(tai_comment.Create(strpnew('WARNING! not implemented: a_load_reg_reg')));
|
||||||
|
Loading…
Reference in New Issue
Block a user