[theora-dev] Blog post about Theora and MSVC assembly

Nils Pipenbrinck n.pipenbrinck at cubic.org
Fri Dec 21 15:44:30 PST 2007


Hi Ralph,
>>  merge two different compiler extensions back to a unified codebase.
>>     
>
> This is certainly an annoying point, but I'm not sure how making 
> everyone use a different assembler is better. It still doesn't
> build out of the box under Visual Studio.
>   

There is another, completely out of the box working and more or less 
compiler/OS independet way to get SIMD for everyone:

We could lend techniques from the dynamic code generation guys: Store 
the meta code in our own format (must not contain any dynamic things, 
just our own representation of assembly) and convert/compile them to a 
function in executable memory on library startup.

This is simpler than you expect. I've did that more than once, for 
multiple platforms, and it was my solution of choice for certain 
problems. Not for problems where the added complexity of the build 
process is the motivation though.

Anyways, here are the pros and cons:

Pros:

 * Works out of the box.
 * Does not need external tools
 * When done right it it can be cross-platform. Eg. translating to WMMX 
on ARM or MaDMaX on MIPS. Altivec on PPC, maybe even to DSPs like the 
Blackfin or the TMS320C6x TI could be done.  After all - most SIMD that 
exist in modern processors is a superset of what the x86 architecture 
offers.
 * No runtime overhead. Initial compilation-time on library startup is 
neglible.

Cons:

 * Doing things in a prohibigtary format turns people away from 
contributing.
 * introduces a layer of abstraction that is not nessesary.
 * introduces operation system dependent stuff because you have to 
allocate executable memory in some way.

> But, this is open source, you can always lead by example. :)
>   
The open source scene is very different to the kind of "customers" I 
usually have to deal with. Therefore I'd like to see some success 
stories from other projects that faced the same problem. I'm not much of 
an open source guy also I'd like to contribute.

Yet another idea:

Just an uneducated guess: 90% of the folks that use theorea will use 
win32 or linux. Why not simply supply preassembled object files for 
win32 and linux along with the nasm soucecode that build out of the box. 
Those who want a build from scratch can install NASM, but noone is 
forced to.

---
Nils


More information about the theora-dev mailing list