x86/intreadwrite: add missing casts to pointer arguments

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ö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-07-11 13:52:10 -03:00
parent d28a7e8eb7
commit 70c6b904be
2 changed files with 5 additions and 15 deletions

5
configure vendored
View File

@ -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

View File

@ -23,32 +23,25 @@
#include <stdint.h>
#include "config.h"
#if HAVE_INTRINSICS_SSE && defined(__SSE__)
#include <immintrin.h>
#endif
#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__)
#include <emmintrin.h>
#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__) */