Back to index

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

Go to the source code of this file.

Functions

int feholdexcept (fenv_t *envp)

Function Documentation

int feholdexcept ( fenv_t envp)

Definition at line 24 of file feholdexcpt.c.

{
  fenv_t fpsr;
  /* Save the current state.  */
  __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
  *envp = fpsr;

  /* Set the trap disable bits.  */
  fpsr |= FE_ALL_EXCEPT;

  /* And clear the exception bits.  */
  fpsr &= ~(fenv_t) (FE_ALL_EXCEPT << 13);

  __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr));

  /* Success.  */
  return 0;
}

Here is the call graph for this function: