This is an automated email from the ASF dual-hosted git repository. gustavonihei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push: new bec1b0b Revert "libc: Implement fesetround & fegetround for arm" bec1b0b is described below commit bec1b0bc9259e079859a42cc137b1d20b8c281dc Author: Xiang Xiao <xiaoxi...@xiaomi.com> AuthorDate: Sun Oct 31 17:24:10 2021 +0800 Revert "libc: Implement fesetround & fegetround for arm" Since the toolchain provide the implementation now. This reverts commit fe992a5b6c91f2caa2ad9ac92d0876b5ec39978a. --- include/fenv.h | 44 -------------- libs/libc/machine/arm/Make.defs | 2 - libs/libc/machine/arm/arm_fenv.c | 120 --------------------------------------- 3 files changed, 166 deletions(-) diff --git a/include/fenv.h b/include/fenv.h deleted file mode 100644 index 81e44a8..0000000 --- a/include/fenv.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * include/fenv.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __INCLUDE_FENV_H -#define __INCLUDE_FENV_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define FE_TONEAREST 0 -#define FE_DOWNWARD 1 -#define FE_UPWARD 2 -#define FE_TOWARDZERO 3 - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -int fegetround(void); -int fesetround(int round); - -#endif /* __INCLUDE_FENV_H */ \ No newline at end of file diff --git a/libs/libc/machine/arm/Make.defs b/libs/libc/machine/arm/Make.defs index c1b096e..d9d60ce 100644 --- a/libs/libc/machine/arm/Make.defs +++ b/libs/libc/machine/arm/Make.defs @@ -46,7 +46,5 @@ ifeq ($(CONFIG_CXX_EXCEPTION),y) CSRCS += gnu_unwind_find_exidx.c endif -CSRCS += arm_fenv.c - DEPPATH += --dep-path machine/arm VPATH += :machine/arm diff --git a/libs/libc/machine/arm/arm_fenv.c b/libs/libc/machine/arm/arm_fenv.c deleted file mode 100644 index 12ca8c4..0000000 --- a/libs/libc/machine/arm/arm_fenv.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * libs/libc/machine/arm/arm_fenv.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <assert.h> -#include <fenv.h> - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define ARM_FPSCR_TONEAREST 0x00000000 -#define ARM_FPSCR_DOWNWARD 0x00400000 -#define ARM_FPSCR_UPWARD 0x00800000 -#define ARM_FPSCR_TOWARDZERO 0x00c00000 - -#define ARM_FPSCR_ROUNDMASK 0x00c00000 - -#define SET_FPSCR(__r) __asm __volatile("vmrs %0, fpscr" : "=&r"(__r)) -#define GET_FPSCR(__r) __asm __volatile("vmsr fpscr, %0" : : "r"(__r)) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -int fegetround(void) -{ - int ret = FE_TONEAREST; - -#ifndef __SOFTFP__ - int fpscr = 0; - - GET_FPSCR(fpscr); - - fpscr &= ARM_FPSCR_ROUNDMASK; - - switch (fpscr) - { - case ARM_FPSCR_TONEAREST: - ret = FE_TONEAREST; - break; - - case ARM_FPSCR_DOWNWARD: - ret = FE_DOWNWARD; - break; - - case ARM_FPSCR_UPWARD: - ret = FE_UPWARD; - break; - - case ARM_FPSCR_TOWARDZERO: - ret = FE_TOWARDZERO; - break; - - default: - assert(0); - break; - } - -#endif - - return ret; -} - -int fesetround(int round) -{ -#ifndef __SOFTFP__ - int fpscr = 0; - - GET_FPSCR(fpscr); - fpscr &= ~(ARM_FPSCR_ROUNDMASK); - - switch (fpscr) - { - case FE_TONEAREST: - round = ARM_FPSCR_TONEAREST; - break; - - case FE_DOWNWARD: - round = ARM_FPSCR_DOWNWARD; - break; - - case FE_UPWARD: - round = ARM_FPSCR_UPWARD; - break; - - case FE_TOWARDZERO: - round = ARM_FPSCR_TOWARDZERO; - break; - - default: - assert(0); - break; - } - - fpscr |= round; - SET_FPSCR(fpscr); -#endif - return (0); -}