On Mon, Oct 15, 2012 at 5:26 PM, Manman Ren <[email protected]> wrote: > > On Oct 15, 2012, at 5:11 PM, Eli Friedman wrote: > >> On Mon, Oct 15, 2012 at 4:46 PM, manman ren <[email protected]> wrote: >>> >>> The initial patch was updated and separated to two patches (attached). >>> >>> The first patch will fix passing legal vector types as varargs: >>> We make sure the vector is correctly aligned before casting it to the >>> vector type. >> >> + uint64_t Size = CGF.getContext().getTypeSize(Ty) / 8; >> + uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8; >> + >> + // The ABI alignment for vectors is 8 for AAPCS and 4 for APCS. >> + if (Ty->getAs<VectorType>() && Size >= 8) { >> + if (getABIKind() == ARMABIInfo::AAPCS_VFP || >> + getABIKind() == ARMABIInfo::AAPCS) >> + TyAlign = 8; >> + else >> + TyAlign = 4; >> + } >> >> We should be using the same rules here we do for argument passing. In >> particular, for APCS, the argument-passing type alignment is >> unconditionally 4. (This can have effects for structs marked with >> "__attribute__((aligned(16)))", etc.) > Is there an interface to query the argument-passing alignment?
Nothing cares about it other than the calling convention code, so there isn't a general API. It's basically just "match whatever ARMABIInfo::classifyArgumentType does". -Eli _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
