mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 01:49:20 +02:00
Fix ARM-Assembler output for RRX-Shifterops
RRX (Rotate Right with eXtend) does a single bit right rotation through the carry. So it does not take any arguments, neither constant nor register. Also remove redundant shiftmode2str and replace usage of it with gas_shiftmode2str. git-svn-id: trunk@21685 -
This commit is contained in:
parent
5be97c7c9e
commit
3566956389
@ -153,7 +153,10 @@ unit agarmgas;
|
|||||||
|
|
||||||
s:=s+gas_regname(index);
|
s:=s+gas_regname(index);
|
||||||
|
|
||||||
if shiftmode<>SM_None then
|
{RRX always rotates by 1 bit and does not take an imm}
|
||||||
|
if shiftmode = SM_RRX then
|
||||||
|
s:=s+', rrx'
|
||||||
|
else if shiftmode <> SM_None then
|
||||||
s:=s+', '+gas_shiftmode2str[shiftmode]+' #'+tostr(shiftimm);
|
s:=s+', '+gas_shiftmode2str[shiftmode]+' #'+tostr(shiftimm);
|
||||||
end
|
end
|
||||||
else if offset<>0 then
|
else if offset<>0 then
|
||||||
@ -171,10 +174,6 @@ unit agarmgas;
|
|||||||
getreferencestring:=s;
|
getreferencestring:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
shiftmode2str: array[tshiftmode] of string[3] = ('','lsl','lsr','asr','ror','rrx');
|
|
||||||
|
|
||||||
function getopstr(const o:toper) : string;
|
function getopstr(const o:toper) : string;
|
||||||
var
|
var
|
||||||
hs : string;
|
hs : string;
|
||||||
@ -186,10 +185,13 @@ unit agarmgas;
|
|||||||
getopstr:=gas_regname(o.reg);
|
getopstr:=gas_regname(o.reg);
|
||||||
top_shifterop:
|
top_shifterop:
|
||||||
begin
|
begin
|
||||||
if (o.shifterop^.rs<>NR_NO) and (o.shifterop^.shiftimm=0) then
|
{RRX is special, it only rotates by 1 and does not take any shiftervalue}
|
||||||
getopstr:=shiftmode2str[o.shifterop^.shiftmode]+' '+gas_regname(o.shifterop^.rs)
|
if o.shifterop^.shiftmode=SM_RRX then
|
||||||
|
getopstr:='rrx'
|
||||||
|
else if (o.shifterop^.rs<>NR_NO) and (o.shifterop^.shiftimm=0) then
|
||||||
|
getopstr:=gas_shiftmode2str[o.shifterop^.shiftmode]+' '+gas_regname(o.shifterop^.rs)
|
||||||
else if (o.shifterop^.rs=NR_NO) then
|
else if (o.shifterop^.rs=NR_NO) then
|
||||||
getopstr:=shiftmode2str[o.shifterop^.shiftmode]+' #'+tostr(o.shifterop^.shiftimm)
|
getopstr:=gas_shiftmode2str[o.shifterop^.shiftmode]+' #'+tostr(o.shifterop^.shiftimm)
|
||||||
else internalerror(200308282);
|
else internalerror(200308282);
|
||||||
end;
|
end;
|
||||||
top_const:
|
top_const:
|
||||||
|
Loading…
Reference in New Issue
Block a user