Microsoft KB Archive/307611

= FIX: Unable to Set Flush-to-Zero Mode Using _controlfp =

Article ID: 307611

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows XP Professional for Itanium-based systems
 * The C Run-Time (CRT)

-



This article was previously published under Q307611



SYMPTOMS
A call to _controlfp( _DN_FLUSH, _MCW_DN) does not turn on flush-to-zero mode for an IA64 application.



CAUSE
This is due to a bug in the IA64 C Run-Time libraries.



RESOLUTION
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 the Microsoft 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:

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.



STATUS
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.



MORE INFORMATION
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 &quot;fpsr&quot; 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.
 * 1) include 
 * 2) include 

int main( int argc, char ** argv) { printf( &quot;Before calling _controlfp\n&quot;);

_controlfp( _DN_FLUSH, _MCW_DN);

printf( &quot;After calling _controlfp\n&quot;); }

Additional query words: &quot;Denormals as Zeroes&quot; ftz sf0

Keywords: kbhotfixserver kbqfe kbbug kbfix kboswin2000fix kbwinxpsp1fix KB307611

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.