* Xtensa: patch by Christo Crause: fix addmi/addi handling, resolves #37015

git-svn-id: trunk@45258 -
This commit is contained in:
florian 2020-05-04 19:58:45 +00:00
parent 0fbb1b259e
commit 724676db43

View File

@ -499,7 +499,7 @@ implementation
{$ifdef EXTDEBUG}
list.concat(tai_comment.Create(strpnew('Value: '+tostr(a))));
{$endif EXTDEBUG}
list.concat(taicpu.op_reg_reg_const(A_ADDMI,dst,src,Smallint(a and $ff00)));
list.concat(taicpu.op_reg_reg_const(A_ADDMI,dst,src,Smallint((a+128) and $ff00)));
list.concat(taicpu.op_reg_reg_const(A_ADDI,dst,dst,Shortint(a and $ff)));
end
else if (op=OP_SUB) and (a>=-127) and (a<=128) then
@ -510,7 +510,7 @@ implementation
list.concat(tai_comment.Create(strpnew('Value: '+tostr(a))));
{$endif EXTDEBUG}
a:=-a;
list.concat(taicpu.op_reg_reg_const(A_ADDMI,dst,src,Smallint(a and $ff00)));
list.concat(taicpu.op_reg_reg_const(A_ADDMI,dst,src,Smallint((a+128) and $ff00)));
list.concat(taicpu.op_reg_reg_const(A_ADDI,dst,dst,Shortint(a and $ff)));
end
else if (op=OP_SHL) and (a>=1) and (a<=31) then