# LIBPNG EXTENSION: NEON # # ARM NEON (SIMD) support. # # This file contains configure.ac additions to libpng configure to enable # building of the ARM NEON filter optimizations. # 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([PNG_ARM_NEON_OPT], [0], [Disable ARM Neon optimizations]) # Prevent inclusion of the assembler files below: enable_arm_neon=no;; check) AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [], [Check for ARM Neon support at run-time]);; api) AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [], [Turn on ARM Neon optimizations at run-time]);; yes|on) AC_DEFINE([PNG_ARM_NEON_OPT], [2], [Enable ARM Neon optimizations]) AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if] [you want the optimizations unconditionally pass -mfpu=neon] [to the compiler.]);; *) 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([PNG_ARM_NEON], [test "$enable_arm_neon" != 'no' && case "$host_cpu" in arm*|aarch64*) :;; *) test "$enable_arm_neon" != '';; esac])