[cfe-dev] ext_vector_type cg-gen crash on x86-64 and some questions on the ABI

Chris Lattner clattner at apple.com
Tue Oct 20 21:40:04 PDT 2009


On Oct 19, 2009, at 2:28 PM, Mattias Holm wrote:

> I have some code that simplified is:
>

This seems to work with clang mainline, at least with 'clang t.c -c -O  
-m64'

> Now some questions on the semantics of the ext_vector_type, since it  
> is
> not that well documented in the clang extensions page.
>
> 1. What is the ABI for an ext_vector_type? Will the vectors be  
> passed in
> SSE registers if they are passed as function arguments, or will they  
> be
> passed by address?

vectors that correspond to SSE types (e.g. 4 x float) should be passed  
and returned in sse registers.

> 2. Sizeof (float3) returns 12 and not 16 as I would have guessed for
> alignment reasons, why is this the case? Assuming you want to use SSE
> for computing with the vectors, they must be aligned IIRC.

That is really bad, please file a bug.  We don't really maintain a  
stable ABI for non-native vector types, so we can fix this.

-Chris



More information about the cfe-dev mailing list