Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all assembler #452

Merged
merged 2 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ EXTRA_DIST = \
autogen.sh \
config.rpath \
depcomp \
ltmain.sh \
strip_non_asm_libtool_args.sh
ltmain.sh

DISTCHECK_CONFIGURE_FLAGS = '--disable-version-from-git'

Expand Down
3 changes: 0 additions & 3 deletions config.cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
/* define if you have docbook-to-man or docbook2man */
#cmakedefine FLAC__HAS_DOCBOOK_TO_MAN

/* define if you are compiling for x86 and have the NASM assembler */
#cmakedefine FLAC__HAS_NASM

/* define if you have the ogg library */
#cmakedefine01 OGG_FOUND
#define FLAC__HAS_OGG OGG_FOUND
Expand Down
9 changes: 0 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,6 @@ AC_CHECK_LIB(rt, clock_gettime,
AH_TEMPLATE(HAVE_CLOCK_GETTIME, [define if you have clock_gettime]))
AC_SUBST(LIB_CLOCK_GETTIME)

# only matters for x86
AC_CHECK_PROGS(NASM, nasm)
AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
if test -n "$NASM" ; then
AC_DEFINE(FLAC__HAS_NASM)
AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
fi

dnl If debugging is disabled AND no CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
dnl are provided, we can set defaults to our liking
AS_IF([test "x${ax_enable_debug}" = "xno" && test "x${enable_flags_setting}" = "xyes"], [
Expand Down Expand Up @@ -618,7 +610,6 @@ AC_CONFIG_FILES([ \
src/Makefile \
src/libFLAC/Makefile \
src/libFLAC/flac.pc \
src/libFLAC/ia32/Makefile \
src/libFLAC/include/Makefile \
src/libFLAC/include/private/Makefile \
src/libFLAC/include/protected/Makefile \
Expand Down
12 changes: 0 additions & 12 deletions src/libFLAC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,11 @@ else()
endif()
endif()


include(CheckLanguage)
check_language(ASM_NASM)
if(CMAKE_ASM_NASM_COMPILER)
enable_language(ASM_NASM)
add_definitions(-DFLAC__HAS_NASM)
endif()

if(NOT WITH_ASM)
add_definitions(-DFLAC__NO_ASM)
endif()

if(FLAC__CPU_IA32)
if(WITH_ASM AND CMAKE_ASM_NASM_COMPILER)
add_subdirectory(ia32)
endif()

option(WITH_SSE "Enable SSE2 optimizations (WITHOUT runtime detection, resulting binary requires SSE2)" ON)
check_c_compiler_flag(-msse2 HAVE_MSSE2_FLAG)
if(WITH_SSE)
Expand Down
17 changes: 3 additions & 14 deletions src/libFLAC/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,9 @@ endif

AM_CFLAGS = $(DEBUGCFLAGS) $(CPUCFLAGS) @OGG_CFLAGS@

if FLaC__NO_ASM
else
if FLaC__CPU_IA32
if FLaC__HAS_NASM
ARCH_SUBDIRS = ia32
LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la
endif
endif
endif

libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
libFLAC_la_LIBADD = @OGG_LIBS@ -lm

SUBDIRS = $(ARCH_SUBDIRS) include .
SUBDIRS = include .

m4datadir = $(datadir)/aclocal
m4data_DATA = libFLAC.m4
Expand Down Expand Up @@ -93,7 +83,7 @@ extra_ogg_sources = \
endif

# see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 12:0:0 $(LOCAL_EXTRA_LDFLAGS)
libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 12:0:0

libFLAC_sources = \
bitmath.c \
Expand Down Expand Up @@ -130,5 +120,4 @@ libFLAC_sources = \
libFLAC_la_SOURCES = $(libFLAC_sources)

# needed for test_libFLAC
libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD)
libFLAC_static_la_SOURCES = $(libFLAC_sources)
9 changes: 2 additions & 7 deletions src/libFLAC/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include <sys/auxv.h>
#endif

#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM

/* these are flags in EDX of CPUID AX=00000001 */
static const uint32_t FLAC__CPUINFO_X86_CPUID_CMOV = 0x00008000;
Expand Down Expand Up @@ -97,8 +97,6 @@ cpu_have_cpuid(void)
#if defined FLAC__CPU_X86_64 || defined __i686__ || defined __SSE__ || (defined _M_IX86_FP && _M_IX86_FP > 0)
/* target CPU does have CPUID instruction */
return 1;
#elif defined FLAC__HAS_NASM
return FLAC__cpu_have_cpuid_asm_ia32();
#elif defined __GNUC__ && defined HAVE_CPUID_H
if (__get_cpuid_max(0, 0) != 0)
return 1;
Expand Down Expand Up @@ -151,9 +149,6 @@ cpuinfo_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint
__cpuid_count(level, 0, *eax, *ebx, *ecx, *edx);
return;
}
#elif defined FLAC__HAS_NASM && defined FLAC__CPU_IA32
FLAC__cpu_info_asm_ia32(level, eax, ebx, ecx, edx);
return;
#endif
*eax = *ebx = *ecx = *edx = 0;
}
Expand All @@ -163,7 +158,7 @@ cpuinfo_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint
static void
x86_cpu_info (FLAC__CPUInfo *info)
{
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM
FLAC__bool x86_osxsave = false;
FLAC__bool os_avx = false;
FLAC__uint32 flags_eax, flags_ebx, flags_ecx, flags_edx;
Expand Down
17 changes: 0 additions & 17 deletions src/libFLAC/ia32/CMakeLists.txt

This file was deleted.

46 changes: 0 additions & 46 deletions src/libFLAC/ia32/Makefile.am

This file was deleted.

119 changes: 0 additions & 119 deletions src/libFLAC/ia32/cpu_asm.nasm

This file was deleted.