Back to index

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

Go to the source code of this file.

Functions

int fesetexceptflag (const fexcept_t *flagp, int excepts)

Function Documentation

int fesetexceptflag ( const fexcept_t flagp,
int  excepts 
)

Definition at line 24 of file fsetexcptflg.c.

{
  fenv_t fpsr;

  /* Get the current exception state.  */
  __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));

  fpsr &= ~(((fenv_t) excepts & FE_ALL_EXCEPT) << 13);

  /* Set all the bits that were called for.  */
  fpsr |= ((*flagp & excepts & FE_ALL_EXCEPT) << 13);

  /* And store it back.  */
  __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory");

  /* Success.  */
  return 0;
}

Here is the call graph for this function: