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/Makefile.arch | 21 --------------------- libm/sh/feholdexcpt.c | 29 ----------------------------- libm/sh/fesetenv.c | 26 -------------------------- libm/sh/sh4/Makefile.arch | 22 ++++++++++++++++++++++ libm/sh/sh4/feholdexcpt.c | 29 +++++++++++++++++++++++++++++ libm/sh/sh4/fesetenv.c | 26 ++++++++++++++++++++++++++ 6 files changed, 77 insertions(+), 76 deletions(-) delete mode 100644 libm/sh/Makefile.arch delete mode 100644 libm/sh/feholdexcpt.c delete mode 100644 libm/sh/fesetenv.c create mode 100644 libm/sh/sh4/Makefile.arch create mode 100644 libm/sh/sh4/feholdexcpt.c create mode 100644 libm/sh/sh4/fesetenv.c (limited to 'libm/sh') diff --git a/libm/sh/Makefile.arch b/libm/sh/Makefile.arch deleted file mode 100644 index 6425b3ede..000000000 --- a/libm/sh/Makefile.arch +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for uClibc -# -# Copyright (c) 2007 STMicroelectronics Ltd -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -ifeq ($(UCLIBC_HAS_FENV),y) -libm_ARCH_SRC:=$(wildcard $(libm_ARCH_DIR)/*.c) -libm_ARCH_OBJ:=$(patsubst $(libm_ARCH_DIR)/%.c,$(libm_ARCH_OUT)/%.o,$(libm_ARCH_SRC)) -endif - -libm_ARCH_OBJS:=$(libm_ARCH_OBJ) - -ifeq ($(DOPIC),y) -libm-a-y+=$(libm_ARCH_OBJS:.o=.os) -else -libm-a-y+=$(libm_ARCH_OBJS) -endif -libm-so-y+=$(libm_ARCH_OBJS:.o=.os) - diff --git a/libm/sh/feholdexcpt.c b/libm/sh/feholdexcpt.c deleted file mode 100644 index 70b51e8dd..000000000 --- a/libm/sh/feholdexcpt.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * 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 -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; -} diff --git a/libm/sh/fesetenv.c b/libm/sh/fesetenv.c deleted file mode 100644 index c5cfc1d51..000000000 --- a/libm/sh/fesetenv.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * 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; -} diff --git a/libm/sh/sh4/Makefile.arch b/libm/sh/sh4/Makefile.arch new file mode 100644 index 000000000..122d84da2 --- /dev/null +++ b/libm/sh/sh4/Makefile.arch @@ -0,0 +1,22 @@ +# Makefile for uClibc +# +# Copyright (c) 2007, 2010 STMicroelectronics Ltd +# +# Author(s): Carmelo Amoroso +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +ifeq ($(UCLIBC_HAS_FENV),y) +libm_ARCH_SRC:=$(wildcard $(libm_SUBARCH_DIR)/*.c) +libm_ARCH_OBJ:=$(patsubst $(libm_SUBARCH_DIR)/%.c,$(libm_SUBARCH_OUT)/%.o,$(libm_ARCH_SRC)) +endif + +libm_ARCH_OBJS:=$(libm_ARCH_OBJ) + +ifeq ($(DOPIC),y) +libm-a-y+=$(libm_ARCH_OBJS:.o=.os) +else +libm-a-y+=$(libm_ARCH_OBJS) +endif +libm-so-y+=$(libm_ARCH_OBJS:.o=.os) + diff --git a/libm/sh/sh4/feholdexcpt.c b/libm/sh/sh4/feholdexcpt.c new file mode 100644 index 000000000..70b51e8dd --- /dev/null +++ b/libm/sh/sh4/feholdexcpt.c @@ -0,0 +1,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 +#include + +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; +} 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