pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/multimedia/libmpeg3 add some __attribute__((__used__))...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33c8996ed8a1
branches:  trunk
changeset: 517363:33c8996ed8a1
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Wed Aug 09 17:55:51 2006 +0000

description:
add some __attribute__((__used__)) if GCC 4.  now some static variables
only referenced in asm() are no longer not-emited.

diffstat:

 multimedia/libmpeg3/distinfo         |   7 +-
 multimedia/libmpeg3/patches/patch-af |  27 ++++++++-
 multimedia/libmpeg3/patches/patch-ah |  98 +++++++++++++++++++++++++++++++----
 multimedia/libmpeg3/patches/patch-ai |  19 ++++++
 4 files changed, 130 insertions(+), 21 deletions(-)

diffs (222 lines):

diff -r 60a04f7f0978 -r 33c8996ed8a1 multimedia/libmpeg3/distinfo
--- a/multimedia/libmpeg3/distinfo      Wed Aug 09 17:52:16 2006 +0000
+++ b/multimedia/libmpeg3/distinfo      Wed Aug 09 17:55:51 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2006/04/19 17:03:26 wiz Exp $
+$NetBSD: distinfo,v 1.10 2006/08/09 17:55:51 mrg Exp $
 
 SHA1 (libmpeg3-1.3.tar.gz) = e7e8b03ab45d5593558b0d19e31f0694cfdfa2b5
 RMD160 (libmpeg3-1.3.tar.gz) = b1751f681d26758873746aa38368150eb0a4bafd
@@ -8,6 +8,7 @@
 SHA1 (patch-ac) = 68576efb30a0d6f4cfe23fd543a04c4f3ada8936
 SHA1 (patch-ad) = 86edf9af264370bf89050b02e956b5bacc86881e
 SHA1 (patch-ae) = 5418e29f4f5c30f235cfb075d99c0022d0ad2394
-SHA1 (patch-af) = 7e62a236ee0a7398c1b1a3e994261ebb9be50bae
+SHA1 (patch-af) = 9965dda181ebc73aae4d975dc09d071036b81352
 SHA1 (patch-ag) = bf321ac689b82889ca1a2bb8a96cb6e387280f32
-SHA1 (patch-ah) = 58ffda3df9be3b089de362451ddf249a74fac5be
+SHA1 (patch-ah) = 72c4f133ef9e6f3e55144bb75766ec7988351caf
+SHA1 (patch-ai) = 5f2aeff3558ddbc28e276dd827c32ad4757f9995
diff -r 60a04f7f0978 -r 33c8996ed8a1 multimedia/libmpeg3/patches/patch-af
--- a/multimedia/libmpeg3/patches/patch-af      Wed Aug 09 17:52:16 2006 +0000
+++ b/multimedia/libmpeg3/patches/patch-af      Wed Aug 09 17:55:51 2006 +0000
@@ -1,8 +1,25 @@
-$NetBSD: patch-af,v 1.1 2004/06/26 18:00:21 grant Exp $
+$NetBSD: patch-af,v 1.2 2006/08/09 17:55:51 mrg Exp $
 
---- video/reconstruct.c.orig   Tue Jul 31 17:23:42 2001
-+++ video/reconstruct.c        Tue Jul 31 17:24:52 2001
-@@ -572,7 +572,7 @@
+--- video/reconstruct.c.orig   2001-05-19 20:05:26.000000000 -0700
++++ video/reconstruct.c        2006-08-09 10:43:50.000000000 -0700
+@@ -270,8 +270,14 @@
+ }
+ 
+ #else  // HAVE_3DNOW
+-      static long long ADD_1  =       0x0101010101010101LL;
+-      static long long MASK_AND = 0x7f7f7f7f7f7f7f7fLL;
++#if defined(__GNUC__) && __GNUC__ > 3
++#define LMUSED        __attribute__((__used__))
++#else
++#define LMUSED
++#endif
++
++      static long long ADD_1    LMUSED = 0x0101010101010101LL;
++      static long long MASK_AND LMUSED = 0x7f7f7f7f7f7f7f7fLL;
+ #endif
+ 
+ static inline void rec_mmx(unsigned char *s, unsigned char *d, int lx2, int h)
+@@ -572,7 +578,7 @@
        }
  }
  
@@ -11,7 +28,7 @@
  {
        unsigned char *dp,*sp,*sp2;
        int j;
-@@ -971,7 +971,7 @@
+@@ -971,7 +977,7 @@
                        case 0x0:       recc(s, d, lx2, h);       break;
                        case 0x7:   recva(s, d, lx, lx2, h);  break;
                        case 0x6:   recvac(s, d, lx, lx2, h); break;
diff -r 60a04f7f0978 -r 33c8996ed8a1 multimedia/libmpeg3/patches/patch-ah
--- a/multimedia/libmpeg3/patches/patch-ah      Wed Aug 09 17:52:16 2006 +0000
+++ b/multimedia/libmpeg3/patches/patch-ah      Wed Aug 09 17:55:51 2006 +0000
@@ -1,8 +1,48 @@
-$NetBSD: patch-ah,v 1.1 2004/06/26 18:00:21 grant Exp $
+$NetBSD: patch-ah,v 1.2 2006/08/09 17:55:51 mrg Exp $
 
---- video/output.c.orig        2001-05-20 13:05:26.000000000 +1000
-+++ video/output.c     2003-07-29 00:53:45.000000000 +1000
-@@ -207,50 +207,50 @@
+--- video/output.c.orig        2001-05-19 20:05:26.000000000 -0700
++++ video/output.c     2006-08-09 10:39:35.000000000 -0700
+@@ -4,23 +4,29 @@
+ 
+ #define CLIP(x)  ((x) >= 0 ? ((x) < 255 ? (x) : 255) : 0)
+ 
++#if defined(__GNUC__) && __GNUC__ > 3
++#define LMUSED        __attribute__((__used__))
++#else
++#define LMUSED
++#endif
++
+ static long long mpeg3_MMX_0 = 0L;
+-static unsigned long  mpeg3_MMX_10w[]         = {0x00100010, 0x00100010};                     /*dd    00010 0010h, 000100010h */
+-static unsigned long  mpeg3_MMX_80w[]         = {0x00800080, 0x00800080};                     /*dd    00080 0080h, 000800080h */
++static unsigned long  mpeg3_MMX_10w[]         LMUSED = {0x00100010, 0x00100010};                     /*dd    00010 0010h, 000100010h */
++static unsigned long  mpeg3_MMX_80w[]         LMUSED = {0x00800080, 0x00800080};                     /*dd    00080 0080h, 000800080h */
+ 
+-static unsigned long  mpeg3_MMX_00FFw[]       = {0x00ff00ff, 0x00ff00ff};                     /*dd    000FF 00FFh, 000FF00FFh */
++static unsigned long  mpeg3_MMX_00FFw[]       LMUSED = {0x00ff00ff, 0x00ff00ff};                     /*dd    000FF 00FFh, 000FF00FFh */
+ 
+-static unsigned short mpeg3_MMX_Ublucoeff[]   = {0x81, 0x81, 0x81, 0x81};                     /*dd    00081 0081h, 000810081h */
+-static unsigned short mpeg3_MMX_Vredcoeff[]   = {0x66, 0x66, 0x66, 0x66};                     /*dd    00066 0066h, 000660066h */
++static unsigned short mpeg3_MMX_Ublucoeff[]   LMUSED = {0x81, 0x81, 0x81, 0x81};                     /*dd    00081 0081h, 000810081h */
++static unsigned short mpeg3_MMX_Vredcoeff[]   LMUSED = {0x66, 0x66, 0x66, 0x66};                     /*dd    00066 0066h, 000660066h */
+ 
+-static unsigned short mpeg3_MMX_Ugrncoeff[]   = {0xffe8, 0xffe8, 0xffe8, 0xffe8};             /*dd    0FFE7 FFE7h, 0FFE7FFE7h */
+-static unsigned short mpeg3_MMX_Vgrncoeff[]   = {0xffcd, 0xffcd, 0xffcd, 0xffcd};             /*dd    0FFCC FFCCh, 0FFCCFFCCh */
++static unsigned short mpeg3_MMX_Ugrncoeff[]   LMUSED = {0xffe8, 0xffe8, 0xffe8, 0xffe8};             /*dd    0FFE7 FFE7h, 0FFE7FFE7h */
++static unsigned short mpeg3_MMX_Vgrncoeff[]   LMUSED = {0xffcd, 0xffcd, 0xffcd, 0xffcd};             /*dd    0FFCC FFCCh, 0FFCCFFCCh */
+ 
+-static unsigned short mpeg3_MMX_Ycoeff[]      = {0x4a, 0x4a, 0x4a, 0x4a};                     /*dd    0004A 004Ah, 0004A004Ah */
++static unsigned short mpeg3_MMX_Ycoeff[]      LMUSED = {0x4a, 0x4a, 0x4a, 0x4a};                     /*dd    0004A 004Ah, 0004A004Ah */
+ 
+-static unsigned short mpeg3_MMX_redmask[]     = {0xf800, 0xf800, 0xf800, 0xf800};             /*dd    07c00 7c00h, 07c007c00h */
++static unsigned short mpeg3_MMX_redmask[]     LMUSED = {0xf800, 0xf800, 0xf800, 0xf800};             /*dd    07c00 7c00h, 07c007c00h */
+ 
+-static unsigned short mpeg3_MMX_grnmask[]     = {0x7e0, 0x7e0, 0x7e0, 0x7e0};                 /*dd    003e0 03e0h, 003e003e0h */
++static unsigned short mpeg3_MMX_grnmask[]     LMUSED = {0x7e0, 0x7e0, 0x7e0, 0x7e0};                 /*dd    003e0 03e0h, 003e003e0h */
+ 
+ static unsigned char mpeg3_601_to_rgb[256];
+ 
+@@ -207,50 +213,50 @@
                );
  }
  
@@ -12,12 +52,12 @@
 -static long long  mpeg3_MMX_V_COEF        = 0x00000000ffea006f;
 -static long long  mpeg3_MMX_601_Y_COEF    = 0x0000004800480048;
 -static long long  mpeg3_MMX_601_Y_DIFF    = 0x0000000000000010;
-+static unsigned long long  mpeg3_MMX_U_80 = 0x0000008000800000LL;
-+static unsigned long long  mpeg3_MMX_V_80 = 0x0000000000800080LL;
-+static long long  mpeg3_MMX_U_COEF        = 0x00000058ffd30000LL;
-+static long long  mpeg3_MMX_V_COEF        = 0x00000000ffea006fLL;
-+static long long  mpeg3_MMX_601_Y_COEF    = 0x0000004800480048LL;
-+static long long  mpeg3_MMX_601_Y_DIFF    = 0x0000000000000010LL;
++static unsigned long long  mpeg3_MMX_U_80 LMUSED = 0x0000008000800000LL;
++static unsigned long long  mpeg3_MMX_V_80 LMUSED = 0x0000000000800080LL;
++static long long  mpeg3_MMX_U_COEF        LMUSED = 0x00000058ffd30000LL;
++static long long  mpeg3_MMX_V_COEF        LMUSED = 0x00000000ffea006fLL;
++static long long  mpeg3_MMX_601_Y_COEF    LMUSED = 0x0000004800480048LL;
++static long long  mpeg3_MMX_601_Y_DIFF    LMUSED = 0x0000000000000010LL;
  
  inline void mpeg3_bgra32_mmx(unsigned long y, 
                unsigned long u, 
@@ -91,7 +131,7 @@
        "
  :
  : "r" (&y), "r" (&u), "r" (&v), "r" (output));
-@@ -261,39 +261,39 @@
+@@ -261,86 +267,86 @@
                unsigned long v, 
                unsigned long *output)
  {
@@ -164,7 +204,19 @@
        "
  :
  : "r" (&y), "r" (&u), "r" (&v), "r" (output));
-@@ -309,38 +309,38 @@
+ }
+ 
+-static unsigned long long  mpeg3_MMX_U_80_RGB    = 0x0000000000800080;
+-static unsigned long long  mpeg3_MMX_V_80_RGB    = 0x0000008000800000;
+-static long long  mpeg3_MMX_U_COEF_RGB    = 0x00000000ffd30058;
+-static long long  mpeg3_MMX_V_COEF_RGB    = 0x0000006fffea0000;
++static unsigned long long  mpeg3_MMX_U_80_RGB    LMUSED = 0x0000000000800080;
++static unsigned long long  mpeg3_MMX_V_80_RGB    LMUSED = 0x0000008000800000ULL;
++static long long  mpeg3_MMX_U_COEF_RGB    LMUSED = 0x00000000ffd30058;
++static long long  mpeg3_MMX_V_COEF_RGB    LMUSED = 0x0000006fffea0000ULL;
+ 
+ inline void mpeg3_rgba32_mmx(unsigned long y, 
+               unsigned long u, 
                unsigned long v, 
                unsigned long *output)
  {
@@ -235,7 +287,7 @@
        "
  :
  : "r" (&y), "r" (&v), "r" (&u), "r" (output));
-@@ -351,39 +351,39 @@
+@@ -351,39 +357,39 @@
                unsigned long v, 
                unsigned long *output)
  {
@@ -308,3 +360,23 @@
        "
  :
  : "r" (&y), "r" (&v), "r" (&u), "r" (output));
+@@ -482,11 +488,14 @@
+       *data++ = CLIP(r_l); \
+       *data++ = 0;
+ 
+-#define STORE_PIXEL_RGB565 \
+-      *((unsigned short*)data)++ = \
+-              ((CLIP(r_l) & 0xf8) << 8) | \
+-              ((CLIP(g_l) & 0xfc) << 3) | \
+-              ((CLIP(b_l) & 0xf8) >> 3);
++#define STORE_PIXEL_RGB565 { \
++              unsigned short *sdata = (unsigned short *)data; \
++              *((unsigned short*)sdata)++ = \
++                      ((CLIP(r_l) & 0xf8) << 8) | \
++                      ((CLIP(g_l) & 0xfc) << 3) | \
++                      ((CLIP(b_l) & 0xf8) >> 3); \
++              data = (unsigned char *)sdata; \
++      }
+ 
+ #define STORE_PIXEL_RGB888 \
+       *data++ = CLIP(r_l); \
diff -r 60a04f7f0978 -r 33c8996ed8a1 multimedia/libmpeg3/patches/patch-ai
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmpeg3/patches/patch-ai      Wed Aug 09 17:55:51 2006 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-ai,v 1.1 2006/08/09 17:55:51 mrg Exp $
+
+--- video/slice.c.orig 2001-05-19 20:05:26.000000000 -0700
++++ video/slice.c      2006-08-09 10:42:13.000000000 -0700
+@@ -8,7 +8,13 @@
+ 
+ #define CLIP(x)  ((x) >= 0 ? ((x) < 255 ? (x) : 255) : 0)
+ 
+-static unsigned long long MMX_128 = 0x80008000800080LL;
++#if defined(__GNUC__) && __GNUC__ > 3
++#define LMUSED        __attribute__((__used__))
++#else
++#define LMUSED
++#endif
++
++static unsigned long long MMX_128 LMUSED = 0x80008000800080LL;
+ 
+ int mpeg3_new_slice_buffer(mpeg3_slice_buffer_t *slice_buffer)
+ {



Home | Main Index | Thread Index | Old Index