Skip to content

Commit 8b00eae

Browse files
committed
Minor fixes for AVX512F/AVX512+
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
1 parent dfb7d81 commit 8b00eae

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

openvdb/openvdb/simd/Simd.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ namespace simd {
6161
#define OPENVDB_SELECT_SIMD_T(A, ...) A
6262
static inline constexpr size_t OPENVDB_MAX_REGISTER_SIZE =
6363
(OPENVDB_X86_INSTRSET < 7 ? 128 : // no AVX, SSE __m128 registers
64-
(OPENVDB_X86_INSTRSET < 9 ? 256 : // AVX __m256 registers
65-
(OPENVDB_X86_INSTRSET > 9 ? 512 : 0))); // AVX __m512 registers, else 128
64+
(OPENVDB_X86_INSTRSET < 9 ? 256 : // AVX/AVX2 __m256 registers
65+
(OPENVDB_X86_INSTRSET >= 9 ? 512 : 0))); // AVX512 __m512 registers
6666
#else
6767
#define OPENVDB_SELECT_SIMD_T(A, ...) __VA_ARGS__
6868
// @note In this case VCL will not have been used to determine any requested ISA.
@@ -249,24 +249,28 @@ template <> struct IsSimdMaskT<simd::Vec512b> : std::true_type {};
249249

250250
// broad bool masks
251251
#ifdef OPENVDB_USE_VCL // Duplicate specializations when VCL is NOT in use
252-
template <> struct IsSimdMaskT<simd::Vec16cb> : std::true_type {};
252+
#if OPENVDB_X86_INSTRSET < 9 // These alias to corresponding VecNb containers with AVX512f
253253
template <> struct IsSimdMaskT<simd::Vec16fb> : std::true_type {};
254+
template <> struct IsSimdMaskT<simd::Vec8db> : std::true_type {};
255+
template <> struct IsSimdMaskT<simd::Vec8qb> : std::true_type {};
254256
template <> struct IsSimdMaskT<simd::Vec16ib> : std::true_type {};
257+
#endif
258+
#if OPENVDB_X86_INSTRSET < 10 // These alias to corresponding VecNb containers with AVX512+
259+
template <> struct IsSimdMaskT<simd::Vec16cb> : std::true_type {};
255260
template <> struct IsSimdMaskT<simd::Vec16sb> : std::true_type {};
256261
template <> struct IsSimdMaskT<simd::Vec2db> : std::true_type {};
257262
template <> struct IsSimdMaskT<simd::Vec2qb> : std::true_type {};
258263
template <> struct IsSimdMaskT<simd::Vec32cb> : std::true_type {};
259-
template <> struct IsSimdMaskT<simd::Vec32sb> : std::true_type {};
260-
template <> struct IsSimdMaskT<simd::Vec4db> : std::true_type {};
261264
template <> struct IsSimdMaskT<simd::Vec4fb> : std::true_type {};
265+
template <> struct IsSimdMaskT<simd::Vec4db> : std::true_type {};
262266
template <> struct IsSimdMaskT<simd::Vec4ib> : std::true_type {};
263-
template <> struct IsSimdMaskT<simd::Vec4qb> : std::true_type {};
264267
template <> struct IsSimdMaskT<simd::Vec64cb> : std::true_type {};
265-
template <> struct IsSimdMaskT<simd::Vec8db> : std::true_type {};
268+
template <> struct IsSimdMaskT<simd::Vec4qb> : std::true_type {};
266269
template <> struct IsSimdMaskT<simd::Vec8fb> : std::true_type {};
267270
template <> struct IsSimdMaskT<simd::Vec8ib> : std::true_type {};
268-
template <> struct IsSimdMaskT<simd::Vec8qb> : std::true_type {};
269271
template <> struct IsSimdMaskT<simd::Vec8sb> : std::true_type {};
272+
template <> struct IsSimdMaskT<simd::Vec32sb> : std::true_type {};
273+
#endif
270274
#endif
271275

272276
// 8-bit signed integer vectors

0 commit comments

Comments
 (0)