Re: [AD] bug in polygon3d()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Sven Sandberg wrote :
> 
> However, under DOS (hence also djgpp), it calls
> 
>    old87 = _control87(PC_24 | RC_CHOP, MCW_PC | MCW_RC);
> 
> then draws the scanline, then resets by calling
> 
>    _control87(old87, MCW_PC | MCW_RC);
> 
> from do_polygon3d() in poly3d.c. I don't know if this means anything
> useful...

Actually those functions are called to force the FPU to compute floating
point operations in single precision (single precision ops are faster).
The first call saves the current FPU state then changes it to single
precision and the second call restores the previous FPU state. Both
lines are optionnal and can safely be commented out. May be watcom's
_control87 is buggy ? Can you try to comment out those pair of lines and
see if it works ? (Lines 1099, 1136, 1576, 1611, 1665 and 1700 in
poly3d.c. Lines 688 and 817 in scene3d.c).

> > Can you also verify that your compiler generates the expected code ?
> 
> It seems that obj/watcom/alleg/iscan.asm is equivalent to
> src/i386/iscan.s, from which it was generated (it is generated by
> assembling the gcc-style assembler, then disassembling the result using
> watcom's disassembler, then assembling this with watcom's assembler).
> That is, assuming fstp and fadd are just watcom's names for fstps and
> fadds. 

AFAIK fstps (resp. fadds) is the gcc syntax for fstp (resp. fadd). The
later is Intel's official name of the function.

	Bertrand.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/