This is in line with implementation of _mm_extract_pi16.
rdar://
15250497
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193187
91177308-0d34-0410-b5e6-
96231b3b80d8
_mm_extract_epi16(__m128i __a, int __imm)
{
__v8hi __b = (__v8hi)__a;
- return (unsigned short)__b[__imm];
+ return (unsigned short)__b[__imm & 7];
}
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
// CHECK: store {{.*}} <2 x i64>* {{.*}}, align 16, !nontemporal
_mm_stream_si128(y, x);
}
+
+void test_extract_epi16(__m128i __a) {
+ // CHECK-LABEL: define void @test_extract_epi16
+ // CHECK: [[x:%.*]] = and i32 %{{.*}}, 7
+ // CHECK: extractelement <8 x i16> %{{.*}}, i32 [[x]]
+ _mm_extract_epi16(__a, 8);
+}