summaryrefslogtreecommitdiff
path: root/libm/sh/feholdexcpt.c
blob: 1af79b31ff85eb3077ea4b50bc778a44a113eb64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 *
 * Copyright (c) 2007  STMicroelectronics Ltd
 * Filippo Arcidiacono (filippo.arcidiacono@st.com)
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 *
 * Taken from glibc 2.6
 *
 */

#include <fenv.h>
#include <fpu_control.h>

int
feholdexcept (fenv_t *envp)
{
  unsigned long int temp;

  /* Store the environment.  */
  _FPU_GETCW (temp);
  envp->__fpscr = temp;

  /* Now set all exceptions to non-stop.  */
  temp &= ~FE_ALL_EXCEPT;
  _FPU_SETCW (temp);

  return 1;
}
libm_hidden_def (feholdexcept)