Skip to content

Commit

Permalink
[VCRUNTIME] Fix emmintrin.h for GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
tkreuzer committed Jan 18, 2025
1 parent bda36bc commit 454916a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sdk/include/vcruntime/emmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,15 @@ __INTRIN_INLINE_SSE2 __m128i _mm_xor_si128(__m128i a, __m128i b)
return (__m128i)((__v2du)a ^ (__v2du)b);
}

#ifdef __clang__
#define _mm_slli_si128(a, imm) \
((__m128i)__builtin_ia32_pslldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm)))
#else
__INTRIN_INLINE_SSE2 __m128i _mm_slli_si128(__m128i a, const int imm)
{
return (__m128i)__builtin_ia32_pslldqi128(a, imm * 8);
}
#endif

__INTRIN_INLINE_SSE2 __m128i _mm_slli_epi16(__m128i a, int count)
{
Expand Down Expand Up @@ -1398,8 +1405,15 @@ __INTRIN_INLINE_SSE2 __m128i _mm_sra_epi32(__m128i a, __m128i count)
return (__m128i)__builtin_ia32_psrad128((__v4si)a, (__v4si)count);
}

#ifdef __clang__
#define _mm_srli_si128(a, imm) \
((__m128i)__builtin_ia32_psrldqi128_byteshift((__v2di)(__m128i)(a), (int)(imm)))
#else
__INTRIN_INLINE_SSE2 __m128i _mm_srli_si128(__m128i a, const int imm)
{
return (__m128i)__builtin_ia32_psrldqi128(a, imm * 8);
}
#endif

__INTRIN_INLINE_SSE2 __m128i _mm_srli_epi16(__m128i a, int count)
{
Expand Down

0 comments on commit 454916a

Please sign in to comment.