Browse Source

* added support for BI and BO fields for branches
* correct spilling for FP values

git-svn-id: trunk@2143 -

tom_at_work 19 years ago
parent
commit
4b48a8880f
2 changed files with 37 additions and 7 deletions
  1. 16 2
      compiler/powerpc64/aasmcpu.pas
  2. 21 5
      compiler/powerpc64/rappcgas.pas

+ 16 - 2
compiler/powerpc64/aasmcpu.pas

@@ -430,12 +430,26 @@ 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);
+  case getregtype(r) of
+    R_INTREGISTER:
+      result:=taicpu.op_reg_ref(A_LD,r,ref);
+    R_FPUREGISTER:
+      result:=taicpu.op_reg_ref(A_LFD,r,ref);
+    else
+      internalerror(2005123101);
+  end;
 end;
 end;
 
 
 function spilling_create_store(r: tregister; const ref: treference): tai;
 function spilling_create_store(r: tregister; const ref: treference): tai;
 begin
 begin
-  result := taicpu.op_reg_ref(A_STD, r, ref);
+  case getregtype(r) of
+    R_INTREGISTER:
+      result:=taicpu.op_reg_ref(A_STD,r,ref);
+    R_FPUREGISTER:
+      result:=taicpu.op_reg_ref(A_STFD,r,ref);
+    else
+      internalerror(2005123102);
+  end;
 end;
 end;
 
 
 procedure InitAsm;
 procedure InitAsm;

+ 21 - 5
compiler/powerpc64/rappcgas.pas

@@ -678,11 +678,27 @@ end;
 
 
 procedure tppcattreader.ConvertCalljmp(instr: tppcinstruction);
 procedure tppcattreader.ConvertCalljmp(instr: tppcinstruction);
 begin
 begin
-  if instr.Operands[1].opr.typ = OPR_REFERENCE then
-  begin
-    instr.Operands[1].opr.ref.refaddr := addr_full;
-    if (instr.Operands[1].opr.ref.base <> NR_NO) or
-      (instr.Operands[1].opr.ref.index <> NR_NO) then
+  if instr.Operands[1].opr.typ = OPR_CONSTANT then begin
+    if (instr.operands[1].opr.val > 31) or
+      (instr.operands[2].opr.typ <> OPR_CONSTANT) or
+      (instr.operands[2].opr.val > 31) or
+      not(instr.operands[3].opr.typ in [OPR_REFERENCE,OPR_SYMBOL]) then
+      Message(asmr_e_syn_operand);
+      { BO/BI notation }
+    instr.condition.simple := false;
+    instr.condition.bo := instr.operands[1].opr.val;
+    instr.condition.bi := instr.operands[2].opr.val;
+    instr.operands[1].free;
+    instr.operands[2].free;
+    instr.operands[2] := nil;
+    instr.operands[1] := instr.operands[3];
+    instr.operands[3] := nil;
+    instr.ops := 1;
+  end;
+  if instr.Operands[1].opr.typ = OPR_REFERENCE then begin
+    instr.Operands[1].opr.ref.refaddr:=addr_full;
+    if (instr.Operands[1].opr.ref.base<>NR_NO) or
+      (instr.Operands[1].opr.ref.index<>NR_NO) then
       Message(asmr_e_syn_operand);
       Message(asmr_e_syn_operand);
   end;
   end;
 end;
 end;