Back to index

glibc  2.9
Functions
fsetexcptflg.c File Reference
#include <fenv.h>
#include <math.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 25 of file fsetexcptflg.c.

{
  union { unsigned long long l; unsigned int sw[2]; } s;

  /* Get the current status word. */
  __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l) : "%r0");
  /* Install new raised trap bits */
  s.sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
  /* Store the new status word.  */
  __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l) : "%r0");

  /* Success.  */
  return 0;
}

Here is the call graph for this function: