From 79842704531a5f148e921055a7eefd3cc76a189f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Kovac=CC=8C?= Date: Tue, 5 Jul 2022 19:43:11 +0200 Subject: [PATCH] Split hardware optimization flags --- configure.ac | 29 ++++++++----- windows/configure.ac | 101 +++++++------------------------------------ 2 files changed, 33 insertions(+), 97 deletions(-) diff --git a/configure.ac b/configure.ac index 60828d9e..f740be12 100644 --- a/configure.ac +++ b/configure.ac @@ -92,18 +92,23 @@ case "$host_cpu" in ;; esac -AC_ARG_ENABLE([hardware-optimizations], - AS_HELP_STRING([[[--disable-hardware-optimizations]]], - [Disable hardware optimizations (Intel SSE2 / ARM NEON)]), - [ - # disable hardware optimization on all systems: - enable_arm_neon=no - AC_DEFINE([ARM_NEON], [0], - [Disable ARM_NEON optimizations]) - enable_intel_sse=no - AC_DEFINE([INTEL_SSE], [0], - [Disable INTEL_SSE optimizations]) - ]) +AC_ARG_ENABLE([neon], + AS_HELP_STRING([[[--disable-neon]]], + [Disable ARM NEON hardware optimizations]), + [ + enable_arm_neon=no + AC_DEFINE([ARM_NEON], [0], + [Disable ARM_NEON optimizations]) + ]) + +AC_ARG_ENABLE([sse2], + AS_HELP_STRING([[[--disable-sse2]]], + [Disable Intel SSE2 hardware optimizations]), + [ + enable_intel_sse=no + AC_DEFINE([INTEL_SSE], [0], + [Disable INTEL_SSE optimizations]) + ]) SIMDFLAGS="" diff --git a/windows/configure.ac b/windows/configure.ac index d6164618..d19cd967 100644 --- a/windows/configure.ac +++ b/windows/configure.ac @@ -92,92 +92,23 @@ case "$host_cpu" in ;; esac -AC_ARG_ENABLE([hardware-optimizations], - AS_HELP_STRING([[[--disable-hardware-optimizations]]], - [Disable hardware optimizations (Intel SSE2 / ARM NEON)]), - [ - # disable hardware optimization on all systems: - enable_arm_neon=no - AC_DEFINE([ARM_NEON], [0], - [Disable ARM_NEON optimizations]) - enable_intel_sse=no - AC_DEFINE([INTEL_SSE], [0], - [Disable INTEL_SSE optimizations]) - ]) +AC_ARG_ENABLE([neon], + AS_HELP_STRING([[[--disable-neon]]], + [Disable ARM NEON hardware optimizations]), + [ + enable_arm_neon=no + AC_DEFINE([ARM_NEON], [0], + [Disable ARM_NEON optimizations]) + ]) -# INTEL -# ===== -# -# INTEL SSE (SIMD) support. - -AC_ARG_ENABLE([intel-sse], - AS_HELP_STRING([[[--enable-intel-sse]]], - [Enable Intel SSE optimizations: =no/off, yes/on:] - [no/off: disable the optimizations;] - [yes/on: enable the optimizations.] - [If not specified: determined by the compiler.]), - [case "$enableval" in - no|off) - # disable the default enabling: - AC_DEFINE([INTEL_SSE], [0], - [Disable Intel SSE optimizations]) - # Prevent inclusion of the assembler files below: - enable_intel_sse=no;; - yes|on) - enable_intel_sse=yes - AC_DEFINE([INTEL_SSE], [1], - [Enable Intel SSE optimizations]);; - *) - AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value]) - esac]) - -# Add Intel specific files to all builds where the host_cpu is Intel ('x86*') -# or where Intel optimizations were explicitly requested (this allows a -# fallback if a future host CPU does not match 'x86*') -AM_CONDITIONAL([INTEL_SSE], - [test "$enable_intel_sse" != 'no' && - case "$host_cpu" in - i?86|x86_64) :;; - *) test "$enable_intel_sse" != '';; - esac]) - -# ARM -# === -# -# ARM NEON (SIMD) support. - -AC_ARG_ENABLE([arm-neon], - AS_HELP_STRING([[[--enable-arm-neon]]], - [Enable ARM NEON optimizations: =no/off, check, api, yes/on:] - [no/off: disable the optimizations; check: use internal checking code] - [(deprecated and poorly supported); api: disable by default, enable by] - [a call to png_set_option; yes/on: turn on unconditionally.] - [If not specified: determined by the compiler.]), - [case "$enableval" in - no|off) - # disable the default enabling on __ARM_NEON__ systems: - AC_DEFINE([ARM_NEON], [0], - [Disable ARM Neon optimizations]) - # Prevent inclusion of the assembler files below: - enable_arm_neon=no;; - yes|on) - enable_arm_neon=yes - AC_DEFINE([ARM_NEON], [1], - [Enable ARM Neon optimizations]);; - *) - AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value]) - esac]) - -# Add ARM specific files to all builds where the host_cpu is arm ('arm*') or -# where ARM optimizations were explicitly requested (this allows a fallback if a -# future host CPU does not match 'arm*') - -AM_CONDITIONAL([ARM_NEON], - [test "$enable_arm_neon" != 'no' && - case "$host_cpu" in - arm*|aarch64*) :;; - *) test "$enable_arm_neon" != '';; - esac]) +AC_ARG_ENABLE([sse2], + AS_HELP_STRING([[[--disable-sse2]]], + [Disable Intel SSE2 hardware optimizations]), + [ + enable_intel_sse=no + AC_DEFINE([INTEL_SSE], [0], + [Disable INTEL_SSE optimizations]) + ]) SIMDFLAGS=""