Vector function results go into V2 according to GCC. The darwin ABI doc

doesn't say where they go :-/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27579 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-04-11 01:38:39 +00:00
parent f87324e44d
commit bee9836c0f

View File

@ -877,7 +877,16 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
return SDOperand(); // ret void is legal
case 2: {
MVT::ValueType ArgVT = Op.getOperand(1).getValueType();
unsigned ArgReg = MVT::isInteger(ArgVT) ? PPC::R3 : PPC::F1;
unsigned ArgReg;
if (MVT::isVector(ArgVT))
ArgReg = PPC::V2;
else if (MVT::isInteger(ArgVT))
ArgReg = PPC::R3;
else {
assert(MVT::isFloatingPoint(ArgVT));
ArgReg = PPC::F1;
}
Copy = DAG.getCopyToReg(Op.getOperand(0), ArgReg, Op.getOperand(1),
SDOperand());