File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 281
281
#endif
282
282
283
283
/* -**************************************************************
284
- * Alignment check
284
+ * Alignment
285
285
*****************************************************************/
286
286
287
287
/* @return 1 if @u is a 2^n value, 0 otherwise
@@ -315,6 +315,19 @@ MEM_STATIC int ZSTD_isPower2(size_t u) {
315
315
# endif
316
316
#endif /* ZSTD_ALIGNOF */
317
317
318
+ #ifndef ZSTD_ALIGNED
319
+ /* C90-compatible alignment macro (GCC/Clang). Adjust for other compilers if needed. */
320
+ # if defined(__GNUC__)
321
+ # define ZSTD_ALIGNED (a ) __attribute__((aligned(a)))
322
+ # elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
323
+ # define ZSTD_ALIGNED (a ) alignas (a)
324
+ # else
325
+ /* this compiler will require its own alignment instruction */
326
+ # define ZSTD_ALIGNED (...)
327
+ # endif
328
+ #endif /* ZSTD_ALIGNED */
329
+
330
+
318
331
/* -**************************************************************
319
332
* Sanitizer
320
333
*****************************************************************/
Original file line number Diff line number Diff line change @@ -7386,22 +7386,12 @@ size_t ZSTD_convertBlockSequences(ZSTD_CCtx* cctx,
7386
7386
7387
7387
#if defined(ZSTD_ARCH_X86_AVX2 )
7388
7388
7389
- /* C90-compatible alignment macro (GCC/Clang). Adjust for other compilers if needed. */
7390
- #if defined(__GNUC__ )
7391
- # define ALIGNED32 __attribute__((aligned(32)))
7392
- #elif defined(__STDC_VERSION__ ) && (__STDC_VERSION__ >= 201112L ) /* C11 */
7393
- # define ALIGNED32 alignas(32)
7394
- #else
7395
- /* this compiler will require its own alignment instruction */
7396
- # define ALIGNED32
7397
- #endif
7398
-
7399
7389
BlockSummary ZSTD_get1BlockSummary (const ZSTD_Sequence * seqs , size_t nbSeqs )
7400
7390
{
7401
7391
size_t i ;
7402
7392
__m256i const zeroVec = _mm256_setzero_si256 ();
7403
7393
__m256i sumVec = zeroVec ; /* accumulates match+lit in 32-bit lanes */
7404
- ALIGNED32 U32 tmp [8 ]; /* temporary buffer for reduction */
7394
+ ZSTD_ALIGNED ( 32 ) U32 tmp [8 ]; /* temporary buffer for reduction */
7405
7395
size_t mSum = 0 , lSum = 0 ;
7406
7396
ZSTD_STATIC_ASSERT (sizeof (ZSTD_Sequence ) == 16 );
7407
7397
You can’t perform that action at this time.
0 commit comments