summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2013-04-24 00:07:59 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2013-04-24 00:07:59 -0500
commite0f4aaa6688b84d477a6e76f7aaf99fd5e199b84 (patch)
tree3ba2cc70781c8a1af22af0e0c5160688bf92c4d7
parent3de174cd2f813434788b4739d9f2f9a476bd23dc (diff)
downloadlibpng-e0f4aaa6688b84d477a6e76f7aaf99fd5e199b84.tar.gz
[libpng17] Attempt to fix the arm-neon configuration mess.
-rw-r--r--ANNOUNCE1
-rw-r--r--CHANGES1
-rw-r--r--arm/arm_init.c4
-rw-r--r--arm/filter_neon.S9
-rw-r--r--configure.ac31
5 files changed, 31 insertions, 15 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index e3e197c7f..825b98ccb 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -263,6 +263,7 @@ Version 1.7.0beta09 [April 24, 2013]
was switched 'off' as opposed to being explicitly disabled.
Version 1.7.0beta10 [April 24, 2013]
+ Attempt to fix the PNG_ARM_NEON mess.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index 9e42b0877..294db5753 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4551,6 +4551,7 @@ Version 1.7.0beta09 [April 24, 2013]
was switched 'off' as opposed to being explicitly disabled.
Version 1.7.0beta10 [April 24, 2013]
+ Attempt to fix the PNG_ARM_NEON mess.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/arm/arm_init.c b/arm/arm_init.c
index 795dd4938..986840843 100644
--- a/arm/arm_init.c
+++ b/arm/arm_init.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.5.15 [March 28, 2013]
+ * Last changed in libpng 1.7.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -216,4 +216,4 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
png_read_filter_row_paeth4_neon;
}
}
-#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */
+#endif /* PNG_ARM_NEON_SUPPORTED */
diff --git a/arm/filter_neon.S b/arm/filter_neon.S
index c4946b171..c226cd4a8 100644
--- a/arm/filter_neon.S
+++ b/arm/filter_neon.S
@@ -3,7 +3,7 @@
*
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.2 [(PENDING RELEASE)]
+ * Last changed in libpng 1.7.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -11,7 +11,7 @@
*/
/* This is required to get the symbol renames, which are #defines, and also
- * includes the value of PNG_FILTER_OPTIMIZATIONS.
+ * includes the definition (or not) of PNG_ARM_NEON_SUPPORTED.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
@@ -20,8 +20,7 @@
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
#endif
-#if defined(PNG_FILTER_OPTIMIZATIONS) && defined(__arm__) && \
- defined(__ARM_NEON__)
+#ifdef PNG_ARM_NEON_SUPPORTED
#ifdef __ELF__
# define ELF
@@ -233,4 +232,4 @@ func png_read_filter_row_paeth3_neon, export=1
pop {r4,pc}
endfunc
-#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */
+#endif /* PNG_ARM_NEON_SUPPORTED */
diff --git a/configure.ac b/configure.ac
index cb63da906..ff146bb2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,19 +334,26 @@ AC_ARG_WITH(libpng-prefix,
fi])
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
+# HOST SPECIFIC OPTIONS
+# =====================
+#
+# ARM
+# ===
+#
+# ARM NEON (SIMD) support.
+
AC_ARG_ENABLE([arm-neon],
AS_HELP_STRING([[[--enable-arm-neon]]],
- [Enable ARM NEON optimizations: =off, check, api, on:]
- [off: disable the optimizations; check: use internal checking code]
+ [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; on: turn on unconditionally. The]
- [default is 'on' if __ARM_NEON__ is defined, otherwise 'off'.]),
+ [a call to png_set_option; yes/on: turn on unconditionally.]),
[case "$enableval" in
no|off)
# disable the default enabling on __ARM_NEON__ systems:
AC_DEFINE([PNG_NO_ARM_NEON], [],
[Disable ARM Neon optimizations])
- # Prevent use of the assembler files below:
+ # Prevent inclusion of the assembler files below:
enable_arm_neon=no;;
check)
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
@@ -354,13 +361,21 @@ AC_ARG_ENABLE([arm-neon],
api)
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
[Turn on ARM Neon optimizations at run-time]);;
- on)
+ yes|on)
AC_DEFINE([PNG_ARM_NEON_SUPPORTED], [],
[Enable ARM Neon optimizations]);;
*)
- AC_MSG_ERROR([arm-neon: option value required (off/check/api/on)]);;
+ AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
esac])
-AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" != "no"])
+
+# If enable/disable was not specified default to using the optimizations if the
+# host CPU is ARM and the comppiler is targeting a NEON host. The latter test
+# is done in scripts/pnglibconf.dfa by checking for __ARM_NEON__. The
+# AM_CONDITIONAL below controls whether the ARM NEON source files are built.
+
+AM_CONDITIONAL([PNG_ARM_NEON],
+ [test "$enable_arm_neon" != 'no' &&
+ test "$host_cpu" = 'arm' -o "$enable_arm_neon" != ''])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])