[theora] libtheora 1.1beta2 release

Vladimir Támara Patiño vtamara at pasosdeJesus.org
Wed Aug 12 22:15:11 PDT 2009


Good evening in the Lord

On Wed, Aug 12, 2009 at 10:14:03AM -0700, Ralph Giles wrote:
> I've put up a second beta for testing. libtheora-1.1beta2:

Thank you
 
>  - Builds on OpenBSD and Apple Xcode

Thank you, unfortunately it still doesn't compile on OpenBSD for amd64
(i.e 64 bits).

The same problem that I reported on 20.Jun:
http://lists.xiph.org/pipermail/theora/2009-June/002393.html

After reading the same problem in other contexts, in my humble opinion
is a problem in gcc (and gas) processing 64 bits assembler.

The solution shown in 
http://kerneltrap.org/mailarchive/git-commits-head/2008/7/15/2489294
is to use 64 bit registers instead of 32 bit (e.g rax instead of eax).

The solution proposed in 
http://bugs.opensolaris.org/view_bug.do;jsessionid=e4b608321d6778c0bc65b428d8d?bug_id=6644870
is to use hexadecimal machine code

However I think those solutions cannot be implemented easily in the
current inline assembler of libtheora which uses %[ret] instead of 
fixed registers.

After some experiments, I think there are three instructions that should 
be changed in lib/x86/mmxencfrag.c :

lea -32(%[ret],%[ret]),%[ret]
lea (%[ret],%[ret2],2),%[ret]
lea -64(%[ret2],%[ret],2),%[ret]

Could you please confirm if they could be replaced? for example with
slower sequences like:

/* Not working "lea -32(%[ret],%[ret]),%[ret]\n\t" */
/* Like ret = ret + ret - 32 */
	"add %[ret],%[ret]\n\t"
	"sub 32,%[ret]\n\t"

/* Not working "lea (%[ret],%[ret2],2),%[ret]\n\t" */
/* Like ret = ret2*2 + ret */
    "mov %[ret2], %%eax\n\t"
    "add %%eax, %%eax\n\t"
    "add %%eax, %[ret]\n\t"


/* Not working "lea -64(%[ret2],%[ret],2),%[ret]\n\t" */
/* Like ret = ret*2 + ret2 - 64 */
    "mov %[ret], %%eax\n\t"
    "add %%eax, %%eax\n\t"
    "add %[ret2], %%eax\n\t"
    "sub 64, %%eax\n\t"
    "mov %%eax, %[ret]\n\t"

The last two use EAX. Could they be replaced without using a fixed 
register? 
 I tried to inform gcc the change of eax by adding at the end of the
inline assembler 
	: "cc", "%eax" 
as described in
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
however in that case it complains with 
mmxencfrag.c:457: error: can't find a register in class `AREG' while
reloading `asm'

Removing that allows the compilation, 3 of the 9 regression tests
fail, but I could see a video (fastest clapper for firefox).

Best regards. God bless us.
-- 
Dios, gracias por tu amor infinito.
http://www.primarilypublicdomain.org/letter/
--  
  Vladimir Támara Patiño.  
  http://www.geocities.com/v-tamara



More information about the theora mailing list