Back to index

glibc  2.9
Functions
fedisblxcpt.c File Reference
#include <fenv.h>
#include <unistd.h>
#include <ldsodefs.h>
#include <dl-procinfo.h>

Go to the source code of this file.

Functions

int fedisableexcept (int excepts)

Function Documentation

int fedisableexcept ( int  excepts)

Definition at line 27 of file fedisblxcpt.c.

{
  unsigned short int new_exc, old_exc;

  /* Get the current control word.  */
  __asm__ ("fstcw %0" : "=m" (*&new_exc));

  old_exc = (~new_exc) & FE_ALL_EXCEPT;

  excepts &= FE_ALL_EXCEPT;

  new_exc |= excepts;
  __asm__ ("fldcw %0" : : "m" (*&new_exc));

  /* If the CPU supports SSE we set the MXCSR as well.  */
  if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
    {
      unsigned int xnew_exc;

      /* Get the current control word.  */
      __asm__ ("stmxcsr %0" : "=m" (*&xnew_exc));

      xnew_exc |= excepts << 7;

      __asm__ ("ldmxcsr %0" : : "m" (*&xnew_exc));
    }

  return old_exc;
}

Here is the call graph for this function: