From 4b48a8880fe4571c9ebbdbb3bc547c37663a599f Mon Sep 17 00:00:00 2001 From: tom_at_work Date: Tue, 3 Jan 2006 21:07:39 +0000 Subject: [PATCH] * added support for BI and BO fields for branches * correct spilling for FP values git-svn-id: trunk@2143 - --- compiler/powerpc64/aasmcpu.pas | 18 ++++++++++++++++-- compiler/powerpc64/rappcgas.pas | 26 +++++++++++++++++++++----- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/compiler/powerpc64/aasmcpu.pas b/compiler/powerpc64/aasmcpu.pas index 306060e1ac..fefd11f130 100644 --- a/compiler/powerpc64/aasmcpu.pas +++ b/compiler/powerpc64/aasmcpu.pas @@ -430,12 +430,26 @@ end; function spilling_create_load(const ref: treference; r: tregister): tai; 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; function spilling_create_store(r: tregister; const ref: treference): tai; 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; procedure InitAsm; diff --git a/compiler/powerpc64/rappcgas.pas b/compiler/powerpc64/rappcgas.pas index 941496f392..0e71e611c1 100644 --- a/compiler/powerpc64/rappcgas.pas +++ b/compiler/powerpc64/rappcgas.pas @@ -678,11 +678,27 @@ end; procedure tppcattreader.ConvertCalljmp(instr: tppcinstruction); 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); end; end;