[Gridflow-dev] MMX -vs- 64-bit
Claude Heiland-Allen
claudiusmaximus at goto10.org
Mon Aug 9 07:28:54 EDT 2010
Hi,
I just tried to configure 9.10 and SVN trunk and ran into some 64-bit
compatibility issue, so I investigated a bit (64-bit ABI is rather
different to 32-bit, it seems...). In short, I think it might be better
to switch to 'orc'[1] or something like it, than to maintain custom asm
code generators. Though, 'liboil'[2] was around for 'only' 6 years or so..
[1] http://code.entropywave.com/projects/orc/
[2]
http://cgit.freedesktop.org/liboil/commit/?id=04b154aa118c0fdf244932dadc3d085f6290db7a
Claude
$ uname -a
Linux zebimus 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC
2010 x86_64 GNU/Linux
$ cat config.log | ...
...
[mmx] MMX-compatible CPU (using NASM):
...
/usr/bin/env nasm tmp/21101.asm -f elf -o tmp/21101.o
g++ -o tmp/21101 tmp/21101.o -lc
/usr/bin/ld: i386 architecture of input file `tmp/21101.o' is
incompatible with i386:x86-64 output
collect2: ld returned 1 exit status
error #256
---------------------------------------> missing (return false)
$ nasm -hf
...
valid output formats for -f are (`*' denotes default):
...
elf32 ELF32 (i386) object files (e.g. Linux)
elf ELF (short name for ELF32)
elf64 ELF64 (x86_64) object files (e.g. Linux)
...
$ $ nasm 90210.asm -f elf64 -o 90210.o
90210.asm:15: error: instruction not supported in 64-bit mode
90210.asm:18: error: instruction not supported in 64-bit mode
$ cat -n 90210.asm | ...
15 push long 1
18 push long 0
$ sed 's|push long|mov edi,|' -i 90210.asm
$ nasm 90210.asm -f elf64 -o 90210.o
$ g++ -o 90210 90210.o -lc
$ ./90210 && echo "success" || echo "failure"
success
$ ./configure --force-mmx
...
$ make
...
nasm -f elf src/mmx.asm -o src/mmx.o
...
/usr/bin/ld: i386 architecture of input file `src/mmx.o' is incompatible
with i386:x86-64 output
collect2: ld returned 1 exit status
make: *** [gridflow.pd_linux] Error 1
$ nasm -f elf64 src/mmx.asm -o src/mmx.o 2>&1 | sed 's|.*:||' | uniq -c
120 instruction not supported in 64-bit mode
$
--
http://claudiusmaximus.goto10.org
More information about the Gridflow-dev
mailing list