[PATCH] D46957: [x86] Lower some trunc + shuffle patterns to vpmovd[b|w]

Gabor Buella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 13:00:34 PDT 2018


GBuella added a comment.

In https://reviews.llvm.org/D46957#1101896, @craig.topper wrote:

> What about this. This is the most obvious representation for this.
>
>   define <8 x i16> @trunc_v4i64_to_v4i16_return_v8i16(<4 x i64> %vec) nounwind {
>     %truncated = trunc <4 x i64> %vec to <4 x i16>
>     %result = shufflevector <4 x i16> %truncated, <4 x i16> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
>     ret <8 x i16> %result
>   }
>


Oh, nice, I'm adding this one as well. BTW, how would you write that in C?


https://reviews.llvm.org/D46957





More information about the llvm-commits mailing list