Skip to content

Commit

Permalink
Add _MM_SHUFFLE2() macro for shuffle parameter for _mm_shuffle_pd()
Browse files Browse the repository at this point in the history
This macro is defined in emmintrin.h and used sometimes by application.
Cf https://clang.llvm.org/doxygen/emmintrin_8h.html#a3aeb3a59d7de7f9ca49c1153baa9da58 for its definition
  • Loading branch information
rouault committed Nov 4, 2024
1 parent b72d48e commit 1f3d2b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ FORCE_INLINE void _sse2neon_smp_mb(void)
#define _MM_SHUFFLE(fp3, fp2, fp1, fp0) \
(((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0)))

/**
* MACRO for shuffle parameter for _mm_shuffle_pd().
* Argument fp1 is a digit[01] that represents the fp from argument "b"
* of mm_shuffle_pd that will be placed in fp1 of result.
* fp0 is a digit[01] that represents the fp from argument "a" of mm_shuffle_pd
* that will be placed in fp0 of result.
*/
#define _MM_SHUFFLE2(fp1, fp0) (((fp1) << 1) | (fp0))

#if __has_builtin(__builtin_shufflevector)
#define _sse2neon_shuffle(type, a, b, ...) \
__builtin_shufflevector(a, b, __VA_ARGS__)
Expand Down

0 comments on commit 1f3d2b5

Please sign in to comment.