summaryrefslogtreecommitdiff
path: root/libm/sh/sh4/feholdexcpt.c
blob: 70b51e8ddd348a5f35961301b693b76d85b7d45f (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
/*
 *
 * 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;
}