@@ -3011,7 +3011,10 @@ implementation
and not(r.refaddr in [addr_full,addr_gotpageoffset,addr_gotpage])
{$endif aarch64}
{$ifdef riscv}
- and not(opcode in [A_LA,A_FLD,A_FLQ,A_FLW])
+ and not(opcode=A_LA)
+ and not(opcode=A_FLD)
+ and not(opcode=A_FLQ)
+ and not(opcode=A_FLW)
{$endif riscv}
then
internalerror(200502052);
@@ -70,12 +70,22 @@ implementation
cutils,
verbose;
- function MatchInstruction(const instr: tai; const op: TCommonAsmOps; const AConditions: TAsmConds = []): boolean;
+ function MatchInstruction(const instr: tai; const ops : array of TAsmOp; const AConditions: TAsmConds = []): boolean;
+ var
+ op : TAsmOp;
begin
- result :=
- (instr.typ = ait_instruction) and
- (taicpu(instr).opcode in op) and
- ((AConditions=[]) or (taicpu(instr).condition in AConditions));
+ result:=false;
+ if (instr.typ <> ait_instruction) or
+ ((AConditions <> []) and not(taicpu(instr).condition in AConditions)) then
+ exit;
+ for op in ops do
+ begin
+ if taicpu(instr).opcode = op then
+ result:=true;
+ end;
end;
@@ -195,12 +195,6 @@ uses
{ Last value of opcode enumeration }
lastop = high(tasmop);
- { Last value of opcode for TCommonAsmOps set below }
- LastCommonAsmOp = A_MRET;
-
- Type
- TCommonAsmOps = Set of A_None .. LastCommonAsmOp;
{*****************************************************************************
Registers
*****************************************************************************}