Skip to content

Commit c9a31a6

Browse files
authored
float_control pragma applies to clang (#183)
1 parent 6ad2eb7 commit c9a31a6

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

Inc/DirectXMathMatrix.inl

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
//------------------------------------------------------------------------------
2323

24-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
24+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
2525
#pragma float_control(push)
2626
#pragma float_control(precise, on)
2727
#endif
@@ -89,7 +89,7 @@ inline bool XM_CALLCONV XMMatrixIsNaN(FXMMATRIX M) noexcept
8989
#endif
9090
}
9191

92-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
92+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
9393
#pragma float_control(pop)
9494
#endif
9595

Inc/DirectXMathVector.inl

+10-10
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ inline XMVECTOR XM_CALLCONV XMVectorInBoundsR
21542154

21552155
//------------------------------------------------------------------------------
21562156

2157-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2157+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
21582158
#pragma float_control(push)
21592159
#pragma float_control(precise, on)
21602160
#endif
@@ -2182,7 +2182,7 @@ inline XMVECTOR XM_CALLCONV XMVectorIsNaN(FXMVECTOR V) noexcept
21822182
#endif
21832183
}
21842184

2185-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2185+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
21862186
#pragma float_control(pop)
21872187
#endif
21882188

@@ -2296,7 +2296,7 @@ namespace Internal
22962296
}
22972297
}
22982298

2299-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2299+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
23002300
#pragma float_control(push)
23012301
#pragma float_control(precise, on)
23022302
#endif
@@ -2341,7 +2341,7 @@ inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept
23412341
#endif
23422342
}
23432343

2344-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2344+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
23452345
#pragma float_control(pop)
23462346
#endif
23472347

@@ -6608,7 +6608,7 @@ inline bool XM_CALLCONV XMVector2InBounds
66086608

66096609
//------------------------------------------------------------------------------
66106610

6611-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
6611+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
66126612
#pragma float_control(push)
66136613
#pragma float_control(precise, on)
66146614
#endif
@@ -6632,7 +6632,7 @@ inline bool XM_CALLCONV XMVector2IsNaN(FXMVECTOR V) noexcept
66326632
#endif
66336633
}
66346634

6635-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
6635+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
66366636
#pragma float_control(pop)
66376637
#endif
66386638

@@ -9360,7 +9360,7 @@ inline bool XM_CALLCONV XMVector3InBounds
93609360

93619361
//------------------------------------------------------------------------------
93629362

9363-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
9363+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
93649364
#pragma float_control(push)
93659365
#pragma float_control(precise, on)
93669366
#endif
@@ -9388,7 +9388,7 @@ inline bool XM_CALLCONV XMVector3IsNaN(FXMVECTOR V) noexcept
93889388
#endif
93899389
}
93909390

9391-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
9391+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
93929392
#pragma float_control(pop)
93939393
#endif
93949394

@@ -13242,7 +13242,7 @@ inline bool XM_CALLCONV XMVector4InBounds
1324213242

1324313243
//------------------------------------------------------------------------------
1324413244

13245-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
13245+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
1324613246
#pragma float_control(push)
1324713247
#pragma float_control(precise, on)
1324813248
#endif
@@ -13269,7 +13269,7 @@ inline bool XM_CALLCONV XMVector4IsNaN(FXMVECTOR V) noexcept
1326913269
#endif
1327013270
}
1327113271

13272-
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
13272+
#if !defined(_XM_NO_INTRINSICS_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
1327313273
#pragma float_control(pop)
1327413274
#endif
1327513275

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ All content and source code for this package are subject to the terms of the [MI
8080

8181
For the latest version of DirectXMath, bug reports, etc. please visit the project site on [GitHub](https://github.com/microsoft/DirectXMath).
8282

83+
## Release Notes
84+
85+
* 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).
86+
8387
## Support
8488

8589
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.

0 commit comments

Comments
 (0)