@@ -84,7 +84,7 @@ constexpr unsigned int ElemsPerAddrEncoding() {
8484template <typename T, int n, int ElemsPerAddr = 1 ,
8585 CacheHint L1H = CacheHint::None, CacheHint L3H = CacheHint::None>
8686ESIMD_INLINE ESIMD_NODEBUG
87- typename std::enable_if<((n == 8 || n == 16 || n == 32 ) &&
87+ typename std::enable_if<(__esimd::isPowerOf2(n, 32 ) &&
8888 (ElemsPerAddr == 1 || ElemsPerAddr == 2 ||
8989 ElemsPerAddr == 4 )),
9090 simd<T, n * ElemsPerAddr>>::type
@@ -120,7 +120,7 @@ ESIMD_INLINE ESIMD_NODEBUG
120120template <typename T, int n, int ElemsPerAddr = 1 ,
121121 CacheHint L1H = CacheHint::None, CacheHint L3H = CacheHint::None>
122122ESIMD_INLINE ESIMD_NODEBUG
123- typename std::enable_if<((n == 8 || n == 16 || n == 32 ) &&
123+ typename std::enable_if<(__esimd::isPowerOf2(n, 32 ) &&
124124 (ElemsPerAddr == 1 || ElemsPerAddr == 2 ||
125125 ElemsPerAddr == 4 )),
126126 void >::type
@@ -487,9 +487,9 @@ ESIMD_INLINE ESIMD_NODEBUG simd<T, n> slm_block_load(uint32_t offset) {
487487 static_assert (Sz % __esimd::OWORD == 0 ,
488488 " block size must be whole number of owords" );
489489 static_assert (__esimd::isPowerOf2 (Sz / __esimd::OWORD),
490- " block must be 1, 2, 4 or 8 owords long" );
491- static_assert (Sz <= 8 * __esimd::OWORD,
492- " block size must be at most 8 owords" );
490+ " block must be 1, 2, 4, 8, 16 owords long" );
491+ static_assert (Sz <= 16 * __esimd::OWORD,
492+ " block size must be at most 16 owords" );
493493
494494 return __esimd_slm_block_read<T, n>(offset);
495495}
@@ -503,9 +503,9 @@ ESIMD_INLINE ESIMD_NODEBUG void slm_block_store(uint32_t offset,
503503 static_assert (Sz % __esimd::OWORD == 0 ,
504504 " block size must be whole number of owords" );
505505 static_assert (__esimd::isPowerOf2 (Sz / __esimd::OWORD),
506- " block must be 1, 2, 4 or 8 owords long" );
507- static_assert (Sz <= 8 * __esimd::OWORD,
508- " block size must be at most 8 owords" );
506+ " block must be 1, 2, 4, 8, or 16 owords long" );
507+ static_assert (Sz <= 16 * __esimd::OWORD,
508+ " block size must be at most 16 owords" );
509509
510510 // offset in genx.oword.st is in owords
511511 __esimd_slm_block_write<T, n>(offset >> 4 , vals.data ());
0 commit comments