[FFmpeg-devel] [PATCH 3/3] avutil/mem_internal: local align should always work
Zhao Zhili
quinkblack at foxmail.com
Fri Nov 15 12:56:27 EET 2024
From: Zhao Zhili <zhilizhao at tencent.com>
---
configure | 7 -------
libavutil/mem_internal.h | 28 ++++------------------------
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/configure b/configure
index 0e9ed6dc3c..b9fb3cd5af 100755
--- a/configure
+++ b/configure
@@ -2246,7 +2246,6 @@ ARCH_FEATURES="
fast_clz
fast_cmov
fast_float16
- local_aligned
simd_align_16
simd_align_32
simd_align_64
@@ -5378,7 +5377,6 @@ elif enabled arm; then
elif enabled loongarch; then
- enable local_aligned
enable simd_align_32
enable fast_64bit
enable fast_clz
@@ -5445,7 +5443,6 @@ elif enabled mips; then
;;
# Cores from Loongson
loongson2e|loongson2f|loongson3*)
- enable local_aligned
enable simd_align_16
enable fast_64bit
enable fast_clz
@@ -6369,8 +6366,6 @@ elif enabled parisc; then
elif enabled ppc; then
- enable local_aligned
-
check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
check_inline_asm ibm_asm '"add 0, 0, 0"'
check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
@@ -6409,8 +6404,6 @@ elif enabled x86; then
check_builtin rdtsc intrin.h "__rdtsc()"
check_builtin mm_empty mmintrin.h "_mm_empty()"
- enable local_aligned
-
# check whether EBP is available on x86
# As 'i' is stored on the stack, this program will crash
# if the base pointer is used to access it because the
diff --git a/libavutil/mem_internal.h b/libavutil/mem_internal.h
index b77157bfa0..7dbc34d3d8 100644
--- a/libavutil/mem_internal.h
+++ b/libavutil/mem_internal.h
@@ -110,38 +110,18 @@
// to be forced to tokenize __VA_ARGS__
#define E1(x) x
-#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
- uint8_t la_##v[sizeof(t s o) + (a)]; \
- t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
-
#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
DECLARE_ALIGNED(a, t, la_##v) s o; \
t (*v) o = la_##v
#define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_##a(t, v, __VA_ARGS__)
-#if HAVE_LOCAL_ALIGNED
-# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_D(4, t, v, __VA_ARGS__,,))
-#else
-# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_A(4, t, v, __VA_ARGS__,,))
-#endif
+#define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_D(4, t, v, __VA_ARGS__,,))
-#if HAVE_LOCAL_ALIGNED
-# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
-#else
-# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_A(8, t, v, __VA_ARGS__,,))
-#endif
+#define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
-#if HAVE_LOCAL_ALIGNED
-# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
-#else
-# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_A(16, t, v, __VA_ARGS__,,))
-#endif
+#define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
-#if HAVE_LOCAL_ALIGNED
-# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,))
-#else
-# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_A(32, t, v, __VA_ARGS__,,))
-#endif
+#define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,))
#endif /* AVUTIL_MEM_INTERNAL_H */
--
2.25.1
More information about the ffmpeg-devel
mailing list