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

[Opendivx] x86 assembler portability



> Von: Gunter Ohrner <[email protected]>
.....
> Today I found a tool called intel2gas which automatically converts
> Intel-style assembler code into the AT&T-syntax. It even does handle MSVC
> inline assembly sections in c-files. The translation looks usuable
although
> not directly compilable. intel2gas does not not seem to recognize
> C-variable names within the inline assembler code and precedes them with a
> "%" and it can't convert "byte ptr [some_register]" constructs.
> But maybe it's a start for automatic generation of the linux source files.

It sounds like this is almost working and that intel2gas would not need much
modification to work with our code.  I mailed the main author of intel2gas
asking what would need to be done to make it work with our code.  It would
even be worth changing our code slightly if that meant we only had to
maintain one codebase for all x86 optimisations.

For the C-variable names, intel2gas would have to replace the C names by %0,
%1, %2 ...etc. and then reference them as appropriate in the
clobbered/input/output part.  I'm sure it shouldn't be too hard to handle
the "byte ptr [some_register]" constructs.  If intel2gas could do this then
everyone would be very happy.  There's going to be a LOT of new MME, SSE and
other processor-specific stuff here eventually.  And, most likely it will be
available first as Intel-syntax inline C.

On a different note, I just discovered that the demo Intel compiler can be
run from Linux.  Install it on a Windows partition ('98 in my case).  Then
use wine in Linux to run Intel's compiler: "wine icl.exe /c file.c".  This
will make "file.obj".  You can convert this to "file.o" (elf format) by
using objcopy [you may have to recompile binutils first, enabling pe-i386
support].  "file.o" can then be linked into your Linux library or
application.

The above is a real bitch to set up, and compiles are slow, but you can
automate with 'make'.  Both decore and encore build perfectly.  (This was
using M$'s cl.exe by the same trick).  Perhaps in our makefile/configure
setup for encore and decore we could have an option for people who have the
capability to do "wine (i)cl.exe".

The Intel compiler is on a 30-day demo, so unless you can spare the cash it
may be of limited use but it is very good.  Comparable to pgcc ;-).
Apparently, there's a native-Linux C++ compiler from Intel available soon.
I doubt somehow that this will be free :-(

John




_______________________________________________
Opendivx mailing list
[email protected]
http://lists.projectmayo.com/mailman/listinfo/opendivx


Reply To Poster

Local References / HOW-TO / FAQs