diff options
Diffstat (limited to 'libm')
-rw-r--r-- | libm/Makefile.in | 16 | ||||
-rw-r--r-- | libm/powerpc/classic/Makefile.arch | 4 | ||||
-rw-r--r-- | libm/powerpc/e500/Makefile.arch | 1 | ||||
-rw-r--r-- | libm/sh/Makefile.arch | 21 | ||||
-rw-r--r-- | libm/sh/sh4/Makefile.arch | 24 | ||||
-rw-r--r-- | libm/sh/sh4/feholdexcpt.c (renamed from libm/sh/feholdexcpt.c) | 0 | ||||
-rw-r--r-- | libm/sh/sh4/fesetenv.c (renamed from libm/sh/fesetenv.c) | 0 | ||||
-rw-r--r-- | libm/sh/sh4/s_lrintf.S | 52 | ||||
-rw-r--r-- | libm/sh/sh4/s_lroundf.S | 39 |
9 files changed, 124 insertions, 33 deletions
diff --git a/libm/Makefile.in b/libm/Makefile.in index 6f66c5644..384365cac 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -34,19 +34,18 @@ libm_FULL_NAME := libm-$(VERSION).so libm_DIR:=$(top_srcdir)libm libm_OUT:=$(top_builddir)libm -# Fix builds for powerpc as there are different cores in this -# section now.` -ifeq ($(TARGET_ARCH)-$(CONFIG_E500),powerpc-y) -libm_ARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)/e500 -libm_ARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)/e500 -else libm_ARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH) libm_ARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH) + +ifneq ($(TARGET_SUBARCH),) +libm_SUBARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)/$(TARGET_SUBARCH) +libm_SUBARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)/$(TARGET_SUBARCH) endif ifeq ($(UCLIBC_HAS_FPU),y) ifeq ($(DO_C99_MATH),y) -include $(libm_ARCH_DIR)/Makefile.arch +-include $(libm_SUBARCH_DIR)/Makefile.arch endif endif @@ -219,11 +218,8 @@ endif ifeq ($(UCLIBC_HAS_FPU),y) ifeq ($(DO_C99_MATH),y) ifneq ($(strip $(libm_ARCH_OBJS)),) -ifeq ($(TARGET_ARCH)-$(CONFIG_E500),powerpc-y) -CFLAGS-libm/$(TARGET_ARCH)/e500/ := $(CFLAGS-libm) -else CFLAGS-libm/$(TARGET_ARCH)/ := $(CFLAGS-libm) -endif +CFLAGS-libm/$(TARGET_ARCH)/$(TARGET_SUBARCH)/ := $(CFLAGS-libm) # remove generic sources, if arch specific version is present ifneq ($(strip $(libm_ARCH_SRC)),) diff --git a/libm/powerpc/classic/Makefile.arch b/libm/powerpc/classic/Makefile.arch index 7c7600f80..53c6d2cac 100644 --- a/libm/powerpc/classic/Makefile.arch +++ b/libm/powerpc/classic/Makefile.arch @@ -5,8 +5,8 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -libm_ARCH_SRC:=$(wildcard $(libm_ARCH_DIR)/*.c) -libm_ARCH_OBJ:=$(patsubst $(libm_ARCH_DIR)/%.c,$(libm_ARCH_OUT)/%.o,$(libm_ARCH_SRC)) +libm_ARCH_SRC:=$(wildcard $(libm_SUBARCH_DIR)/*.c) +libm_ARCH_OBJ:=$(patsubst $(libm_SUBARCH_DIR)/%.c,$(libm_SUBARCH_OUT)/%.o,$(libm_ARCH_SRC)) libm_ARCH_OBJS:=$(libm_ARCH_OBJ) diff --git a/libm/powerpc/e500/Makefile.arch b/libm/powerpc/e500/Makefile.arch index bec21caef..912ce7f10 100644 --- a/libm/powerpc/e500/Makefile.arch +++ b/libm/powerpc/e500/Makefile.arch @@ -5,5 +5,6 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # +libm_ARCH_fpu_DIR := $(libm_SUBARCH_DIR)/fpu -include $(libm_ARCH_fpu_DIR)/Makefile.arch 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/sh4/Makefile.arch b/libm/sh/sh4/Makefile.arch new file mode 100644 index 000000000..e38e99c15 --- /dev/null +++ b/libm/sh/sh4/Makefile.arch @@ -0,0 +1,24 @@ +# Makefile for uClibc +# +# Copyright (c) 2007, 2010 STMicroelectronics Ltd +# +# Author(s): Carmelo Amoroso <carmelo.amoroso@st.com> +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +ifeq ($(UCLIBC_HAS_FENV),y) +libm_ARCH_CSRC:=$(wildcard $(libm_SUBARCH_DIR)/*.c) +libm_ARCH_COBJ:=$(patsubst $(libm_SUBARCH_DIR)/%.c,$(libm_SUBARCH_OUT)/%.o,$(libm_ARCH_SRC)) +libm_ARCH_SSRC:=$(wildcard $(libm_SUBARCH_DIR)/*.S) +libm_ARCH_SOBJ:=$(patsubst $(libm_SUBARCH_DIR)/%.S,$(libm_SUBARCH_OUT)/%.o,$(libm_ARCH_SSRC)) +endif + +libm_ARCH_OBJS:=$(libm_ARCH_COBJ) $(libm_ARCH_SOBJ) + +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/sh4/feholdexcpt.c index 70b51e8dd..70b51e8dd 100644 --- a/libm/sh/feholdexcpt.c +++ b/libm/sh/sh4/feholdexcpt.c diff --git a/libm/sh/fesetenv.c b/libm/sh/sh4/fesetenv.c index c5cfc1d51..c5cfc1d51 100644 --- a/libm/sh/fesetenv.c +++ b/libm/sh/sh4/fesetenv.c diff --git a/libm/sh/sh4/s_lrintf.S b/libm/sh/sh4/s_lrintf.S new file mode 100644 index 000000000..d8cec329c --- /dev/null +++ b/libm/sh/sh4/s_lrintf.S @@ -0,0 +1,52 @@ +/* Round argument to nearest integer value. SH4 version. + * According to ISO/IEC 9899:1999. This version doesn't handle range error. + * If arg is not finite or if the result cannot be represented into a long, + * return an unspecified value. No exception raised. + * + * Copyright (C) 2010 STMicroelectronics Ltd. + * + * Author: Christian Bruel <christian.bruel@st.com> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <sysdep.h> + +ENTRY(lrintf) + mov #0,r0 + sts fpscr,r3 + lds r0,fpscr + flds fr5,fpul + mov.l LOCAL(mask),r1 + sts fpul,r2 + and r2,r1 + mov.l LOCAL(midway),r2 + or r1,r2 + lds r2,fpul + fsts fpul,fr2 + fadd fr2,fr5 + ftrc fr5,fpul + sts fpul,r0 + float fpul,fr2 + fcmp/eq fr5,fr2 + bf/s 0f + mov #1,r2 + tst r1,r1 + and r0,r2 + movt r1 + shal r1 + tst r2,r2 + add #-1,r1 + bt 0f + sub r1,r0 +0: + rts + lds r3,fpscr + + .align 2 +LOCAL(mask): + .long 0x80000000 +LOCAL(midway): + .long 1056964608 + +END(lrintf) diff --git a/libm/sh/sh4/s_lroundf.S b/libm/sh/sh4/s_lroundf.S new file mode 100644 index 000000000..fda3a4b91 --- /dev/null +++ b/libm/sh/sh4/s_lroundf.S @@ -0,0 +1,39 @@ +/* Round argument toward 0. SH4 version. + * According to ISO/IEC 9899:1999. This version doesn't handle range error. + * If arg is not finite or if the result cannot be represented into a long, + * return an unspecified value. No exception raised. + * + * Copyright (C) 2010 STMicroelectronics Ltd. + * + * Author: Christian Bruel <christian.bruel@st.com> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <sysdep.h> + +ENTRY(lroundf) + mov #0,r0 + sts fpscr,r3 + lds r0,fpscr + flds fr5,fpul + mov.l LOCAL(mask),r1 + sts fpul,r2 + and r2,r1 + mov.l LOCAL(midway),r2 + or r1,r2 + lds r2,fpul + fsts fpul,fr2 + fadd fr2,fr5 + ftrc fr5,fpul + sts fpul,r0 + rts + lds r3,fpscr + + .align 2 +LOCAL(mask): + .long 0x80000000 +LOCAL(midway): + .long 1056964608 + +END(lroundf) |