716 changes: 716 additions & 0 deletions clang/lib/Headers/avx512fintrin.h

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions clang/lib/Headers/immintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
#include <fmaintrin.h>
#endif

#ifdef __AVX512F__
#include <avx512fintrin.h>
#endif

#ifdef __AVX512ER__
#include <avx512erintrin.h>
#endif

#ifdef __RDRND__
static __inline__ int __attribute__((__always_inline__, __nodebug__))
_rdrand16_step(unsigned short *__p)
Expand Down
30 changes: 30 additions & 0 deletions clang/test/CodeGen/avx512f-builtins.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +avx512f -emit-llvm -o - -Werror | FileCheck %s

// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H

#include <immintrin.h>

__m512d test_mm512_sqrt_pd(__m512d a)
{
// CHECK: @llvm.x86.avx512.sqrt.pd.512
return _mm512_sqrt_pd(a);
}

__m512 test_mm512_sqrt_ps(__m512 a)
{
// CHECK: @llvm.x86.avx512.sqrt.ps.512
return _mm512_sqrt_ps(a);
}

__m512d test_mm512_rsqrt14_pd(__m512d a)
{
// CHECK: @llvm.x86.avx512.rsqrt14.pd.512
return _mm512_rsqrt14_pd(a);
}

__m512 test_mm512_rsqrt14_ps(__m512 a)
{
// CHECK: @llvm.x86.avx512.rsqrt14.ps.512
return _mm512_rsqrt14_ps(a);
}
6 changes: 6 additions & 0 deletions clang/test/Headers/x86intrin.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
#ifndef __RDRND__
#define __RDRND__
#endif
#ifndef __AVX512F__
#define __AVX512F__
#endif
#ifndef __AVX512ER__
#define __AVX512ER__
#endif

// Now include the metaheader that includes all x86 intrinsic headers.
#include <x86intrin.h>
Expand Down