[llvm-commits] [llvm] r48459 - in /llvm/trunk/lib/Target/PowerPC: PPCCallingConv.td PPCISelLowering.cpp
Evan Cheng
evan.cheng at apple.com
Mon Mar 17 11:27:30 PDT 2008
On Mar 17, 2008, at 10:11 AM, Dale Johannesen wrote:
> Author: johannes
> Date: Mon Mar 17 12:11:08 2008
> New Revision: 48459
>
> URL: http://llvm.org/viewvc/llvm-project?rev=48459&view=rev
> Log:
> Make Complex long long/double/long double work
> in ppc64 mode.
>
>
> Modified:
> llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td
> llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td?rev=48459&r1=48458&r2=48459&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td Mon Mar 17
> 12:11:08 2008
> @@ -23,7 +23,7 @@
> // Return-value convention for PowerPC
> def RetCC_PPC : CallingConv<[
> CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>,
> - CCIfType<[i64], CCAssignToReg<[X3, X4]>>,
> + CCIfType<[i64], CCAssignToReg<[X3, X4, X5, X6]>>,
>
> CCIfType<[f32], CCAssignToReg<[F1]>>,
> CCIfType<[f64], CCAssignToReg<[F1, F2]>>,
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=48459&r1=48458&r2=48459&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Mar 17
> 12:11:08 2008
> @@ -2259,7 +2259,24 @@
> NodeTys.push_back(MVT::i32);
> break;
> case MVT::i64:
> - if (Op.Val->getValueType(1) == MVT::i64) {
> + if (Op.Val->getNumValues()>=4 &&
> + Op.Val->getValueType(3) == MVT::i64) {
The part of call can really use some refactoring. Look at the case of
MVT::i32, it can be significantly simplified into something like:
unsigned NumValues = Op.Val->getNumValues();
if (Op.Val->getValueType(NumValues-1) == MVT::i32)
for (unsigned i = 0; i != NumValues; ++i) {
Chain = DAG.getCopyFromReg(Chain, CallRegs[i], MVT::i32,
InFlag).getValue(1);
InFlag = Chain.getValue(2);
ResultVals.push_back(Chain.getValue(0));
NodeTys.push_back(MVT::i32);
}
BTW, why is it we are using tablegen generated CC code to handle
arguments, but not return types (same issue on x86)? I've forgotten
the history behind the tablegen CC development.
Evan
>
> + Chain = DAG.getCopyFromReg(Chain, PPC::X3, MVT::i64,
> InFlag).getValue(1);
> + ResultVals[0] = Chain.getValue(0);
> + Chain = DAG.getCopyFromReg(Chain, PPC::X4, MVT::i64,
> + Chain.getValue(2)).getValue(1);
> + ResultVals[1] = Chain.getValue(0);
> + Chain = DAG.getCopyFromReg(Chain, PPC::X5, MVT::i64,
> + Chain.getValue(2)).getValue(1);
> + ResultVals[2] = Chain.getValue(0);
> + Chain = DAG.getCopyFromReg(Chain, PPC::X6, MVT::i64,
> + Chain.getValue(2)).getValue(1);
> + ResultVals[3] = Chain.getValue(0);
> + NumResults = 4;
> + NodeTys.push_back(MVT::i64);
> + NodeTys.push_back(MVT::i64);
> + NodeTys.push_back(MVT::i64);
> + } else if (Op.Val->getValueType(1) == MVT::i64) {
> Chain = DAG.getCopyFromReg(Chain, PPC::X3, MVT::i64,
> InFlag).getValue(1);
> ResultVals[0] = Chain.getValue(0);
> Chain = DAG.getCopyFromReg(Chain, PPC::X4, MVT::i64,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list