From c9a31a6c499cc7629b3aca76bacf5ec2a6c4df45 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 2 Feb 2024 17:35:29 -0800 Subject: [PATCH] float_control pragma applies to clang (#183) --- Inc/DirectXMathMatrix.inl | 4 ++-- Inc/DirectXMathVector.inl | 20 ++++++++++---------- README.md | 4 ++++ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Inc/DirectXMathMatrix.inl b/Inc/DirectXMathMatrix.inl index 1c579a1..f063a61 100644 --- a/Inc/DirectXMathMatrix.inl +++ b/Inc/DirectXMathMatrix.inl @@ -21,7 +21,7 @@ //------------------------------------------------------------------------------ -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -89,7 +89,7 @@ inline bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif diff --git a/Inc/DirectXMathVector.inl b/Inc/DirectXMathVector.inl index e3db56a..0394b37 100644 --- a/Inc/DirectXMathVector.inl +++ b/Inc/DirectXMathVector.inl @@ -2154,7 +2154,7 @@ inline XMVECTOR XM_CALLCONV XMVectorInBoundsR //------------------------------------------------------------------------------ -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -2182,7 +2182,7 @@ inline XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif @@ -2296,7 +2296,7 @@ namespace Internal } } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -2341,7 +2341,7 @@ inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif @@ -6608,7 +6608,7 @@ inline bool XM_CALLCONV XMVector2InBounds //------------------------------------------------------------------------------ -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -6632,7 +6632,7 @@ inline bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif @@ -9360,7 +9360,7 @@ inline bool XM_CALLCONV XMVector3InBounds //------------------------------------------------------------------------------ -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -9388,7 +9388,7 @@ inline bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif @@ -13242,7 +13242,7 @@ inline bool XM_CALLCONV XMVector4InBounds //------------------------------------------------------------------------------ -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -13269,7 +13269,7 @@ inline bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept #endif } -#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) +#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma float_control(pop) #endif diff --git a/README.md b/README.md index 02e5b17..4c3baa9 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,10 @@ All content and source code for this package are subject to the terms of the [MI For the latest version of DirectXMath, bug reports, etc. please visit the project site on [GitHub](https://github.com/microsoft/DirectXMath). +## Release Notes + +* The clang/LLVM toolset currently does not respect the ``float_control`` pragma for SSE instrinsics. Therefore, the use of ``/fp:fast`` is not recommended on clang/LLVM until this issue is fixed. See [55713](https://github.com/llvm/llvm-project/issues/55713). + ## Support For questions, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/directxmath) with the *directxmath* tag, or the [DirectX Discord Server](https://discord.gg/directx) in the *dx12-developers* or *dx9-dx11-developers* channel.