1 /* PR target/45336 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -msse4 -mtune=generic" } */
4 /* { dg-final { scan-assembler "movsbl" } } */
5 /* { dg-final { scan-assembler "(movswl|cwtl)" } } */
6 /* { dg-final { scan-assembler "pextrb" } } */
7 /* { dg-final { scan-assembler "pextrw" } } */
8 /* { dg-final { scan-assembler "pextrd" { target { ! x86_64-*-mingw* } } } } */
9
10 #include <smmintrin.h>
foo8(__m128i x)11 int foo8(__m128i x) { return (char) _mm_extract_epi8(x, 4); }
foo16(__m128i x)12 int foo16(__m128i x) { return (short) _mm_extract_epi16(x, 3); }
foo32(__m128i x)13 int foo32(__m128i x) { return _mm_extract_epi32(x, 2); }
14