Math library optimatizations for FPU only apply to ARMv8 which is not yet supported.

This commit is contained in:
Gregory Nutt 2017-01-20 08:24:59 -06:00
parent 2f8c2b62e1
commit 9cc37d8ee1
17 changed files with 117 additions and 60 deletions

View File

@ -302,6 +302,10 @@ config ARCH_CORTEXM0
select ARCH_HAVE_IRQPRIO select ARCH_HAVE_IRQPRIO
select ARCH_HAVE_RESET select ARCH_HAVE_RESET
config ARCH_CORTEXM23
bool
default n
config ARCH_CORTEXM3 config ARCH_CORTEXM3
bool bool
default n default n
@ -310,6 +314,10 @@ config ARCH_CORTEXM3
select ARCH_HAVE_HIPRI_INTERRUPT select ARCH_HAVE_HIPRI_INTERRUPT
select ARCH_HAVE_RESET select ARCH_HAVE_RESET
config ARCH_CORTEXM33
bool
default n
config ARCH_CORTEXM4 config ARCH_CORTEXM4
bool bool
default n default n

View File

@ -3,70 +3,58 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
# These are library functions that may be overriden by architecture-
# specific implementations. Not all architectures support implementations
# for every library function.
config LIBM_ARCH_CEIL config LIBM_ARCH_CEIL
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_FLOOR config LIBM_ARCH_FLOOR
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_NEARBYINT config LIBM_ARCH_NEARBYINT
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_RINT config LIBM_ARCH_RINT
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_ROUND config LIBM_ARCH_ROUND
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_TRUNC config LIBM_ARCH_TRUNC
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_CEILF config LIBM_ARCH_CEILF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_FLOORF config LIBM_ARCH_FLOORF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_NEARBYINTF config LIBM_ARCH_NEARBYINTF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_RINTF config LIBM_ARCH_RINTF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_ROUNDF config LIBM_ARCH_ROUNDF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBM_ARCH_TRUNCF config LIBM_ARCH_TRUNCF
default n default n
depends on LIBC_ARCHOPT depends on LIBM && ARCH_CORTEXM33
config LIBC_ARCHOPT if ARCH_CORTEXM33
bool "Architecture specific optimizations" source libc/machine/armv8/Kconfig
default n endif
select LIBM_ARCH_CEIL if CONFIG_ARCH_DPFPU
select LIBM_ARCH_FLOOR if CONFIG_ARCH_DPFPU
select LIBM_ARCH_NEARBYINT if CONFIG_ARCH_DPFPU
select LIBM_ARCH_RINT if CONFIG_ARCH_DPFPU
select LIBM_ARCH_ROUND if CONFIG_ARCH_DPFPU
select LIBM_ARCH_TRUNC if CONFIG_ARCH_DPFPU
select LIBM_ARCH_CEILF if CONFIG_ARCH_FPU
select LIBM_ARCH_FLOORF if CONFIG_ARCH_FPU
select LIBM_ARCH_NEARBYINTF if CONFIG_ARCH_FPU
select LIBM_ARCH_RINTF if CONFIG_ARCH_FPU
select LIBM_ARCH_ROUNDF if CONFIG_ARCH_FPU
select LIBM_ARCH_TRUNCF if CONFIG_ARCH_FPU
depends on ARCH_ARM && LIBM
---help---
Enable architecture specific optimizations. Currently only
available for use with ARM and only for the NuttX math library.

View File

@ -33,8 +33,6 @@
# #
############################################################################ ############################################################################
ifeq ($(CONFIG_LIBC_ARCHOPT),y) ifeq ($(CONFIG_ARCH_CORTEXM33),y)
ifeq ($(CONFIG_ARCH_ARM),y) include ${TOPDIR}/libc/machine/armv8/Make.defs
include ${TOPDIR}/libc/machine/arm/Make.defs
endif
endif endif

View File

@ -0,0 +1,27 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_CORTEXM33
config ARMV8_LIBM
bool "Architecture specific optimizations"
default n
select LIBM_ARCH_CEIL if CONFIG_ARCH_DPFPU
select LIBM_ARCH_FLOOR if CONFIG_ARCH_DPFPU
select LIBM_ARCH_NEARBYINT if CONFIG_ARCH_DPFPU
select LIBM_ARCH_RINT if CONFIG_ARCH_DPFPU
select LIBM_ARCH_ROUND if CONFIG_ARCH_DPFPU
select LIBM_ARCH_TRUNC if CONFIG_ARCH_DPFPU
select LIBM_ARCH_CEILF if CONFIG_ARCH_FPU
select LIBM_ARCH_FLOORF if CONFIG_ARCH_FPU
select LIBM_ARCH_NEARBYINTF if CONFIG_ARCH_FPU
select LIBM_ARCH_RINTF if CONFIG_ARCH_FPU
select LIBM_ARCH_ROUNDF if CONFIG_ARCH_FPU
select LIBM_ARCH_TRUNCF if CONFIG_ARCH_FPU
depends on LIBM
---help---
Enable ARMv8 specific floating point optimizations.
endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# libc/machine/arm/Make.defs # libc/machine/armv8/Make.defs
# #
# Copyright (C) 2017 Gregory Nutt. All rights reserved. # Copyright (C) 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,21 +33,57 @@
# #
############################################################################ ############################################################################
ifeq ($(CONFIG_LIBM),y) ifeq ($(CONFIG_ARMV8_LIBM),y)
ifeq ($(CONFIG_ARCH_FPU),y)
CSRCS += lib_ceilf.c lib_floorf.c lib_nearbyintf.c lib_rintf.c ifeq ($(LIBM_ARCH_CEIL),y)
CSRCS += lib_roundf.c lib_truncf.c CSRCS += arch_ceil.c
endif
ifeq ($(CONFIG_ARCH_DPFPU),y) ifeq ($(LIBM_ARCH_CEILF),y)
CSRCS += arch_ceilf.c
endif
CSRCS += lib_ceil.c lib_floor.c lib_nearbyint.c lib_rint.c lib_round.c ifeq ($(LIBM_ARCH_FLOOR),y)
CSRCS += lib_trunc.c CSRCS += arch_floor.c
endif
endif # CONFIG_ARCH_DPFPU ifeq ($(LIBM_ARCH_FLOORF),y)
CSRCS += arch_floorf.c
endif
DEPPATH += --dep-path machine/arm ifeq ($(LIBM_ARCH_NEARBYINT),y)
VPATH += :machine/arm CSRCS += arch_nearbyint.c
endif
endif # CONFIG_ARCH_FPU ifeq ($(LIBM_ARCH_NEARBYINTF),y)
endif # CONFIG_LIBM CSRCS += arch_nearbyintf.c
endif
ifeq ($(LIBM_ARCH_RINTF),y)
CSRCS += arch_rintf.c
endif
ifeq ($(LIBM_ARCH_ROUNDF),y)
CSRCS += arch_roundf.c
endif
ifeq ($(LIBM_ARCH_TRUNCF),y)
CSRCS += arch_truncf.c
endif
ifeq ($(LIBM_ARCH_RINT),y)
CSRCS += arch_rint.c
endif
ifeq ($(LIBM_ARCH_ROUND),y)
CSRCS += arch_round.c
endif
ifeq ($(LIBM_ARCH_TRUNC),y)
CSRCS += arch_trunc.c
endif
DEPPATH += --dep-path machine/armv8
VPATH += :machine/armv8
endif # CONFIG_ARMV8_LIBM

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_ceil.c * libc/machine/armv8/arch_ceil.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_ceilf.c * libc/machine/armv8/arch_ceilf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_floor.c * libc/machine/armv8/arch_floor.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_floorf.c * libc/machine/armv8/arch_floorf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_nearbyint.c * libc/machine/armv8/arch_nearbyint.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_nearbyintf.c * libc/machine/armv8/arch_nearbyintf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_rint.c * libc/machine/armv8/arch_rint.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_rintf.c * libc/machine/armv8/arch_rintf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_round.c * libc/machine/armv8/arch_round.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_roundf.c * libc/machine/armv8/arch_roundf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_trunc.c * libc/machine/armv8/arch_trunc.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* libc/machine/arm/lib_truncf.c * libc/machine/armv8/arch_truncf.c
* *
* Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
* *