[Theora-dev] patch to build theora-mmx on AMD64

Dan Lenski dlenski at gmail.com
Tue May 2 23:16:16 PDT 2006


On 5/3/06, Ralph Giles <giles at xiph.org> wrote:

> > Basically all I did was to copy lib/i386 to lib/x86_64 and tweak the
> > assembler code a bit:
> > * added to each file: typedef unsigned long int ogg_uint64_t
>
> This is reasonable, since the file will only be compiled with gcc on
> x86_64. But really we should make libogg provide this type if people
> are wanting it.

Agreed.  libogg provides an ogg_int64_t, but no ogg_uint64_t for some
reason... any idea who I should talk to about getting this included?

> > A couple things that need improvement:
> > * I don't know automake/autoconf that well, so I don't know how to
> > make it automatically choose i386/x86_64 in the Makefile.  I did make
> > it so that cpu.c will choose the appropriate cpuid routine based on
> > #if defined(__x86_64__)
>
> Right. Unfortunately there needs to be more of this before I can apply
> since it breaks the x86_32 build as is. I can make the configure script
> tell the makefile which directory to compile, but for the sake of those
> using other build systems, it would really be better if it was always
> safe to compile both sets on any arch and have the inappropriate code
> #ifdef'd out.
>
> It may also make sense to add an arch to the asm functions to
> distinguish the two sets.
>
> You might also look at what ruik did in the theora-exp branch. He kept
> unified source files and just used a few conditionals to make the same
> code work on both. Perhaps that's less helpful if you're intending to
> rewrite everything to use 64 bit integers, but see for examples
>
>   http://svn.xiph.org/experimental/derf/theora-exp/lib/x86/

Yeah, in this case I think it would unfortunately muddy up the code a
lot.  It seems clearer to have arch-specific code in its own
directory.  For example, somebody might want to add AltiVec support,
and then there could be i386, x86_64, and ppc64 directories.

I'll try to get things to build correctly on any architecture ... it's
past time for me to read up on automake/autoconf anyway.

>
> Anyway, thanks for getting the ball rolling here, this has been an
> oft-requested feature.
>

And thanks to the theora devs for making this so painless.  The clean
separation of asm and C code made this really easy for me!

Dan


More information about the Theora-dev mailing list