Hi,
For the target ABI have following calling convention
"Pass by indirect pointer if the primary type is f128"
If the target didn't support f128 register class, legalizer will split the arguments.
So it's hard to identify the argument is split from f128 by *CallingConv.td,
and we have to obtain custom calling convention handler to deal with.
To pass the split parts by the same indirect pointer would also need extra handler function.
One of the cases is "CC_SystemZ_I128Indirect" in SystemZCallingConv.h.
To simplify the porting effort, I'd like to add the interfaces as follow.
CCIfSplitFrom - If the current argument is split from one of the specified types, apply action A.
CCPassIndirectBySamePointer - Same as CCPassIndirect except pass by the same pointer if the arguments have been split by legalizer.
With the new calling convention interfaces, we could describe
"Pass by indirect pointer if primary type is f128" as
CCIfType<[i64], CCIfSplitFrom<[f128], CCPassIndirectBySamePointer<i64>>>
without writing custom handling function by CCCustom.
The Tablegen result will be
if (LocVT == MVT::i64) { if (ArgFlags.getOrigVt() == MVT::f128) { LocVT = MVT::i64; LocInfo = CCValAssign::Indirect; if (!ArgFlags.isSplit()) { State.addLoc(State.lastLoc()); return false; } } }
Any suggestions?
Thanks,
Shiva
Can you leave out the void from the empty parameter type?