From 5a1453f20c9ba7023f1836bdcd5ab06963f927a1 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Fri, 17 Dec 2010 08:11:12 +0100 Subject: libm_sh: Move fenv functions into sh4 sub-folder Indeed fenv funxtions are SH4 specific, so move them into an SH4 specific sub-folder. Signed-off-by: Carmelo Amoroso --- libm/sh/sh4/fesetenv.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 libm/sh/sh4/fesetenv.c (limited to 'libm/sh/sh4/fesetenv.c') diff --git a/libm/sh/sh4/fesetenv.c b/libm/sh/sh4/fesetenv.c new file mode 100644 index 000000000..c5cfc1d51 --- /dev/null +++ b/libm/sh/sh4/fesetenv.c @@ -0,0 +1,26 @@ +/* + * + * 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 +#include + +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; +} -- cgit v1.2.3