Back to index

glibc  2.9
Functions
fedisblxcpt.c File Reference
#include <fenv.h>

Go to the source code of this file.

Functions

int fedisableexcept (int excepts)

Function Documentation

int fedisableexcept ( int  excepts)

Definition at line 24 of file fedisblxcpt.c.

{
  unsigned short int new_exc, old_exc;
  unsigned int new;

  excepts &= FE_ALL_EXCEPT;

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

  old_exc = (~new_exc) & FE_ALL_EXCEPT;

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

  /* And now the same for the SSE MXCSR register.  */
  __asm__ ("stmxcsr %0" : "=m" (*&new));

  /* The SSE exception masks are shifted by 7 bits.  */
  new |= excepts << 7;
  __asm__ ("ldmxcsr %0" : : "m" (*&new));

  return old_exc;
}

Here is the call graph for this function: