Browse Source

Rough fix for riscv32 failure

git-svn-id: trunk@48959 -
pierre 4 years ago
parent
commit
9775a13e02
3 changed files with 6 additions and 2 deletions
  1. 4 0
      compiler/riscv/cgrv.pas
  2. 1 1
      compiler/riscv32/cpubase.pas
  3. 1 1
      compiler/riscv32/itcpugas.pas

+ 4 - 0
compiler/riscv/cgrv.pas

@@ -744,7 +744,11 @@ unit cgrv;
                 reference_reset_symbol(href,l,0,0,[]);
                 href.refaddr:=addr_pcrel_lo12;
                 href.base:=tmpreg;
+{$ifdef RISCV64}
                 list.concat(taicpu.op_reg_ref(A_LD,tmpreg,href));
+{$else}
+                list.concat(taicpu.op_reg_ref(A_LW,tmpreg,href));
+{$endif}
               end
             else
               begin

+ 1 - 1
compiler/riscv32/cpubase.pas

@@ -39,7 +39,7 @@ uses
     type
       TAsmOp=(A_None,
         { Pseudo instructions }
-        A_NOP,
+        A_NOP,A_CALL,
         { normal opcodes }
         A_LUI,A_AUIPC,A_JAL,A_JALR,
         A_Bxx,A_LB,A_LH,A_LW,A_LBU,A_LHU,

+ 1 - 1
compiler/riscv32/itcpugas.pas

@@ -30,7 +30,7 @@ interface
 
     const
       gas_op2str: array[tasmop] of string[14] = ('<none>',
-        'nop',
+        'nop','call',
         'lui','auipc','jal','jalr',
         'b','lb','lh','lw','lbu','lhu',
         'sb','sh','sw',