Skip to content

Commit 6c800e4

Browse files
committed
BUG: ITK_COMPILER_SUPPORTS_SSE2_64 incorrectly set for 32-bit x86
If the argument -msse2 is used for 32-bit x86 build, then __SSE2__ is defined. This cause ITK_COMPILER_SUPPORTS_SSE2_64 to be set for 32-bit x86. MSVC defines _M_AMD64 and _M_X64 also for ARM64EC! /usr/local/include/ITK-5.3/itkMathDetail.h:317:10: error: use of undeclared identifier '_mm_cvtsd_si64' return _mm_cvtsd_si64(_mm_set_sd(x)); ^ /usr/local/include/ITK-5.3/itkMathDetail.h:326:10: error: use of undeclared identifier '_mm_cvtss_si64'; did you mean '_mm_cvtss_si32'? return _mm_cvtss_si64(_mm_set_ss(x)); ^ /usr/lib/clang/14.0.5/include/xmmintrin.h:1306:1: note: '_mm_cvtss_si32' declared here _mm_cvtss_si32(__m128 __a) ^ 2 errors generated.
1 parent 935533f commit 6c800e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Modules/Core/Common/src/itkConfigure.h.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@
182182
// For 32 bit Intel with MSVC, check _M_IX86_FP.
183183
// 64 bit Intel x86 always supports both 32 and 64 bit SSE2.
184184

185-
#if defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(__amd64)
186-
# define ITK_COMPILER_SUPPORTS_SSE2_64
187-
#endif
188-
189-
#if defined(ITK_COMPILER_SUPPORTS_SSE2_64) || \
190-
(defined(_M_IX86_FP) && (_M_IX86_FP >= 2))
185+
#if defined(__x86_64__) || defined(__amd64__) || (defined(_M_AMD64) && !defined(_M_ARM64EC))
191186
# define ITK_COMPILER_SUPPORTS_SSE2_32
187+
# define ITK_COMPILER_SUPPORTS_SSE2_64
188+
#else
189+
# if defined(__SSE2__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2))
190+
# define ITK_COMPILER_SUPPORTS_SSE2_32
191+
# endif
192192
#endif
193193

194194
#endif //itkConfigure_h

0 commit comments

Comments
 (0)