Skip to content

Commit

Permalink
Merge pull request #395 from supersjgk/master
Browse files Browse the repository at this point in the history
Fixed issue #394 - missing _mm256_storeu2_m128i macro
  • Loading branch information
Jovasa committed Feb 16, 2024
2 parents a909ddd + 203d3be commit d8c9688
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/strategies/avx2/quant-avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <immintrin.h>
#include <stdlib.h>

#include "strategies/missing-intel-intrinsics.h"

#include "avx2_common_functions.h"
#include "cu.h"
#include "encoder.h"
Expand Down
10 changes: 10 additions & 0 deletions src/strategies/missing-intel-intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
#ifndef _mm256_extract_epi32
#define _mm256_extract_epi32(a, index) (_mm_extract_epi32(_mm256_extracti128_si256((a), (index) >> 2), (index) & 3))
#endif

#ifndef _mm256_storeu2_m128i
#define _mm256_storeu2_m128i(/* __m128i* */ hiaddr, /* __m128i* */ loaddr, /* __m256i */ a) \
do { __m256i _a = (a); \
_mm_storeu_si128((__m128i*)(loaddr), _mm256_castsi256_si128(_a)); \
_mm_storeu_si128((__m128i*)(hiaddr), _mm256_extractf128_si256(_a, 0x1)); \
} while (0)
#endif

#endif

#endif

0 comments on commit d8c9688

Please sign in to comment.