Comment 17 for bug 375498

Revision history for this message
yason (simo-melenius+launchpad) wrote :

I bumped into this again when updating my system and having ditched my locally compiled version in the process. Is this fix still waiting in some queue or something? I guess all we need is ---disable-i386-asm for configure in debian/rules.

Further, I built a version with symbols and tracked it to fixed point division function that is called as soon as the first raycasted frame is rendered:

-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<
G_DoPlayDemo: playing demo with ultimate doom compatibility
P_GetNodesVersion: using normal BSP nodes

Program received signal SIGFPE, Arithmetic exception.
0x080cc3e9 in FixedDiv () at m_fixed.h:183
183 asm (
(gdb) bt
#0 0x080cc3e9 in FixedDiv () at m_fixed.h:183
#1 R_ExecuteSetViewSize () at r_main.c:423
#2 0x0806799d in D_Display () at d_main.c:252
#3 0x080d25fa in TryRunTics () at d_client.c:499
#4 0x0806a15b in D_DoomLoop () at d_main.c:362
#5 D_DoomMain () at d_main.c:1651
#6 0x080daa66 in main (argc=5, argv=0xbffff244) at i_main.c:407
(gdb) print $pc
$1 = (void (*)()) 0x80cc3e9 <R_ExecuteSetViewSize+889>
(gdb) disass $pc-0x8 $pc+0x8
Dump of assembler code from 0x80cc3e1 to 0x80cc3f1:
0x080cc3e1 <R_ExecuteSetViewSize+881>: add %al,(%eax)
0x080cc3e3 <R_ExecuteSetViewSize+883>: mov %ecx,%eax
0x080cc3e5 <R_ExecuteSetViewSize+885>: jmp 0x80cc400 <R_ExecuteSetViewSize+912>
0x080cc3e7 <R_ExecuteSetViewSize+887>: mov %edi,%eax
0x080cc3e9 <R_ExecuteSetViewSize+889>: idiv %ecx
0x080cc3eb <R_ExecuteSetViewSize+891>: mov %eax,0x81571c0(,%esi,4)
End of assembler dump.
(gdb)
-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<

FixedDiv() has different implementations, two with inline assembly dating back to 1998 and one in pure C. While the inline assembly might have theoretically given some performance boost ten years ago, I agree with the upstream author that it shouldn't matter to disable it. There's no reason to ever enable tweaks like these on modern cpus in a program considered as light-weight as Doom.

I'd like to get rid of my locally built-and-held prboom*.deb now, get the fix included directly from Ubuntu repos, have this bug closed, and go Berzerk-whacking some monsters — thanks :)