Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fegetenv.c « mingwex « mingw « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c5d591e76595653282296b9907c2ad3bd7ac5d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <fenv.h>
#include "cpu_features.h"

/* 7.6.4.1
   The fegetenv function stores the current floating-point environment
   in the object pointed to by envp.  */

int fegetenv (fenv_t * envp)
{
  __asm__ ("fnstenv %0;": "=m" (*envp));
 /* fnstenv sets control word to non-stop for all exceptions, so we
    need to reload our env to restore the original mask.  */
  __asm__ ("fldenv %0" : : "m" (*envp));

  /* And the SSE environment.  */
  if (__HAS_SSE)
    __asm__ ("stmxcsr %0" : "=m" (envp->__mxcsr));

  return 0;
}