Browse Source

* fixed -Or cycle for PowerPC64 by adding the missing additional newra methods

git-svn-id: trunk@1359 -
tom_at_work 20 years ago
parent
commit
99120a3f2b
1 changed files with 45 additions and 6 deletions
  1. 45 6
      compiler/powerpc64/aasmcpu.pas

+ 45 - 6
compiler/powerpc64/aasmcpu.pas

@@ -94,6 +94,9 @@ type
 
 
     function is_same_reg_move(regtype: Tregistertype): boolean; override;
     function is_same_reg_move(regtype: Tregistertype): boolean; override;
 
 
+    { register spilling code }
+    function spilling_get_operation_type(opnr: longint): topertype;override;
+    function spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;override;
   end;
   end;
 
 
   tai_align = class(tai_align_abstract)
   tai_align = class(tai_align_abstract)
@@ -378,17 +381,53 @@ end;
 
 
 { ****************************** newra stuff *************************** }
 { ****************************** newra stuff *************************** }
 
 
-function taicpu.is_same_reg_move(regtype: Tregistertype): boolean;
+function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
 begin
 begin
   result :=
   result :=
-    (((opcode = A_MR) and
-    (regtype = R_INTREGISTER)) or
-    ((opcode = A_FMR) and
-    (regtype = R_FPUREGISTER))) and
+    (((opcode=A_MR) and
+      (regtype = R_INTREGISTER)) or
+     ((opcode = A_FMR) and
+      (regtype = R_FPUREGISTER))) and
     { these opcodes can only have registers as operands }
     { these opcodes can only have registers as operands }
-  (oper[0]^.reg = oper[1]^.reg);
+    (oper[0]^.reg=oper[1]^.reg);
+end;
+
+
+function taicpu.spilling_get_operation_type(opnr: longint): topertype;
+begin
+  result := operand_read;
+  case opcode of
+    A_STMW,A_LMW:
+      internalerror(2005021805);
+
+    A_STBU, A_STBUX, A_STHU, A_STHUX,
+    A_STWU, A_STWUX, A_STDU, A_STDUX,
+    A_STFSU, A_STFSUX, A_STFDU, A_STFDUX,
+    A_STB, A_STBX, A_STH, A_STHX,
+    A_STW, A_STWX, A_STD, A_STDX,
+    A_STFS, A_STFSX, A_STFD, A_STFDX, A_STFIWX, A_STHBRX, A_STWBRX, A_STWCX_, A_STDCX_,
+    A_CMP, A_CMPI, A_CMPL, A_CMPLI, A_CMPD, A_CMPDI, A_CMPLD, A_CMPLDI,
+    A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ,
+    A_ECOWX, A_FCMPO, A_FCMPU, A_MTMSR, A_TLBIE, A_TW, A_TWI, A_MFXER,
+    A_CMPWI, A_CMPW, A_CMPLWI, A_CMPLW, A_MT, A_MTLR, A_MTCTR:;
+    else
+      if opnr = 0 then
+        result := operand_write;
+    end;
+end;
+
+function taicpu.spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;
+begin
+  result := operand_read;
+  case opcode of
+    A_STBU, A_STBUX, A_STHU, A_STHUX, A_STWU, A_STWUX, A_STDU, A_STDUX,
+    A_STFSU, A_STFSUX, A_STFDU, A_STFDUX:
+      if (oper[opnr]^.ref^.base = reg) then
+        result := operand_readwrite;
+  end;
 end;
 end;
 
 
+
 function spilling_create_load(const ref: treference; r: tregister): tai;
 function spilling_create_load(const ref: treference; r: tregister): tai;
 begin
 begin
   result := taicpu.op_reg_ref(A_LD, r, ref);
   result := taicpu.op_reg_ref(A_LD, r, ref);