From 31ea376b587578897cdeff7b085286668cf9a7a1 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 29 Aug 2024 20:35:05 +0200 Subject: ArmPkg: Remove ArmSoftFloatLib implementation Drop the softfloat library implementation now that it is no longer used. Signed-off-by: Ard Biesheuvel --- ArmPkg/ArmPkg.ci.yaml | 6 - ArmPkg/ArmPkg.dsc | 1 - ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c | 421 --------------------- ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf | 92 ----- .../Library/ArmSoftFloatLib/berkeley-softfloat-3 | 1 - ArmPkg/Library/ArmSoftFloatLib/platform.h | 17 - 6 files changed, 538 deletions(-) delete mode 100644 ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c delete mode 100644 ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf delete mode 160000 ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 delete mode 100644 ArmPkg/Library/ArmSoftFloatLib/platform.h diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml index 292a25c9eb..a8f179243b 100644 --- a/ArmPkg/ArmPkg.ci.yaml +++ b/ArmPkg/ArmPkg.ci.yaml @@ -22,8 +22,6 @@ ], ## Both file path and directory path are accepted. "IgnoreFiles": [ - "Library/ArmSoftFloatLib/berkeley-softfloat-3", - "Library/ArmSoftFloatLib/ArmSoftFloatLib.c", "Universal/Smbios/SmbiosMiscDxe" ] }, @@ -90,10 +88,6 @@ ## options defined .pytool/Plugin/SpellCheck "SpellCheck": { "AuditOnly": True, - "IgnoreFiles": [ - "Library/ArmSoftFloatLib/berkeley-softfloat-3/**" - ], # use gitignore syntax to ignore errors - # in matching files "ExtendWords": [ "api's", "ackintid", diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 4a0603816e..d5a29f31ea 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -140,7 +140,6 @@ ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmPkg/Library/ArmMtlNullLib/ArmMtlNullLib.inf - ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf diff --git a/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c b/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c deleted file mode 100644 index 55ec564309..0000000000 --- a/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (c) 2015 - 2019, Linaro Limited - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - */ - -#include "platform.h" -#include - -/* - * On ARM32 EABI defines both a soft-float ABI and a hard-float ABI, - * hard-float is basically a super set of soft-float. Hard-float requires - * all the support routines provided for soft-float, but the compiler may - * choose to optimize to not use some of them. - * - * The AEABI functions uses soft-float calling convention even if the - * functions are compiled for hard-float. So where float and double would - * have been expected we use aeabi_float_t and aeabi_double_t respectively - * instead. - */ -typedef uint32_t aeabi_float_t; -typedef uint64_t aeabi_double_t; - -/* - * Helpers to convert between float32 and aeabi_float_t, and float64 and - * aeabi_double_t used by the AEABI functions below. - */ -static aeabi_float_t -f32_to_f ( - float32_t val - ) -{ - return val.v; -} - -static float32_t -f32_from_f ( - aeabi_float_t val - ) -{ - float32_t res; - - res.v = val; - - return res; -} - -static aeabi_double_t -f64_to_d ( - float64_t val - ) -{ - return val.v; -} - -static float64_t -f64_from_d ( - aeabi_double_t val - ) -{ - float64_t res; - - res.v = val; - - return res; -} - -/* - * From ARM Run-time ABI for ARM Architecture - * ARM IHI 0043D, current through ABI release 2.09 - * - * 4.1.2 The floating-point helper functions - */ - -/* - * Table 2, Standard aeabi_double_t precision floating-point arithmetic helper - * functions - */ -aeabi_double_t -__aeabi_dadd ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_to_d (f64_add (f64_from_d (a), f64_from_d (b))); -} - -aeabi_double_t -__aeabi_ddiv ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_to_d (f64_div (f64_from_d (a), f64_from_d (b))); -} - -aeabi_double_t -__aeabi_dmul ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_to_d (f64_mul (f64_from_d (a), f64_from_d (b))); -} - -aeabi_double_t -__aeabi_drsub ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_to_d (f64_sub (f64_from_d (b), f64_from_d (a))); -} - -aeabi_double_t -__aeabi_dsub ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_to_d (f64_sub (f64_from_d (a), f64_from_d (b))); -} - -/* - * Table 3, double precision floating-point comparison helper functions - */ -int -__aeabi_dcmpeq ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_eq (f64_from_d (a), f64_from_d (b)); -} - -int -__aeabi_dcmplt ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_lt (f64_from_d (a), f64_from_d (b)); -} - -int -__aeabi_dcmple ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_le (f64_from_d (a), f64_from_d (b)); -} - -int -__aeabi_dcmpge ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_le (f64_from_d (b), f64_from_d (a)); -} - -int -__aeabi_dcmpgt ( - aeabi_double_t a, - aeabi_double_t b - ) -{ - return f64_lt (f64_from_d (b), f64_from_d (a)); -} - -/* - * Table 4, Standard single precision floating-point arithmetic helper - * functions - */ -aeabi_float_t -__aeabi_fadd ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_to_f (f32_add (f32_from_f (a), f32_from_f (b))); -} - -aeabi_float_t -__aeabi_fdiv ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_to_f (f32_div (f32_from_f (a), f32_from_f (b))); -} - -aeabi_float_t -__aeabi_fmul ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_to_f (f32_mul (f32_from_f (a), f32_from_f (b))); -} - -aeabi_float_t -__aeabi_frsub ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_to_f (f32_sub (f32_from_f (b), f32_from_f (a))); -} - -aeabi_float_t -__aeabi_fsub ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_to_f (f32_sub (f32_from_f (a), f32_from_f (b))); -} - -/* - * Table 5, Standard single precision floating-point comparison helper - * functions - */ -int -__aeabi_fcmpeq ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_eq (f32_from_f (a), f32_from_f (b)); -} - -int -__aeabi_fcmplt ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_lt (f32_from_f (a), f32_from_f (b)); -} - -int -__aeabi_fcmple ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_le (f32_from_f (a), f32_from_f (b)); -} - -int -__aeabi_fcmpge ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_le (f32_from_f (b), f32_from_f (a)); -} - -int -__aeabi_fcmpgt ( - aeabi_float_t a, - aeabi_float_t b - ) -{ - return f32_lt (f32_from_f (b), f32_from_f (a)); -} - -/* - * Table 6, Standard floating-point to integer conversions - */ -int -__aeabi_d2iz ( - aeabi_double_t a - ) -{ - return f64_to_i32_r_minMag (f64_from_d (a), false); -} - -unsigned -__aeabi_d2uiz ( - aeabi_double_t a - ) -{ - return f64_to_ui32_r_minMag (f64_from_d (a), false); -} - -long long -__aeabi_d2lz ( - aeabi_double_t a - ) -{ - return f64_to_i64_r_minMag (f64_from_d (a), false); -} - -unsigned long long -__aeabi_d2ulz ( - aeabi_double_t a - ) -{ - return f64_to_ui64_r_minMag (f64_from_d (a), false); -} - -int -__aeabi_f2iz ( - aeabi_float_t a - ) -{ - return f32_to_i32_r_minMag (f32_from_f (a), false); -} - -unsigned -__aeabi_f2uiz ( - aeabi_float_t a - ) -{ - return f32_to_ui32_r_minMag (f32_from_f (a), false); -} - -long long -__aeabi_f2lz ( - aeabi_float_t a - ) -{ - return f32_to_i64_r_minMag (f32_from_f (a), false); -} - -unsigned long long -__aeabi_f2ulz ( - aeabi_float_t a - ) -{ - return f32_to_ui64_r_minMag (f32_from_f (a), false); -} - -/* - * Table 7, Standard conversions between floating types - */ -aeabi_float_t -__aeabi_d2f ( - aeabi_double_t a - ) -{ - return f32_to_f (f64_to_f32 (f64_from_d (a))); -} - -aeabi_double_t -__aeabi_f2d ( - aeabi_float_t a - ) -{ - return f64_to_d (f32_to_f64 (f32_from_f (a))); -} - -/* - * Table 8, Standard integer to floating-point conversions - */ -aeabi_double_t -__aeabi_i2d ( - int a - ) -{ - return f64_to_d (i32_to_f64 (a)); -} - -aeabi_double_t -__aeabi_ui2d ( - unsigned a - ) -{ - return f64_to_d (ui32_to_f64 (a)); -} - -aeabi_double_t -__aeabi_l2d ( - long long a - ) -{ - return f64_to_d (i64_to_f64 (a)); -} - -aeabi_double_t -__aeabi_ul2d ( - unsigned long long a - ) -{ - return f64_to_d (ui64_to_f64 (a)); -} - -aeabi_float_t -__aeabi_i2f ( - int a - ) -{ - return f32_to_f (i32_to_f32 (a)); -} - -aeabi_float_t -__aeabi_ui2f ( - unsigned a - ) -{ - return f32_to_f (ui32_to_f32 (a)); -} - -aeabi_float_t -__aeabi_l2f ( - long long a - ) -{ - return f32_to_f (i64_to_f32 (a)); -} - -aeabi_float_t -__aeabi_ul2f ( - unsigned long long a - ) -{ - return f32_to_f (ui64_to_f32 (a)); -} diff --git a/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf b/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf deleted file mode 100644 index 4d0c94df83..0000000000 --- a/ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf +++ /dev/null @@ -1,92 +0,0 @@ -## @file -# ARM Software floating point Library. -# -# Copyright (c) 2014, ARM Ltd. All rights reserved. -# Copyright (c) 2015 - 2019, Linaro Ltd. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -## - -[Defines] - INF_VERSION = 0x0001001B - BASE_NAME = ArmSoftFloatLib - FILE_GUID = a485f921-749e-41a0-9f91-62f09a38721c - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = ArmSoftFloatLib - -# -# VALID_ARCHITECTURES = ARM -# - -[Sources] - berkeley-softfloat-3/source/ARM-VFPv2/s_propagateNaNF64UI.c - berkeley-softfloat-3/source/ARM-VFPv2/softfloat_raiseFlags.c - berkeley-softfloat-3/source/ARM-VFPv2/specialize.h - berkeley-softfloat-3/source/f32_add.c - berkeley-softfloat-3/source/f32_div.c - berkeley-softfloat-3/source/f32_eq.c - berkeley-softfloat-3/source/f32_le.c - berkeley-softfloat-3/source/f32_lt.c - berkeley-softfloat-3/source/f32_mul.c - berkeley-softfloat-3/source/f32_sub.c - berkeley-softfloat-3/source/f32_to_f64.c - berkeley-softfloat-3/source/f32_to_i32_r_minMag.c - berkeley-softfloat-3/source/f32_to_i64_r_minMag.c - berkeley-softfloat-3/source/f32_to_ui32_r_minMag.c - berkeley-softfloat-3/source/f32_to_ui64_r_minMag.c - berkeley-softfloat-3/source/f64_add.c - berkeley-softfloat-3/source/f64_div.c - berkeley-softfloat-3/source/f64_eq.c - berkeley-softfloat-3/source/f64_le.c - berkeley-softfloat-3/source/f64_lt.c - berkeley-softfloat-3/source/f64_mul.c - berkeley-softfloat-3/source/f64_sub.c - berkeley-softfloat-3/source/f64_to_f32.c - berkeley-softfloat-3/source/f64_to_i32_r_minMag.c - berkeley-softfloat-3/source/f64_to_i64_r_minMag.c - berkeley-softfloat-3/source/f64_to_ui32_r_minMag.c - berkeley-softfloat-3/source/f64_to_ui64_r_minMag.c - berkeley-softfloat-3/source/i32_to_f32.c - berkeley-softfloat-3/source/i32_to_f64.c - berkeley-softfloat-3/source/i64_to_f32.c - berkeley-softfloat-3/source/i64_to_f64.c - berkeley-softfloat-3/source/include/internals.h - berkeley-softfloat-3/source/include/opts-GCC.h - berkeley-softfloat-3/source/include/primitiveTypes.h - berkeley-softfloat-3/source/include/primitives.h - berkeley-softfloat-3/source/include/softfloat.h - berkeley-softfloat-3/source/include/softfloat_types.h - berkeley-softfloat-3/source/s_addMagsF32.c - berkeley-softfloat-3/source/s_addMagsF64.c - berkeley-softfloat-3/source/s_countLeadingZeros32.c - berkeley-softfloat-3/source/s_countLeadingZeros64.c - berkeley-softfloat-3/source/s_countLeadingZeros8.c - berkeley-softfloat-3/source/s_mul64To128.c - berkeley-softfloat-3/source/s_normRoundPackToF32.c - berkeley-softfloat-3/source/s_normRoundPackToF64.c - berkeley-softfloat-3/source/s_normSubnormalF32Sig.c - berkeley-softfloat-3/source/s_normSubnormalF64Sig.c - berkeley-softfloat-3/source/s_roundPackToF32.c - berkeley-softfloat-3/source/s_roundPackToF64.c - berkeley-softfloat-3/source/s_shiftRightJam32.c - berkeley-softfloat-3/source/s_shiftRightJam64.c - berkeley-softfloat-3/source/s_shortShiftRightJam64.c - berkeley-softfloat-3/source/s_subMagsF32.c - berkeley-softfloat-3/source/s_subMagsF64.c - berkeley-softfloat-3/source/softfloat_state.c - berkeley-softfloat-3/source/ui32_to_f32.c - berkeley-softfloat-3/source/ui32_to_f64.c - berkeley-softfloat-3/source/ui64_to_f32.c - berkeley-softfloat-3/source/ui64_to_f64.c - - ArmSoftFloatLib.c - platform.h - -[Packages] - MdePkg/MdePkg.dec - -[BuildOptions] - GCC:*_*_*_CC_FLAGS = -fno-lto -ffreestanding -Wno-unused-label diff --git a/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 b/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 deleted file mode 160000 index b64af41c32..0000000000 --- a/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b64af41c3276f97f0e181920400ee056b9c88037 diff --git a/ArmPkg/Library/ArmSoftFloatLib/platform.h b/ArmPkg/Library/ArmSoftFloatLib/platform.h deleted file mode 100644 index 3b70360568..0000000000 --- a/ArmPkg/Library/ArmSoftFloatLib/platform.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2019, Linaro Limited - * Copyright (c) 2021, Arm Limited. All rights reserved.
- * - * SPDX-License-Identifier: BSD-2-Clause-Patent - */ - -#ifndef ARM_SOFT_FLOAT_LIB_H_ -#define ARM_SOFT_FLOAT_LIB_H_ - -#define LITTLEENDIAN 1 -#define INLINE static inline -#define SOFTFLOAT_BUILTIN_CLZ 1 -#define SOFTFLOAT_FAST_INT64 -#include "opts-GCC.h" - -#endif // ARM_SOFT_FLOAT_LIB_H_ -- cgit