tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

filter_neon.S (2369B)


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