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)
 libm_hidden_def (feholdexcept)

Function Documentation

int feholdexcept ( fenv_t envp)

Definition at line 24 of file feholdexcpt.c.

{
  fexcept_t fpcr, fpsr;

  /* Store the environment.  */
#ifdef __mcoldfire__
  __asm__ ("fmove%.l %/fpcr,%0" : "=dm" (envp->__control_register));
  __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (envp->__status_register));
  __asm__ ("fmove%.l %/fpiar,%0" : "=dm" (envp->__instruction_address));
#else
  __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp));
#endif

  /* Now clear all exceptions.  */
  fpsr = envp->__status_register & ~FE_ALL_EXCEPT;
  __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr));
  /* And set all exceptions to non-stop.  */
  fpcr = envp->__control_register & ~(FE_ALL_EXCEPT << 6);
  __asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (fpcr));

  return 0;
}

Here is the call graph for this function: