summaryrefslogtreecommitdiff
path: root/libm/sh/fesetenv.c
blob: 9f9082cf34623c72e30477297f7e89aec87cf2f5 (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
/*
 *
 * 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
fesetenv (const fenv_t *envp)
{
  if (envp == FE_DFL_ENV)
      _FPU_SETCW (_FPU_DEFAULT);
  else
    {
      unsigned long int temp = envp->__fpscr;
      _FPU_SETCW (temp);
    }
  return 0;
}
libm_hidden_def (fesetenv)