[vlc-commits] [Git][videolan/vlc][master] 9 commits: configure: remove unused define
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Thu May 19 07:23:38 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
8cbec777 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
configure: remove unused define
- - - - -
4af9c851 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
configure: do not enable AltiVec in libvlccore
This was added ostensibly to fix compilation of the run-time AltiVec
test which was removed in bc146294cfeabde3a0c919883931c17e7c36630d.
Unfortunately, it causes the compiler to emit AltiVec instructions,
such that the executable crashes if AltiVec is not available.
Regression from e48d61955575634ef0324158cac88353e97d50b8.
- - - - -
cb303e77 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
cpu: define VLC_ALTIVEC attribute macro
Like on x86 (e.g. VLC_SSE), this macro enables the use of AltiVec for
just a given function. Thus the other functions in the same C module
can be compiled without AltiVec and run on non-AltiVec processors.
- - - - -
03d8a050 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
i420_yuy2: use VLC_ALTIVEC
- - - - -
5b7b2ff8 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
configure: remove unused ALTIVEC_CFLAGS
- - - - -
b7a7673c by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
configure: remove unused test
- - - - -
04cfde41 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
deinterlace: use VLC_ALTIVEC
- - - - -
bcbbefbf by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
deinterlace: move CPPFLAGS to Makefile
- - - - -
5a236388 by Rémi Denis-Courmont at 2022-05-19T07:11:58+00:00
configure: do not force AltiVec on everything
Fixes Debian #842513.
- - - - -
6 changed files:
- configure.ac
- include/vlc_cpu.h
- modules/video_chroma/Makefile.am
- modules/video_chroma/i420_yuy2.c
- modules/video_filter/Makefile.am
- modules/video_filter/deinterlace/merge.c
Changes:
=====================================
configure.ac
=====================================
@@ -1662,34 +1662,8 @@ AC_ARG_ENABLE([altivec],
[enable_altivec=yes], [enable_altivec=no])
])
have_altivec="no"
-ALTIVEC_CFLAGS=""
AS_IF([test "${enable_altivec}" = "yes"], [
ARCH="${ARCH} altivec";
- VLC_SAVE_FLAGS
- AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
- [ac_cv_altivec_inline],
- [AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[]],
- [[asm volatile("vperm 0,1,2,3");]])],
- [ac_cv_altivec_inline="yes"],
- [CFLAGS="${CFLAGS} -Wa,-maltivec"
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[]],
- [[asm volatile("vperm 0,1,2,3");]])],
- [ac_cv_altivec_inline="-Wa,-maltivec"],
- ac_cv_altivec_inline=no)
- ])])
- VLC_RESTORE_FLAGS
- AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
- AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
- [Define to 1 if AltiVec inline assembly is available.])
- AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
- ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
- VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
- ])
- have_altivec="yes"
- ])
-
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
[ac_cv_c_altivec], [
@@ -1704,16 +1678,10 @@ AS_IF([test "${enable_altivec}" = "yes"], [
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_altivec}" != "no"], [
- CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
- AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
- VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
- ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
- VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
have_altivec="yes"
])
AC_CHECK_HEADERS([altivec.h])
])
-AC_SUBST([ALTIVEC_CFLAGS])
AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
=====================================
include/vlc_cpu.h
=====================================
@@ -98,8 +98,10 @@ unsigned vlc_CPU_raw(void);
# ifdef ALTIVEC
# define vlc_CPU_ALTIVEC() (1)
+# define VLC_ALTIVEC
# else
# define vlc_CPU_ALTIVEC() ((vlc_CPU() & VLC_CPU_ALTIVEC) != 0)
+# define VLC_ALTIVEC __attribute__ ((__target__ ("altivec")))
# endif
# elif defined (__arm__)
=====================================
modules/video_chroma/Makefile.am
=====================================
@@ -58,7 +58,6 @@ EXTRA_LTLIBRARIES += libswscale_plugin.la
# AltiVec
libi420_yuy2_altivec_plugin_la_SOURCES = video_chroma/i420_yuy2.c video_chroma/i420_yuy2.h
libi420_yuy2_altivec_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_ALTIVEC
-libi420_yuy2_altivec_plugin_la_CFLAGS = $(AM_CFLAGS) $(ALTIVEC_CFLAGS)
if HAVE_ALTIVEC
chroma_LTLIBRARIES += \
=====================================
modules/video_chroma/i420_yuy2.c
=====================================
@@ -51,7 +51,7 @@
# define VLC_TARGET VLC_SSE
#elif defined (PLUGIN_ALTIVEC)
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422"
-# define VLC_TARGET
+# define VLC_TARGET VLC_ALTIVEC
#endif
/*****************************************************************************
=====================================
modules/video_filter/Makefile.am
=====================================
@@ -179,6 +179,9 @@ libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/yadif_x86.asm
# inline ASM doesn't build with -O0
libdeinterlace_plugin_la_CFLAGS += -O2
endif
+if HAVE_ALTIVEC
+libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_C_ALTIVEC
+endif
libdeinterlace_plugin_la_LIBADD = libdeinterlace_common.la
video_filter_LTLIBRARIES += libdeinterlace_plugin.la
=====================================
modules/video_filter/deinterlace/merge.c
=====================================
@@ -122,6 +122,7 @@ void Merge16BitSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
#endif
#ifdef CAN_COMPILE_C_ALTIVEC
+VLC_ALTIVEC
void MergeAltivec( void *_p_dest, const void *_p_s1,
const void *_p_s2, size_t i_bytes )
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/927d9cc1be94b5b94ea15e48ffbcf19142bd8adf...5a236388dea5f9e95f95204829050e89318e1d9c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/927d9cc1be94b5b94ea15e48ffbcf19142bd8adf...5a236388dea5f9e95f95204829050e89318e1d9c
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list