craig.topper created this revision.
craig.topper added reviewers: DavidKreitzer, echristo, RKSimon, rnk.

This matches the Intel documentation which shows them available by importing 
immintrin.h. x86intrin.h also includes immintrin.h so anyone including 
x86intrin.h will still get them.

This is different than gcc, but I don't think we were a perfect match there 
already. I'm unclear what gcc's policy is about how they choose which to add 
things to.


Repository:
  rC Clang

https://reviews.llvm.org/D47182

Files:
  lib/Headers/bmi2intrin.h
  lib/Headers/bmiintrin.h
  lib/Headers/cldemoteintrin.h
  lib/Headers/clzerointrin.h
  lib/Headers/immintrin.h
  lib/Headers/lzcntintrin.h
  lib/Headers/movdirintrin.h
  lib/Headers/pconfigintrin.h
  lib/Headers/ptwriteintrin.h
  lib/Headers/rdseedintrin.h
  lib/Headers/sgxintrin.h
  lib/Headers/waitpkgintrin.h
  lib/Headers/wbnoinvdintrin.h
  lib/Headers/x86intrin.h

Index: lib/Headers/x86intrin.h
===================================================================
--- lib/Headers/x86intrin.h
+++ lib/Headers/x86intrin.h
@@ -32,26 +32,6 @@
 #include <mm3dnow.h>
 #endif
 
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__)
-#include <bmiintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__)
-#include <bmi2intrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__)
-#include <lzcntintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__POPCNT__)
-#include <popcntintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__)
-#include <rdseedintrin.h>
-#endif
-
 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__PRFCHW__)
 #include <prfchwintrin.h>
 #endif
@@ -76,45 +56,8 @@
 #include <lwpintrin.h>
 #endif
 
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__)
-#include <f16cintrin.h>
-#endif
-
 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__MWAITX__)
 #include <mwaitxintrin.h>
 #endif
 
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLZERO__)
-#include <clzerointrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WBNOINVD__)
-#include <wbnoinvdintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLDEMOTE__)
-#include <cldemoteintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WAITPKG__)
-#include <waitpkgintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || \
-  defined(__MOVDIRI__) || defined(__MOVDIR64B__)
-#include <movdirintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PCONFIG__)
-#include <pconfigintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SGX__)
-#include <sgxintrin.h>
-#endif
-
-#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PTWRITE__)
-#include <ptwriteintrin.h>
-#endif
-
 #endif /* __X86INTRIN_H */
Index: lib/Headers/wbnoinvdintrin.h
===================================================================
--- lib/Headers/wbnoinvdintrin.h
+++ lib/Headers/wbnoinvdintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <wbnoinvdintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <wbnoinvdintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __WBNOINVDINTRIN_H
Index: lib/Headers/waitpkgintrin.h
===================================================================
--- lib/Headers/waitpkgintrin.h
+++ lib/Headers/waitpkgintrin.h
@@ -20,8 +20,8 @@
  *
  *===-----------------------------------------------------------------------===
  */
-#ifndef __X86INTRIN_H
-#error "Never use <waitpkgintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <waitpkgintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __WAITPKGINTRIN_H
Index: lib/Headers/sgxintrin.h
===================================================================
--- lib/Headers/sgxintrin.h
+++ lib/Headers/sgxintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <sgxintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <sgxintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __SGXINTRIN_H
Index: lib/Headers/rdseedintrin.h
===================================================================
--- lib/Headers/rdseedintrin.h
+++ lib/Headers/rdseedintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <rdseedintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <rdseedintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __RDSEEDINTRIN_H
Index: lib/Headers/ptwriteintrin.h
===================================================================
--- lib/Headers/ptwriteintrin.h
+++ lib/Headers/ptwriteintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <ptwriteintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <ptwriteintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __PTWRITEINTRIN_H
Index: lib/Headers/pconfigintrin.h
===================================================================
--- lib/Headers/pconfigintrin.h
+++ lib/Headers/pconfigintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <pconfigintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __PCONFIGINTRIN_H
Index: lib/Headers/movdirintrin.h
===================================================================
--- lib/Headers/movdirintrin.h
+++ lib/Headers/movdirintrin.h
@@ -20,8 +20,8 @@
  *
  *===-----------------------------------------------------------------------===
  */
-#ifndef __X86INTRIN_H
-#error "Never use <movdirintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <movdirintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef _MOVDIRINTRIN_H
Index: lib/Headers/lzcntintrin.h
===================================================================
--- lib/Headers/lzcntintrin.h
+++ lib/Headers/lzcntintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
-#error "Never use <lzcntintrin.h> directly; include <x86intrin.h> instead."
+#if !defined __IMMINTRIN_H
+#error "Never use <lzcntintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __LZCNTINTRIN_H
Index: lib/Headers/immintrin.h
===================================================================
--- lib/Headers/immintrin.h
+++ lib/Headers/immintrin.h
@@ -383,4 +383,41 @@
  * whereas others are also available at all times. */
 #include <adxintrin.h>
 
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__)
+#include <rdseedintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLZERO__)
+#include <clzerointrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WBNOINVD__)
+#include <wbnoinvdintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLDEMOTE__)
+#include <cldemoteintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WAITPKG__)
+#include <waitpkgintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || \
+  defined(__MOVDIRI__) || defined(__MOVDIR64B__)
+#include <movdirintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PCONFIG__)
+#include <pconfigintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SGX__)
+#include <sgxintrin.h>
+#endif
+
+#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PTWRITE__)
+#include <ptwriteintrin.h>
+#endif
+
 #endif /* __IMMINTRIN_H */
Index: lib/Headers/clzerointrin.h
===================================================================
--- lib/Headers/clzerointrin.h
+++ lib/Headers/clzerointrin.h
@@ -20,8 +20,8 @@
  *
  *===-----------------------------------------------------------------------===
  */
-#ifndef __X86INTRIN_H
-#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <clzerointrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __CLZEROINTRIN_H
Index: lib/Headers/cldemoteintrin.h
===================================================================
--- lib/Headers/cldemoteintrin.h
+++ lib/Headers/cldemoteintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __X86INTRIN_H
-#error "Never use <cldemoteintrin.h> directly; include <x86intrin.h> instead."
+#ifndef __IMMINTRIN_H
+#error "Never use <cldemoteintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __CLDEMOTEINTRIN_H
Index: lib/Headers/bmiintrin.h
===================================================================
--- lib/Headers/bmiintrin.h
+++ lib/Headers/bmiintrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
-#error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."
+#if !defined __IMMINTRIN_H
+#error "Never use <bmiintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __BMIINTRIN_H
Index: lib/Headers/bmi2intrin.h
===================================================================
--- lib/Headers/bmi2intrin.h
+++ lib/Headers/bmi2intrin.h
@@ -21,8 +21,8 @@
  *===-----------------------------------------------------------------------===
  */
 
-#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
-#error "Never use <bmi2intrin.h> directly; include <x86intrin.h> instead."
+#if !defined __IMMINTRIN_H
+#error "Never use <bmi2intrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef __BMI2INTRIN_H
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to