Pārlūkot izejas kodu

* compilation fixed

florian 1 mēnesi atpakaļ
vecāks
revīzija
333dede76d
3 mainītis faili ar 19 papildinājumiem un 12 dzēšanām
  1. 4 1
      compiler/aasmtai.pas
  2. 15 5
      compiler/riscv/aoptcpurv.pas
  3. 0 6
      compiler/riscv/cpubase.pas

+ 4 - 1
compiler/aasmtai.pas

@@ -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);

+ 15 - 5
compiler/riscv/aoptcpurv.pas

@@ -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
+            begin
+              result:=true;
+              exit;
+            end;
+        end;
     end;
 
 

+ 0 - 6
compiler/riscv/cpubase.pas

@@ -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
 *****************************************************************************}