Stefan Krah <stefan-use...@bytereef.org> added the comment:

I wonder if calling _Py_SET_53BIT_PRECISION_START/_Py_SET_53BIT_PRECISION_END 
every time will have any measurable effect on performance.  First, string
conversions have a lot of overhead already. Then, for compilers that already
set the correct control word, only fnstcw is called. 


Attached is a quick and dirty benchmark. The correct state is set at
the start of the program. The first loop does not change the FPU state,
the second one uses the macros, the third one always sets/restores. 


time:                   0.000000    result: 1.90013e+122
time (fnstcw):          0.570000    result: 1.90013e+122
time (fnstcw/fldcw):    2.560000    result: 1.90013e+122



I would feel more comfortable if the correct FPU state is guaranteed.

----------
Added file: http://bugs.python.org/file19066/fpuspeed.c

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9980>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to