Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.59 KB

fpcsr.md

File metadata and controls

39 lines (32 loc) · 1.59 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs ms.assetid caps.latest.revision author ms.author manager
FpCsr | Microsoft Docs
11/04/2016
cpp-tools
article
C++
dff95d5d-7589-4432-82db-64b459c24352
5
corob-msft
corob
ghogen

FpCsr

The register state also includes the x87 FPU control word. The calling convention dictates this register to be nonvolatile.

The x87 FPU control word register is set to the following standard values at the start of program execution:

FPCSR[0:6]: Exception masks all 1's (all exceptions masked)  
FPCSR[7]: Reserved - 0  
FPCSR[8:9]: Precision Control - 10B (double precision)  
FPCSR[10:11]: Rounding  control - 0 (round to nearest)  
FPCSR[12]: Infinity control - 0 (not used)  

A callee that modifies any of the fields within FPCSR must restore them before returning to its caller. Furthermore, a caller that has modified any of these fields must restore them to their standard values before invoking a callee unless by agreement the callee expects the modified values.

There are two exceptions to the rules regarding the non-volatility of the control flags:

  1. In functions where the documented purpose of the given function is to modify the nonvolatile FpCsr flags.

  2. When it is provably correct that the violation of these rules results in a programs that behaves/means the same as a program where these rules are not violated, for example, through whole-program analysis.

See Also

Calling Convention