lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | |
| 12 | #include <fenv.h> |
| 13 | #include <fpu_control.h> |
| 14 | |
| 15 | int |
| 16 | fesetenv (const fenv_t *envp) |
| 17 | { |
| 18 | if (envp == FE_DFL_ENV) |
| 19 | _FPU_SETCW (_FPU_DEFAULT); |
| 20 | else |
| 21 | { |
| 22 | unsigned long int temp = envp->__fpscr; |
| 23 | _FPU_SETCW (temp); |
| 24 | } |
| 25 | return 0; |
| 26 | } |