Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / X86 / sse4a-builtins.c
blob5d38a9cde329db6d79725a549a229c0516dea19b
1 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4a -emit-llvm -o - -Wall -Werror | FileCheck %s
2 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4a -emit-llvm -o - -Wall -Werror | FileCheck %s
5 #include <x86intrin.h>
7 // NOTE: This should match the tests in llvm/test/CodeGen/X86/sse4a-intrinsics-fast-isel.ll
9 __m128i test_mm_extracti_si64(__m128i x) {
10 // CHECK-LABEL: test_mm_extracti_si64
11 // CHECK: call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %{{[^,]+}}, i8 3, i8 2)
12 return _mm_extracti_si64(x, 3, 2);
15 __m128i test_mm_extract_si64(__m128i x, __m128i y) {
16 // CHECK-LABEL: test_mm_extract_si64
17 // CHECK: call <2 x i64> @llvm.x86.sse4a.extrq(<2 x i64> %{{[^,]+}}, <16 x i8> %{{[^,]+}})
18 return _mm_extract_si64(x, y);
21 __m128i test_mm_inserti_si64(__m128i x, __m128i y) {
22 // CHECK-LABEL: test_mm_inserti_si64
23 // CHECK: call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %{{[^,]+}}, <2 x i64> %{{[^,]+}}, i8 5, i8 6)
24 return _mm_inserti_si64(x, y, 5, 6);
27 __m128i test_mm_insert_si64(__m128i x, __m128i y) {
28 // CHECK-LABEL: test_mm_insert_si64
29 // CHECK: call <2 x i64> @llvm.x86.sse4a.insertq(<2 x i64> %{{[^,]+}}, <2 x i64> %{{[^,]+}})
30 return _mm_insert_si64(x, y);
33 void test_mm_stream_sd(double *p, __m128d a) {
34 // CHECK-LABEL: test_mm_stream_sd
35 // CHECK: extractelement <2 x double> %{{.*}}, i64 0
36 // CHECK: store double %{{.*}}, ptr %{{.*}}, align 1, !nontemporal
37 _mm_stream_sd(p, a);
40 void test_mm_stream_sd_void(void *p, __m128d a) {
41 // CHECK-LABEL: test_mm_stream_sd_void
42 // CHECK: extractelement <2 x double> %{{.*}}, i64 0
43 // CHECK: store double %{{.*}}, ptr %{{.*}}, align 1, !nontemporal
44 _mm_stream_sd(p, a);
47 void test_mm_stream_ss(float *p, __m128 a) {
48 // CHECK-LABEL: test_mm_stream_ss
49 // CHECK: extractelement <4 x float> %{{.*}}, i64 0
50 // CHECK: store float %{{.*}}, ptr %{{.*}}, align 1, !nontemporal
51 _mm_stream_ss(p, a);
54 void test_mm_stream_s_void(void *p, __m128 a) {
55 // CHECK-LABEL: test_mm_stream_s_void
56 // CHECK: extractelement <4 x float> %{{.*}}, i64 0
57 // CHECK: store float %{{.*}}, ptr %{{.*}}, align 1, !nontemporal
58 _mm_stream_ss(p, a);