* m68k: do not generate unnecessary unaligned load sequences for byte loads into registers, this fixes tcnvint1 test on plain 68000

This commit is contained in:
Karoly Balogh 2022-02-08 01:26:13 +01:00
parent c42b8c43bd
commit 8f083f6342

View File

@ -930,7 +930,13 @@ unit cgcpu;
opsize: topsize; opsize: topsize;
needsext: boolean; needsext: boolean;
begin begin
if needs_unaligned(ref.alignment,fromsize) then needsext:=tcgsize2size[fromsize]<tcgsize2size[tosize];
if needsext then
size:=fromsize
else
size:=tosize;
if needs_unaligned(ref.alignment,size) then
begin begin
//list.concat(tai_comment.create(strpnew('a_load_ref_reg calling unaligned'))); //list.concat(tai_comment.create(strpnew('a_load_ref_reg calling unaligned')));
a_load_ref_reg_unaligned(list,fromsize,tosize,ref,register); a_load_ref_reg_unaligned(list,fromsize,tosize,ref,register);
@ -940,11 +946,6 @@ unit cgcpu;
href:=ref; href:=ref;
fixref(list,href,false); fixref(list,href,false);
needsext:=tcgsize2size[fromsize]<tcgsize2size[tosize];
if needsext then
size:=fromsize
else
size:=tosize;
opsize:=TCGSize2OpSize[size]; opsize:=TCGSize2OpSize[size];
if isaddressregister(register) and not (opsize in [S_L]) then if isaddressregister(register) and not (opsize in [S_L]) then
hreg:=getintregister(list,OS_ADDR) hreg:=getintregister(list,OS_ADDR)