incomplete vector initialization

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

incomplete vector initialization

Anton Yartsev
Noticed that only the first vector element is initialized in IR when
initializing a vector with a single literal:
vector int v = (vector int)(1);
turns into
@v = global <4 x i32> <i32 1, i32 0, i32 0, i32 0>, align 16 ; <<4 x
i32>*> [#uses=0]

Attached is the patch and the test.

--
Anton


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

AltiVec_vector_init_fix.patch (2K) Download Attachment
vector-init.c (208 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: incomplete vector initialization

John McCall
On Jun 10, 2010, at 6:02 PM, Anton Yartsev wrote:
> Noticed that only the first vector element is initialized in IR when initializing a vector with a single literal:
> vector int v = (vector int)(1);
> turns into
> @v = global <4 x i32> <i32 1, i32 0, i32 0, i32 0>, align 16 ; <<4 x i32>*> [#uses=0]
>
> Attached is the patch and the test.

Committed in r105824, thanks!

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev