134 * presence or not of -mfpu=neon on the GCC command line, it is possible to do
135 * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely
136 * do this.
137 */
138 #ifndef PNG_ARM_NEON_OPT
139 /* ARM NEON optimizations are being controlled by the compiler settings,
140 * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon
141 * with GCC) then the compiler will define __ARM_NEON__ and we can rely
142 * unconditionally on NEON instructions not crashing, otherwise we must
143 * disable use of NEON instructions.
144 *
145 * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they
146 * can only be turned on automatically if that is supported too. If
147 * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail
148 * to compile with an appropriate #error if ALIGNED_MEMORY has been turned
149 * off.
150 *
151 * Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we
152 * check both variants.
153 */
154 # if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
155 defined(PNG_ALIGNED_MEMORY_SUPPORTED)
156 # define PNG_ARM_NEON_OPT 2
157 # else
158 # define PNG_ARM_NEON_OPT 0
159 # endif
160 #endif
161
162 #if PNG_ARM_NEON_OPT > 0
163 /* NEON optimizations are to be at least considered by libpng, so enable the
164 * callbacks to do this.
165 */
166 # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
167
168 /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
169 * if possible - if __ARM_NEON__ is set and the compiler version is not known
170 * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
171 * be:
172 *
173 * 1 The intrinsics code (the default with __ARM_NEON__)
174 * 2 The hand coded assembler (the default without __ARM_NEON__)
175 *
|
134 * presence or not of -mfpu=neon on the GCC command line, it is possible to do
135 * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely
136 * do this.
137 */
138 #ifndef PNG_ARM_NEON_OPT
139 /* ARM NEON optimizations are being controlled by the compiler settings,
140 * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon
141 * with GCC) then the compiler will define __ARM_NEON__ and we can rely
142 * unconditionally on NEON instructions not crashing, otherwise we must
143 * disable use of NEON instructions.
144 *
145 * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they
146 * can only be turned on automatically if that is supported too. If
147 * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail
148 * to compile with an appropriate #error if ALIGNED_MEMORY has been turned
149 * off.
150 *
151 * Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we
152 * check both variants.
153 */
154 # if ((defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
155 defined(PNG_ALIGNED_MEMORY_SUPPORTED) && defined(__arm__))
156 # define PNG_ARM_NEON_OPT 2
157 # else
158 # define PNG_ARM_NEON_OPT 0
159 # endif
160 #endif
161
162 #if PNG_ARM_NEON_OPT > 0
163 /* NEON optimizations are to be at least considered by libpng, so enable the
164 * callbacks to do this.
165 */
166 # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
167
168 /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
169 * if possible - if __ARM_NEON__ is set and the compiler version is not known
170 * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
171 * be:
172 *
173 * 1 The intrinsics code (the default with __ARM_NEON__)
174 * 2 The hand coded assembler (the default without __ARM_NEON__)
175 *
|