fesetenv.c 460 B

1234567891011121314151617181920212223242526
  1. /*
  2. *
  3. * Copyright (c) 2007 STMicroelectronics Ltd
  4. * Filippo Arcidiacono (filippo.arcidiacono@st.com)
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. *
  8. * Taken from glibc 2.6
  9. *
  10. */
  11. #include <fenv.h>
  12. #include <fpu_control.h>
  13. int
  14. fesetenv (const fenv_t *envp)
  15. {
  16. if (envp == FE_DFL_ENV)
  17. _FPU_SETCW (_FPU_DEFAULT);
  18. else
  19. {
  20. unsigned long int temp = envp->__fpscr;
  21. _FPU_SETCW (temp);
  22. }
  23. return 0;
  24. }