Mail Archives: pgcc/1999/08/07/21:07:56
I downloaded the 3 versions of bzip2 from http://goof.com/pcg/data/test/
I have no idea what they're supposed to be, other than that they are
mmx-enabled bzip2 binaries from a bleeding-edge pgcc.
I noticed a couple problems with them though.
1. mmx versions break when decompressing:
# on a PIII running RH6.0
# compress with system bzip2, no monkey business yet
cordes]~/tmp $ echo hello | bzip2 > foo.bz2
cordes]~/tmp $ ./bzip2-nommx -dc foo.bz2
hello
cordes]~/tmp $ ./bzip2-mmx -dc foo.bz2
bzip2-mmx: Caught a SIGSEGV or SIGBUS whilst decompressing,
[snip]
cordes]~/tmp $ ./bzip2-mmxonly -dc foo.bz2
[same error]
(strace indicates a SIGSEGV, BTW)
These results are duplicated on a P200MMX running Stampede 0.89
Kernel version 2.2.10, compiled with egcs 1.1.2 the RH6.0 machine, and
with pgcc 1.1.1 (-O6 -fno-strength-reduce) on the Stampede machine.
2. MMX instructions are executed by the bzip2-mmx binary, even on non-mmx
machines. (I'm guessing that it is supposed to figure out which you have
and run the appropriate code, so it is meant to work on non-mmx machines.
If not, then this is not a bug.)
note: lever has an Intel Pentium @ 100MHz
I ran bzip2-mmx with gdb, so I could find what instruction was bad.
From the shell, it just dies from the SIGILL it gets when it tries to run
the emms instruction. (BTW, all I know about mmx programming is what I
read in a Linux Journal article last year.)
peter AT lever]~ $ gdb -q bzip2-mmx
(no debugging symbols found)...(gdb)
(gdb) run < /usr/dict/words > /dev/null
Starting program: /home/peter/bzip2-mmx < /usr/dict/words > /dev/null
warning: shared library handler failed to enable breakpoint
Program received signal SIGILL, Illegal instruction.
0x8052e7a in ?? ()
(gdb) disassemble 0x8052e7a 0x8052eaa
Dump of assembler code from 0x8052e7a to 0x8052eaa:
0x8052e7a: emms
0x8052e7c: call 0x805dd50
0x8052e81: addl $0x4,%esp
0x8052e84: testl %eax,%eax
0x8052e86: je 0x8052e90
0x8052e88: emms
0x8052e8a: call 0x80572d8
0x8052e8f: nop
0x8052e90: movl 0xc(%ebp),%edi
0x8052e93: pushl %edi
0x8052e94: emms
0x8052e96: call 0x805dd50
0x8052e9b: addl $0x4,%esp
0x8052e9e: testl %eax,%eax
0x8052ea0: je 0x8052eb0
0x8052ea2: emms
0x8052ea4: call 0x80572d8
0x8052ea9: leal 0x0(%esi,1),%esi
End of assembler dump.
Keep up the good work, Marc + team :)
#define X(x,y) x##y
Peter Cordes ; e-mail: X(peter AT cordes DOT phys. , dal.ca)
- Raw text -