avutil/avassert: Deprecate av_assert0_fpu()

Said function has presumably been added in order to check
that we have successfully reset the floating point state
after having violated the ABI/calling convention by not
issuing emms in our MMX DSP routines.

Yet the ability to check this should not have been made public,
because there is no external need for it and because the
function does not even always achieve what its documentation
claims to do: It only works when inline assembly is available.
It should have been implemented in emms.h like emms_c()
(which is where a replacement should be put if there is still
ABI-violating MMX code when av_assert0_fpu() is removed).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-02-08 14:44:54 +01:00
parent 680f32c4c9
commit 66766bb1c7
4 changed files with 17 additions and 4 deletions

View File

@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2026-02-13 - xxxxxxxxxx - lavu 60.25.100 - avassert.h
Deprecate av_assert0_fpu() and av_assert2_fpu() without replacement.
2026-02-xx - xxxxxxxxxx - lavf 62.9.100 - avformat.h
Add AVFormatContext.name.

View File

@@ -34,6 +34,7 @@
#include "attributes.h"
#include "log.h"
#include "macros.h"
#include "version.h"
/**
* assert() equivalent, that is always enabled.
@@ -63,18 +64,25 @@
*/
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
#define av_assert2(cond) av_assert0(cond)
#define av_assert2_fpu() av_assert0_fpu()
#else
#define av_assert2(cond) ((void)0)
#define av_assert2_fpu() ((void)0)
#endif
#if FF_API_ASSERT_FPU
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
#define av_assert2_fpu() av_assert0_fpu()
#else
#define av_assert2_fpu() ((void)0)
#endif
/**
* Assert that floating point operations can be executed.
*
* This will av_assert0() that the cpu is not in MMX state on X86
* @deprecated without replacement
*/
attribute_deprecated
void av_assert0_fpu(void);
#endif
/**
* Asserts that are used as compiler optimization hints depending

View File

@@ -99,7 +99,7 @@ AVRational av_get_time_base_q(void)
{
return (AVRational){1, AV_TIME_BASE};
}
#if FF_API_ASSERT_FPU
void av_assert0_fpu(void) {
#if HAVE_MMX_INLINE
uint16_t state[14];
@@ -112,3 +112,4 @@ void av_assert0_fpu(void) {
av_assert0((state[4] & 3) == 3);
#endif
}
#endif

View File

@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 60
#define LIBAVUTIL_VERSION_MINOR 24
#define LIBAVUTIL_VERSION_MINOR 25
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -112,6 +112,7 @@
#define FF_API_OPT_PTR (LIBAVUTIL_VERSION_MAJOR < 61)
#define FF_API_CPU_FLAG_FORCE (LIBAVUTIL_VERSION_MAJOR < 61)
#define FF_API_DOVI_L11_INVALID_PROPS (LIBAVUTIL_VERSION_MAJOR < 61)
#define FF_API_ASSERT_FPU (LIBAVUTIL_VERSION_MAJOR < 61)
/**
* @}