mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 08:49:33 +02:00
* fix non-x86 for iasmop
git-svn-id: trunk@5151 -
This commit is contained in:
parent
35228f0391
commit
9eb07499bf
compiler
@ -656,7 +656,6 @@ Unit raarmgas;
|
||||
PF_B,PF_D,PF_E,PF_P,PF_T,PF_H,PF_S);
|
||||
|
||||
var
|
||||
str2opentry: tstr2opentry;
|
||||
len,
|
||||
j,
|
||||
sufidx : longint;
|
||||
@ -689,19 +688,19 @@ Unit raarmgas;
|
||||
end;
|
||||
end;
|
||||
maxlen:=max(length(hs),5);
|
||||
actopcode:=A_NONE;
|
||||
for j:=maxlen downto 1 do
|
||||
begin
|
||||
str2opentry:=tstr2opentry(iasmops.search(copy(hs,1,j)));
|
||||
if assigned(str2opentry) then
|
||||
actopcode:=tasmop(PtrInt(iasmops.Find(copy(hs,1,j))));
|
||||
if actopcode<>A_NONE then
|
||||
begin
|
||||
actopcode:=str2opentry.op;
|
||||
actasmtoken:=AS_OPCODE;
|
||||
{ strip op code }
|
||||
delete(hs,1,j);
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if not(assigned(str2opentry)) then
|
||||
if actopcode=A_NONE then
|
||||
exit;
|
||||
{ search for condition, conditions are always 2 chars }
|
||||
if length(hs)>1 then
|
||||
|
@ -145,17 +145,11 @@ const
|
||||
{ creates uppercased symbol tables for speed access }
|
||||
var
|
||||
i : tasmop;
|
||||
str2opentry: tstr2opentry;
|
||||
Begin
|
||||
{ opcodes }
|
||||
iasmops:=TDictionary.Create;
|
||||
iasmops.delete_doubles:=true;
|
||||
iasmops:=TFPHashList.create;
|
||||
for i:=firstop to lastop do
|
||||
begin
|
||||
str2opentry:=tstr2opentry.createname(upper(gas_op2str[i]));
|
||||
str2opentry.op:=i;
|
||||
iasmops.insert(str2opentry);
|
||||
end;
|
||||
iasmops.Add(upper(gas_op2str[i]),Pointer(PtrInt(i)));
|
||||
end;
|
||||
|
||||
|
||||
@ -165,7 +159,6 @@ const
|
||||
|
||||
function tm68kmotreader.is_asmopcode(const s: string):boolean;
|
||||
var
|
||||
str2opentry: tstr2opentry;
|
||||
hs : string;
|
||||
j : byte;
|
||||
begin
|
||||
@ -177,12 +170,12 @@ const
|
||||
else
|
||||
hs:=s;
|
||||
|
||||
str2opentry:=tstr2opentry(iasmops.search(hs));
|
||||
if assigned(str2opentry) then
|
||||
{ Search opcodes }
|
||||
actopcode:=tasmop(PtrInt(iasmops.Find(hs)));
|
||||
if actopcode<>A_NONE then
|
||||
begin
|
||||
actopcode:=str2opentry.op;
|
||||
actasmtoken:=AS_OPCODE;
|
||||
is_asmopcode:=true;
|
||||
result:=TRUE;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
@ -571,7 +571,6 @@ Interface
|
||||
|
||||
function TSparcReader.is_asmopcode(const s: string):boolean;
|
||||
var
|
||||
str2opEntry: tstr2opEntry;
|
||||
cond:TAsmCond;
|
||||
Begin
|
||||
{ making s a value parameter would break other assembler readers }
|
||||
@ -582,16 +581,18 @@ Interface
|
||||
{ clear condition }
|
||||
fillchar(actcondition,sizeof(actcondition),0);
|
||||
|
||||
str2opentry:=tstr2opentry(iasmops.search(s));
|
||||
if assigned(str2opentry) then
|
||||
begin
|
||||
actopcode:=str2opentry.op;
|
||||
actasmtoken:=AS_OPCODE;
|
||||
is_asmopcode:=true;
|
||||
end
|
||||
{ Search opcodes }
|
||||
actopcode:=tasmop(PtrInt(iasmops.Find(s)));
|
||||
if actopcode<>A_NONE then
|
||||
begin
|
||||
actasmtoken:=AS_OPCODE;
|
||||
result:=TRUE;
|
||||
exit;
|
||||
end;
|
||||
|
||||
{ not found, check branch instructions }
|
||||
else if (Upcase(s[1])='B') or
|
||||
((Upcase(s[1])='F') and (Upcase(s[2])='B')) then
|
||||
if (Upcase(s[1])='B') or
|
||||
((Upcase(s[1])='F') and (Upcase(s[2])='B')) then
|
||||
begin
|
||||
{ we can search here without an extra table which is sorted by string length
|
||||
because we take the whole remaining string without the leading B }
|
||||
|
Loading…
Reference in New Issue
Block a user