Chapter 2 C and C++ Source-Level Optimizations 51
Software Optimization Guide for AMD64 Processors
25112 Rev. 3.06 September 2005
Examples
Listing 22.
/* Prototype for _controlfp function */
#include <float.h>
unsigned int orig_cw;
/* Get current FPU control word and save it. */
orig_cw = _controlfp(0, 0);
/* Set precision control in FPU control word to single precision.
This reduces the latency of divide and square-root operations. */
_controlfp(_PC_24, MCW_PC);
/* Restore original FPU control word. */
_controlfp(orig_cw, 0xfffff);