xref: /minix3/external/bsd/llvm/dist/clang/test/Headers/xmmintrin.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc #include <xmmintrin.h>
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc // Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by
6*0a6a1f1dSLionel Sambuc // checking that clang emits PACKSSDW instead of PACKSSWB.
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc // CHECK: define i64 @test_mm_cvtps_pi16
9*0a6a1f1dSLionel Sambuc // CHECK: call x86_mmx @llvm.x86.mmx.packssdw
10*0a6a1f1dSLionel Sambuc 
test_mm_cvtps_pi16(__m128 a)11*0a6a1f1dSLionel Sambuc __m64 test_mm_cvtps_pi16(__m128 a) {
12*0a6a1f1dSLionel Sambuc   return _mm_cvtps_pi16(a);
13*0a6a1f1dSLionel Sambuc }
14