浏览代码

* MIPS64: make use of DMTC1 instruction

florian 9 月之前
父节点
当前提交
46dcffed42
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 9 0
      compiler/hlcg2ll.pas
  2. 4 0
      compiler/mips/cpupara.pas

+ 9 - 0
compiler/hlcg2ll.pas

@@ -2045,6 +2045,15 @@ implementation
                 unget_para(paraloc^);
                 unget_para(paraloc^);
                 list.Concat(taicpu.op_reg_reg(A_MTC1,paraloc^.register,destloc.register));
                 list.Concat(taicpu.op_reg_reg(A_MTC1,paraloc^.register,destloc.register));
               end
               end
+{$ifdef mips64}
+            else if (destloc.size = OS_F64) and
+               (paraloc^.Loc in [LOC_REGISTER,LOC_CREGISTER]) then
+              begin
+                gen_alloc_regloc(list,destloc,vardef);
+                unget_para(paraloc^);
+                list.Concat(taicpu.op_reg_reg(A_DMTC1,paraloc^.register,destloc.register));
+              end
+{$endif mips64}
 { TODO: Produces invalid code, needs fixing together with regalloc setup. }
 { TODO: Produces invalid code, needs fixing together with regalloc setup. }
 {
 {
             else if (destloc.size = OS_F64) and
             else if (destloc.size = OS_F64) and

+ 4 - 0
compiler/mips/cpupara.pas

@@ -56,7 +56,11 @@ interface
       mips_nb_used_registers  : longint = MIPS_NB_REGISTERS_USED_IN_CALL_O32;
       mips_nb_used_registers  : longint = MIPS_NB_REGISTERS_USED_IN_CALL_O32;
 
 
       { Might need to be changed if we support N64 ABI later }
       { Might need to be changed if we support N64 ABI later }
+{$ifdef MIPS64}
+      mips_sizeof_register_param : longint = 8;
+{$else MIPS64}
       mips_sizeof_register_param : longint = 4;
       mips_sizeof_register_param : longint = 4;
+{$endif MIPS64}
 
 
     type
     type
       tparasupregs = array[0..MIPS_MAX_REGISTERS_USED_IN_CALL-1] of tsuperregister;
       tparasupregs = array[0..MIPS_MAX_REGISTERS_USED_IN_CALL-1] of tsuperregister;