Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / X86 / bmi2-builtins.c
bloba9e9bc5862a3474c1d2df60455d7050908d42998
1 // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +bmi2 -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -ffreestanding %s -triple=i386-apple-darwin -target-feature +bmi2 -emit-llvm -o - | FileCheck %s --check-prefix=B32
5 #include <immintrin.h>
7 unsigned int test_bzhi_u32(unsigned int __X, unsigned int __Y) {
8 // CHECK: @llvm.x86.bmi.bzhi.32
9 return _bzhi_u32(__X, __Y);
12 unsigned int test_pdep_u32(unsigned int __X, unsigned int __Y) {
13 // CHECK: @llvm.x86.bmi.pdep.32
14 return _pdep_u32(__X, __Y);
17 unsigned int test_pext_u32(unsigned int __X, unsigned int __Y) {
18 // CHECK: @llvm.x86.bmi.pext.32
19 return _pext_u32(__X, __Y);
22 #ifdef __i386__
23 unsigned int test_mulx_u32(unsigned int __X, unsigned int __Y,
24 unsigned int *__P) {
25 // B32: @test_mulx_u32
26 // B32: mul i64
27 return _mulx_u32(__X, __Y, __P);
29 #endif
31 #ifdef __x86_64__
32 unsigned long long test_bzhi_u64(unsigned long long __X, unsigned long long __Y) {
33 // CHECK: @llvm.x86.bmi.bzhi.64
34 return _bzhi_u64(__X, __Y);
37 unsigned long long test_pdep_u64(unsigned long long __X, unsigned long long __Y) {
38 // CHECK: @llvm.x86.bmi.pdep.64
39 return _pdep_u64(__X, __Y);
42 unsigned long long test_pext_u64(unsigned long long __X, unsigned long long __Y) {
43 // CHECK: @llvm.x86.bmi.pext.64
44 return _pext_u64(__X, __Y);
47 unsigned long long test_mulx_u64(unsigned long long __X, unsigned long long __Y,
48 unsigned long long *__P) {
49 // CHECK: @test_mulx_u64
50 // CHECK: mul i128
51 return _mulx_u64(__X, __Y, __P);
53 #endif