|
@@ -1190,20 +1190,32 @@ unit cgcpu;
|
|
|
|
|
|
if (tcgsize2size[fromsize]>32) or (tcgsize2size[tosize]>32) or (fromsize=OS_NO) or (tosize=OS_NO) then
|
|
|
internalerror(2011021307);
|
|
|
+ if tcgsize2size[fromsize]>tcgsize2size[tosize] then
|
|
|
+ internalerror(2020040802);
|
|
|
|
|
|
- if fromsize=tosize then
|
|
|
+ if (fromsize=tosize) or (fromsize in [OS_8,OS_16,OS_32]) then
|
|
|
begin
|
|
|
getcpuregister(list,NR_A);
|
|
|
- for i:=tcgsize2size[fromsize] downto 1 do
|
|
|
- begin
|
|
|
- a_load_reg_reg(list,OS_8,OS_8,reg,NR_A);
|
|
|
- list.concat(taicpu.op_ref_reg(A_LD,href,NR_A));
|
|
|
- if i<>1 then
|
|
|
- begin
|
|
|
- inc(href.offset);
|
|
|
+ for i:=1 to tcgsize2size[fromsize] do
|
|
|
+ begin
|
|
|
+ a_load_reg_reg(list,OS_8,OS_8,reg,NR_A);
|
|
|
+ list.concat(taicpu.op_ref_reg(A_LD,href,NR_A));
|
|
|
+ if i<>tcgsize2size[fromsize] then
|
|
|
reg:=GetNextReg(reg);
|
|
|
- end;
|
|
|
- end;
|
|
|
+ if i<>tcgsize2size[tosize] then
|
|
|
+ inc(href.offset);
|
|
|
+ end;
|
|
|
+ for i:=tcgsize2size[fromsize]+1 to tcgsize2size[tosize] do
|
|
|
+ begin
|
|
|
+ if i=(tcgsize2size[fromsize]+1) then
|
|
|
+ list.concat(taicpu.op_reg_const(A_LD,NR_A,0));
|
|
|
+ list.concat(taicpu.op_ref_reg(A_LD,href,NR_A));
|
|
|
+ if i<>tcgsize2size[tosize] then
|
|
|
+ begin
|
|
|
+ inc(href.offset);
|
|
|
+ reg:=GetNextReg(reg);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
ungetcpuregister(list,NR_A);
|
|
|
end
|
|
|
else
|