From 70c6b904be08815a9fb300063d5b8010f3ddca41 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 11 Jul 2024 13:52:10 -0300 Subject: [PATCH] x86/intreadwrite: add missing casts to pointer arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should make strict compilers happy. Also, make AV_COPY128 use integer operations while at it. Removing the inclusion of immintrin.h ensures a lot less intrinsic related headers are included as well, which fixes a clash of defines with some Clang versions. Reviewed-by: Martin Storsjö Signed-off-by: James Almer --- configure | 5 +---- libavutil/x86/intreadwrite.h | 15 ++++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/configure b/configure index 7151ed1de3..f84fefeaab 100755 --- a/configure +++ b/configure @@ -2314,7 +2314,6 @@ HEADERS_LIST=" INTRINSICS_LIST=" intrinsics_neon - intrinsics_sse intrinsics_sse2 " @@ -2745,8 +2744,7 @@ armv6t2_deps="arm" armv8_deps="aarch64" neon_deps_any="aarch64 arm" intrinsics_neon_deps="neon" -intrinsics_sse_deps="sse" -intrinsics_sse2_deps="sse2 intrinsics_sse" +intrinsics_sse2_deps="sse2" vfp_deps="arm" vfpv3_deps="vfp" setend_deps="arm" @@ -6448,7 +6446,6 @@ elif enabled loongarch; then fi check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)" -check_cc intrinsics_sse immintrin.h "__m128 test = _mm_setzero_ps()" check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()" check_ldflags -Wl,--as-needed diff --git a/libavutil/x86/intreadwrite.h b/libavutil/x86/intreadwrite.h index d916410e14..65cc6b39a1 100644 --- a/libavutil/x86/intreadwrite.h +++ b/libavutil/x86/intreadwrite.h @@ -23,32 +23,25 @@ #include #include "config.h" -#if HAVE_INTRINSICS_SSE && defined(__SSE__) -#include -#endif #if HAVE_INTRINSICS_SSE2 && defined(__SSE2__) #include #endif #include "libavutil/attributes.h" -#if HAVE_INTRINSICS_SSE && defined(__SSE__) +#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__) #define AV_COPY128 AV_COPY128 static av_always_inline void AV_COPY128(void *d, const void *s) { - __m128 tmp = _mm_load_ps(s); - _mm_store_ps(d, tmp); + __m128i tmp = _mm_load_si128((const __m128i *)s); + _mm_store_si128((__m128i *)d, tmp); } -#endif /* HAVE_INTRINSICS_SSE && defined(__SSE__) */ - -#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__) - #define AV_ZERO128 AV_ZERO128 static av_always_inline void AV_ZERO128(void *d) { __m128i zero = _mm_setzero_si128(); - _mm_store_si128(d, zero); + _mm_store_si128((__m128i *)d, zero); } #endif /* HAVE_INTRINSICS_SSE2 && defined(__SSE2__) */