mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:49:22 +02:00
* improved r28534: LDR/STR on thumb do not support registers >r7 as destination/source
git-svn-id: trunk@28538 -
This commit is contained in:
parent
ef5f1b7ed2
commit
09728a9ae2
@ -308,11 +308,10 @@ unit rgcpu;
|
|||||||
(get_alias(getsupreg(oper[0]^.reg))=orgreg) and
|
(get_alias(getsupreg(oper[0]^.reg))=orgreg) and
|
||||||
(get_alias(getsupreg(oper[1]^.reg))<>orgreg) then
|
(get_alias(getsupreg(oper[1]^.reg))<>orgreg) then
|
||||||
begin
|
begin
|
||||||
{ do not replace if we're on Thumb, the offset is too
|
{ do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
|
||||||
large and the stack pointer reg would be the store source }
|
|
||||||
if GenerateThumbCode and
|
if GenerateThumbCode and
|
||||||
(oper[1]^.reg = NR_STACK_POINTER_REG) and
|
(getsupreg(oper[1]^.reg)>RS_R7) then
|
||||||
(abs(spilltemp.offset) > 63) then exit;
|
exit;
|
||||||
|
|
||||||
{ str expects the register in oper[0] }
|
{ str expects the register in oper[0] }
|
||||||
instr.loadreg(0,oper[1]^.reg);
|
instr.loadreg(0,oper[1]^.reg);
|
||||||
@ -324,6 +323,11 @@ unit rgcpu;
|
|||||||
(get_alias(getsupreg(oper[1]^.reg))=orgreg) and
|
(get_alias(getsupreg(oper[1]^.reg))=orgreg) and
|
||||||
(get_alias(getsupreg(oper[0]^.reg))<>orgreg) then
|
(get_alias(getsupreg(oper[0]^.reg))<>orgreg) then
|
||||||
begin
|
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);
|
instr.loadref(1,spilltemp);
|
||||||
opcode:=A_LDR;
|
opcode:=A_LDR;
|
||||||
result:=true;
|
result:=true;
|
||||||
|
Loading…
Reference in New Issue
Block a user