* improved r28534: LDR/STR on thumb do not support registers >r7 as destination/source

git-svn-id: trunk@28538 -
This commit is contained in:
florian 2014-08-30 12:13:00 +00:00
parent ef5f1b7ed2
commit 09728a9ae2

View File

@ -308,11 +308,10 @@ unit rgcpu;
(get_alias(getsupreg(oper[0]^.reg))=orgreg) and
(get_alias(getsupreg(oper[1]^.reg))<>orgreg) then
begin
{ do not replace if we're on Thumb, the offset is too
large and the stack pointer reg would be the store source }
{ do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
if GenerateThumbCode and
(oper[1]^.reg = NR_STACK_POINTER_REG) and
(abs(spilltemp.offset) > 63) then exit;
(getsupreg(oper[1]^.reg)>RS_R7) then
exit;
{ str expects the register in oper[0] }
instr.loadreg(0,oper[1]^.reg);
@ -324,6 +323,11 @@ unit rgcpu;
(get_alias(getsupreg(oper[1]^.reg))=orgreg) and
(get_alias(getsupreg(oper[0]^.reg))<>orgreg) then
begin
{ do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
if GenerateThumbCode and
(getsupreg(oper[0]^.reg)>RS_R7) then
exit;
instr.loadref(1,spilltemp);
opcode:=A_LDR;
result:=true;