Skip to content

Commit e4a31f0

Browse files
committed
arm: Add a placeholder file in lieu of the former filter_neon.S
In the previous commit 9e53875 we removed the obsolete assembler implementation `filter_neon.S`. In this commit we add a stand-in for the original file, restoring the original source tree structure, for the benefit of continuing hassle-free libpng source upgrades in the 1.6.x line.
1 parent 9e53875 commit e4a31f0

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

arm/filter_neon.S

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
/* filter_neon.S - placeholder file
3+
*
4+
* Copyright (c) 2024 Cosmin Truta
5+
*
6+
* This code is released under the libpng license.
7+
* For conditions of distribution and use, see the disclaimer
8+
* and license in png.h
9+
*/
10+
11+
/* IMPORTANT NOTE:
12+
*
13+
* Historically, the hand-coded assembler implementation of Neon optimizations
14+
* in this module had not been in sync with the intrinsics-based implementation
15+
* in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
16+
* the introduction of riffled palette optimizations. Moreover, the assembler
17+
* code used to work on 32-bit ARM only, and it caused problems, even if empty,
18+
* on 64-bit ARM.
19+
*
20+
* All references to this module from our internal build scripts and projects
21+
* have been removed.
22+
*
23+
* For the external projects that might still expect this module to be present,
24+
* we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
25+
* Everything should continue to function normally, as long as there are no
26+
* deliberate attempts to use the old hand-made assembler code. A build error
27+
* will be raised otherwise.
28+
*/
29+
30+
/* This is required to get the symbol renames, which are #defines, and the
31+
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
32+
*/
33+
#define PNG_VERSION_INFO_ONLY
34+
#include "../pngpriv.h"
35+
36+
#ifdef PNG_READ_SUPPORTED
37+
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
38+
#if PNG_ARM_NEON_OPT > 0
39+
40+
#if defined(__clang__)
41+
#define GNUC_VERSION 0 /* not gcc, although it might pretend to be */
42+
#elif defined(__GNUC__)
43+
#define GNUC_MAJOR (__GNUC__ + 0)
44+
#define GNUC_MINOR (__GNUC_MINOR__ + 0)
45+
#define GNUC_PATCHLEVEL (__GNUC_PATCHLEVEL__ + 0)
46+
#define GNUC_VERSION (GNUC_MAJOR * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL)
47+
#else
48+
#define GNUC_VERSION 0 /* not gcc */
49+
#endif
50+
51+
#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
52+
#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
53+
#elif GNUC_VERSION == 40504
54+
#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
55+
#else
56+
#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
57+
#endif
58+
59+
#endif /* PNG_ARM_NEON_OPT > 0 */
60+
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
61+
#endif /* READ */

0 commit comments

Comments
 (0)