Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use <intrin0.h> with Clang #3285

Merged
merged 2 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/__msvc_int128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdint>
#include <intrin.h> // TRANSITION, GH-2520
#include _STL_INTRIN_HEADER
#include <limits>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/bit
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_EMIT_STL_WARNING(STL4038, "The contents of <bit> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <intrin0.h>
#include _STL_INTRIN_HEADER
#include <isa_availability.h>
#include <limits>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
_EMIT_STL_WARNING(STL4038, "The contents of <charconv> are available only with C++17 or later.");
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <cstring>
#include <intrin0.h>
#include _STL_INTRIN_HEADER
#include <xbit_ops.h>
#include <xcharconv.h>
#include <xcharconv_ryu.h>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endif // ^^^ intrinsics unavailable ^^^

#if _HAS_CMATH_INTRINSICS
#include <intrin0.h>
#include _STL_INTRIN_HEADER
#endif // _HAS_CMATH_INTRINSICS

#if _HAS_CXX20
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/limits
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <cfloat>
#include <climits>
#include <cwchar>
#include <intrin0.h>
#include _STL_INTRIN_HEADER
#include <isa_availability.h>
#include <xstddef>

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xatomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR

#include <intrin0.h>
#include _STL_INTRIN_HEADER
#include <type_traits>

#pragma pack(push, _CRT_PACKING)
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xbit_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#include <cstdint>
#include <intrin0.h>
#include _STL_INTRIN_HEADER

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xcharconv_ryu.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#endif // ^^^ intrinsics unavailable ^^^

#if _HAS_CHARCONV_INTRINSICS
#include <intrin0.h> // for _umul128() and __shiftright128()
#include _STL_INTRIN_HEADER // for _umul128() and __shiftright128()
#endif // ^^^ intrinsics available ^^^

#if !_HAS_CXX17
Expand Down
6 changes: 4 additions & 2 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1833,9 +1833,11 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error.
#endif // __cpp_noexcept_function_type

#ifdef __clang__
#define _STL_UNREACHABLE __builtin_unreachable()
#define _STL_INTRIN_HEADER <intrin.h>
#define _STL_UNREACHABLE __builtin_unreachable()
#else // ^^^ clang / other vvv
#define _STL_UNREACHABLE __assume(false)
#define _STL_INTRIN_HEADER <intrin0.h>
#define _STL_UNREACHABLE __assume(false)
#endif // __clang__

#ifdef _ENABLE_STL_INTERNAL_CHECK
Expand Down
4 changes: 1 addition & 3 deletions stl/src/vector_algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
#if (defined(_M_IX86) || defined(_M_X64)) && !defined(_M_ARM64EC)

#include <cstdint>
#include <emmintrin.h>
#include <immintrin.h>
#include <intrin0.h>
#include <intrin.h>
#include <isa_availability.h>

extern "C" long __isa_enabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cstdlib>
#include <exception>
#include <functional>
#include <intrin0.h>
#include <intrin.h>
#include <mutex>
#include <stdexcept>
#include <string>
Expand Down