FIX: Unable to Set Flush-to-Zero Mode Using _controlfp()

Support for Windows XP has ended

Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

This article was previously published under Q307611
This article has been archived. It is offered "as is" and will no longer be updated.
A call to _controlfp( _DN_FLUSH, _MCW_DN) does not turn on flush-to-zero mode for an IA64 application.
This is due to a bug in the IA64 C Run-Time libraries.
To resolve this problem, obtain the latest service pack for Windows XP. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
322389 How to Obtain the Latest Windows XP Service Pack
The English version of this fix should have the following file attributes or later:

24-Sep-200110:587.0.2600.14 (xpclnt_qfe.010827-1804)941,056Msvcrt.dllIA64

NOTE: If this product was already installed on your computer when you purchased it from the original equipment manufacturer (and you need this fix), please call the Pay Per Incident number listed on the above Web site. If you contact Microsoft to obtain this fix, a fee may be charged. This fee is refundable if it is determined that you only require the fix you requested. However, this fee is non-refundable if you request additional technical support, if your no-charge technical support period has expired, or if you are not eligible for standard no-charge technical support.

This problem occurs in IA64 applications that are built with Win64 tools from the August 2001 (build 9234) Platform Software Development Kit (SDK). This fix is only for the CRT .dll file. Fixes to the CRT static libraries will be shipped in an upcoming Platform SDK.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows XP Service Pack 1.
To reproduce the problem, build a 64-bit binary by using the following sample code and the 64-bit C/C++ Compiler and Linker, which is available from the 64-bit tools in Windows Platform SDK. Insert a breakpoint on the _controlfp function, and run it in under the WinDbg debugger (for 64-bit). Examine the value of the "fpsr" register before and after the _controlfp function executes. You should see that the sixth least significant bit (0 based) is not set after the call to _controlfp. After you install the fix, this bit should be set.
#include <stdio.h>#include <float.h>int main( int argc, char ** argv){  printf( "Before calling _controlfp()\n");  _controlfp( _DN_FLUSH, _MCW_DN);  printf( "After calling _controlfp()\n");}				
"Denormals as Zeroes" ftz sf0

Article ID: 307611 - Last Review: 02/27/2014 21:10:02 - Revision: 2.5

  • Microsoft Windows XP Professional x64 Edition
  • The C Run-Time (CRT)
  • kbnosurvey kbarchive kbhotfixserver kbqfe kbbug kbfix kboswin2000fix kbwinxpsp1fix KB307611