pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/56108



The following reply was made to PR pkg/56108; it has been noted by GNATS.

From: Onno van der Linden <o.vd.linden%quicknet.nl@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/56108
Date: Fri, 16 Apr 2021 13:50:26 +0200

 https://bugzilla.mozilla.org/show_bug.cgi?id=1700520
 
 and
 
 https://phabricator.services.mozilla.com/D109789
 
 lead to the patch below with which I managed to compile
 firefox 87.0 ony my 2G memory i386 box
 
 Onno
 
 
 --- a/gfx/wr/swgl/src/blend.h
 +++ b/gfx/wr/swgl/src/blend.h
 @@ -400,17 +400,17 @@ static ALWAYS_INLINE void override_aa() 
  }
  
  // Restores anti-aliasing to the blend stage, assuming it was previously
  // overridden.
  static ALWAYS_INLINE void restore_aa() {
    blend_key = BlendKey(AA_BLEND_KEY_NONE + blend_key);
  }
  
 -static ALWAYS_INLINE WideRGBA8 blend_pixels(uint32_t* buf, PackedRGBA8 pdst,
 +static PREFER_INLINE WideRGBA8 blend_pixels(uint32_t* buf, PackedRGBA8 pdst,
                                              WideRGBA8 src, int span = 4) {
    WideRGBA8 dst = unpack(pdst);
    const WideRGBA8 RGB_MASK = {0xFFFF, 0xFFFF, 0xFFFF, 0,      0xFFFF, 0xFFFF,
                                0xFFFF, 0,      0xFFFF, 0xFFFF, 0xFFFF, 0,
                                0xFFFF, 0xFFFF, 0xFFFF, 0};
    const WideRGBA8 ALPHA_MASK = {0, 0, 0, 0xFFFF, 0, 0, 0, 0xFFFF,
                                  0, 0, 0, 0xFFFF, 0, 0, 0, 0xFFFF};
    const WideRGBA8 ALPHA_OPAQUE = {0, 0, 0, 255, 0, 0, 0, 255,
 @@ -681,17 +681,17 @@ static ALWAYS_INLINE WideRGBA8 blend_pix
      // return src;
    }
  
  #undef BLEND_CASE
  #undef BLEND_CASE_KEY
    // clang-format on
  }
  
 -static ALWAYS_INLINE WideR8 blend_pixels(uint8_t* buf, WideR8 dst, WideR8 src,
 +static PREFER_INLINE WideR8 blend_pixels(uint8_t* buf, WideR8 dst, WideR8 src,
                                           int span = 4) {
  // clang-format off
  #define BLEND_CASE_KEY(key)                          \
    case AA_##key:                                     \
      DO_AA(R8, src = muldiv256(src, aa));             \
      goto key;                                        \
    case AA_MASK_##key:                                \
      DO_AA(R8, src = muldiv256(src, aa));             \
 
 --- a/gfx/wr/swgl/src/gl.cc
 +++ b/gfx/wr/swgl/src/gl.cc
 @@ -53,20 +53,34 @@ typedef union _LARGE_INTEGER {
  extern "C" {
  WINBASEAPI BOOL WINAPI
  QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount);
  
  WINBASEAPI BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER* lpFrequency);
  }
  
  #else
 -#  define ALWAYS_INLINE __attribute__((always_inline)) inline
 +// GCC is slower when dealing with always_inline, especially in debug builds.
 +// When using Clang, use always_inline more aggressively.
 +#  if defined(__clang__) || defined(NDEBUG)
 +#    define ALWAYS_INLINE __attribute__((always_inline)) inline
 +#  else
 +#    define ALWAYS_INLINE inline
 +#  endif
  #  define NO_INLINE __attribute__((noinline))
  #endif
  
 +// Some functions may cause excessive binary bloat if inlined in debug or with
 +// GCC builds, so use PREFER_INLINE on these instead of ALWAYS_INLINE.
 +#if defined(__clang__) && defined(NDEBUG)
 +#  define PREFER_INLINE ALWAYS_INLINE
 +#else
 +#  define PREFER_INLINE inline
 +#endif
 +
  #define UNREACHABLE __builtin_unreachable()
  
  #define UNUSED [[maybe_unused]]
  
  #define FALLTHROUGH [[fallthrough]]
  
  #ifdef MOZILLA_CLIENT
  #  define IMPLICIT __attribute__((annotate("moz_implicit")))
 


Home | Main Index | Thread Index | Old Index