[Theora-dev] MMX/mmxext optimisations

Ivan pin at medic.chalmers.se
Tue Aug 24 06:05:43 PDT 2004


On Tue, Aug 24, 2004 at 02:32:35PM +0200, Ivan wrote:
> > gcc 3.4.1 does not like static constants in
> > i386/fdct_mmx.c and
> > i386/dsp_mmx.c

Found the reason, since 3.4 gcc optimizes away unused static variables.

Attaching the patch which makes it compile and link as supposed.

(decoder is still broken)

Regards,
--
Ivan
-------------- next part --------------
--- lib/i386/dsp_mmx.c.ori	2004-08-24 14:56:45.000000000 +0200
+++ lib/i386/dsp_mmx.c	2004-08-24 14:57:09.000000000 +0200
@@ -18,7 +18,7 @@
 #include <stdlib.h>
 #include "dsp.h"
 
-static const __attribute__ ((aligned(8))) ogg_int64_t V128 = 0x0080008000800080LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x0080008000800080LL;
 
 #if defined(__MINGW32__) || defined(__CYGWIN__) || \
     defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
--- lib/i386/fdct_mmx.c.ori	2004-08-24 14:55:26.000000000 +0200
+++ lib/i386/fdct_mmx.c	2004-08-24 14:56:14.000000000 +0200
@@ -12,13 +12,13 @@
 #include <theora/theora.h>
 #include "dsp.h"
 
-static const __attribute__ ((aligned(8))) ogg_int64_t xC1S7 = 0x0fb15fb15fb15fb15LL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC2S6 = 0x0ec83ec83ec83ec83LL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC3S5 = 0x0d4dbd4dbd4dbd4dbLL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC4S4 = 0x0b505b505b505b505LL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC5S3 = 0x08e3a8e3a8e3a8e3aLL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC6S2 = 0x061f861f861f861f8LL;
-static const __attribute__ ((aligned(8))) ogg_int64_t xC7S1 = 0x031f131f131f131f1LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC1S7 = 0x0fb15fb15fb15fb15LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC2S6 = 0x0ec83ec83ec83ec83LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC3S5 = 0x0d4dbd4dbd4dbd4dbLL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC4S4 = 0x0b505b505b505b505LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC5S3 = 0x08e3a8e3a8e3a8e3aLL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC6S2 = 0x061f861f861f861f8LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t xC7S1 = 0x031f131f131f131f1LL;
 
 #if defined(__MINGW32__) || defined(__CYGWIN__) || \
     defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
--- lib/i386/recon_mmx.c.ori	2004-08-24 14:57:26.000000000 +0200
+++ lib/i386/recon_mmx.c	2004-08-24 14:57:38.000000000 +0200
@@ -17,7 +17,7 @@
 
 #include "encoder_internal.h"
 
-static const __attribute__ ((aligned(8))) ogg_int64_t V128 = 0x8080808080808080LL;
+static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x8080808080808080LL;
 
 #if defined(__MINGW32__) || defined(__CYGWIN__) || \
 	    defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))


More information about the Theora-dev mailing list