1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -target-cpu pentium4 -target-feature +sse4a -g -emit-llvm %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc #include <ammintrin.h>
4*f4a2713aSLionel Sambuc
test_extracti_si64(__m128i x)5*f4a2713aSLionel Sambuc __m128i test_extracti_si64(__m128i x) {
6*f4a2713aSLionel Sambuc return _mm_extracti_si64(x, 3, 2);
7*f4a2713aSLionel Sambuc // CHECK: @test_extracti_si64
8*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.extrqi(<2 x i64> %{{[^,]+}}, i8 3, i8 2)
9*f4a2713aSLionel Sambuc }
10*f4a2713aSLionel Sambuc
test_extract_si64(__m128i x,__m128i y)11*f4a2713aSLionel Sambuc __m128i test_extract_si64(__m128i x, __m128i y) {
12*f4a2713aSLionel Sambuc return _mm_extract_si64(x, y);
13*f4a2713aSLionel Sambuc // CHECK: @test_extract_si64
14*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.extrq(<2 x i64> %{{[^,]+}}, <16 x i8> %{{[^,]+}})
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc
test_inserti_si64(__m128i x,__m128i y)17*f4a2713aSLionel Sambuc __m128i test_inserti_si64(__m128i x, __m128i y) {
18*f4a2713aSLionel Sambuc return _mm_inserti_si64(x, y, 5, 6);
19*f4a2713aSLionel Sambuc // CHECK: @test_inserti_si64
20*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.insertqi(<2 x i64> %{{[^,]+}}, <2 x i64> %{{[^,]+}}, i8 5, i8 6)
21*f4a2713aSLionel Sambuc }
22*f4a2713aSLionel Sambuc
test_insert_si64(__m128i x,__m128i y)23*f4a2713aSLionel Sambuc __m128i test_insert_si64(__m128i x, __m128i y) {
24*f4a2713aSLionel Sambuc return _mm_insert_si64(x, y);
25*f4a2713aSLionel Sambuc // CHECK: @test_insert_si64
26*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.insertq(<2 x i64> %{{[^,]+}}, <2 x i64> %{{[^,]+}})
27*f4a2713aSLionel Sambuc }
28*f4a2713aSLionel Sambuc
test_stream_sd(double * p,__m128d a)29*f4a2713aSLionel Sambuc void test_stream_sd(double *p, __m128d a) {
30*f4a2713aSLionel Sambuc _mm_stream_sd(p, a);
31*f4a2713aSLionel Sambuc // CHECK: @test_stream_sd
32*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.movnt.sd(i8* %{{[^,]+}}, <2 x double> %{{[^,]+}})
33*f4a2713aSLionel Sambuc }
34*f4a2713aSLionel Sambuc
test_stream_ss(float * p,__m128 a)35*f4a2713aSLionel Sambuc void test_stream_ss(float *p, __m128 a) {
36*f4a2713aSLionel Sambuc _mm_stream_ss(p, a);
37*f4a2713aSLionel Sambuc // CHECK: @test_stream_ss
38*f4a2713aSLionel Sambuc // CHECK: @llvm.x86.sse4a.movnt.ss(i8* %{{[^,]+}}, <4 x float> %{{[^,]+}})
39*f4a2713aSLionel Sambuc }
40