[FFmpeg-cvslog] x86/intreadwrite: add missing casts to pointer arguments
James Almer
git at videolan.org
Fri Jul 12 00:24:46 EEST 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Jul 11 13:52:10 2024 -0300| [70c6b904be08815a9fb300063d5b8010f3ddca41] | committer: James Almer
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 at martin.st>
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70c6b904be08815a9fb300063d5b8010f3ddca41
---
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 <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__) */
More information about the ffmpeg-cvslog
mailing list