git: b8a496dfb6df - main - lib: Remove __ARM_ARCH checks that are always true

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 12 Jun 2024 11:49:28 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=b8a496dfb6df7b86e014d0d4476cd75850e060c1

commit b8a496dfb6df7b86e014d0d4476cd75850e060c1
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-06-12 11:49:05 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-06-12 11:49:05 +0000

    lib: Remove __ARM_ARCH checks that are always true
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D45559
---
 lib/libc/arm/aeabi/aeabi_vfp.h | 2 +-
 lib/libc/arm/gen/_setjmp.S     | 8 ++++----
 lib/libc/arm/gen/setjmp.S      | 4 ++--
 lib/libsys/arm/__vdso_gettc.c  | 7 -------
 lib/msun/arm/fenv.c            | 6 +-----
 5 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/lib/libc/arm/aeabi/aeabi_vfp.h b/lib/libc/arm/aeabi/aeabi_vfp.h
index f87f9acfd0a2..3b70fe06fab3 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp.h
+++ b/lib/libc/arm/aeabi/aeabi_vfp.h
@@ -65,7 +65,7 @@
  * C Helper macros
  */
 
-#if __ARM_ARCH >= 6 && !defined(SOFTFLOAT_FOR_GCC)
+#if !defined(SOFTFLOAT_FOR_GCC)
 /*
  * Generate a function that will either call into the VFP implementation,
  * or the soft float version for a given __aeabi_* helper. The function
diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S
index 19b8b6b07059..9e655d2e9e2e 100644
--- a/lib/libc/arm/gen/_setjmp.S
+++ b/lib/libc/arm/gen/_setjmp.S
@@ -58,12 +58,12 @@
 ENTRY(_setjmp)
 	ldr	r1, .L_setjmp_magic
 
-#if !defined(_STANDALONE) && __ARM_ARCH >= 6 && !defined(SOFTFLOAT_FOR_GCC)
+#if !defined(_STANDALONE) && !defined(SOFTFLOAT_FOR_GCC)
 	add	r2, r0, #(_JB_REG_D8 * 4)
 	vstmia	r2, {d8-d15}
 	vmrs	r2, fpscr
 	str	r2, [r0, #(_JB_REG_FPSCR * 4)]
-#endif /* !_STANDALONE && __ARM_ARCH >= 6 */
+#endif /* !_STANDALONE && !SOFTFLOAT_FOR_GCC */
 
 	str	r1, [r0]
 
@@ -91,12 +91,12 @@ ENTRY(_longjmp)
 	teq	ip, r2				/* magic correct? */
 	bne	botch				/*   no, botch */
 
-#if !defined(_STANDALONE) && __ARM_ARCH >= 6 && !defined(SOFTFLOAT_FOR_GCC)
+#if !defined(_STANDALONE) && !defined(SOFTFLOAT_FOR_GCC)
 	add	ip, r0, #(_JB_REG_D8 * 4)
 	vldmia	ip, {d8-d15}
 	ldr	ip, [r0, #(_JB_REG_FPSCR * 4)]
 	vmsr	fpscr, ip
-#endif /* !_STANDALONE && __ARM_ARCH >= 6 */
+#endif /* !_STANDALONE && !SOFTFLOAT_FOR_GCC */
 
 	add	r0, r0, #(_JB_REG_R4 * 4)
        	/* Restore integer registers */
diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S
index 5a6c899e2b23..e7f8b788e878 100644
--- a/lib/libc/arm/gen/setjmp.S
+++ b/lib/libc/arm/gen/setjmp.S
@@ -61,7 +61,7 @@ ENTRY(setjmp)
 
 	ldr	r1, .Lsetjmp_magic
 
-#if __ARM_ARCH >= 6 && !defined(SOFTFLOAT_FOR_GCC)
+#if !defined(SOFTFLOAT_FOR_GCC)
 	add	r2, r0, #(_JB_REG_D8 * 4)
 	vstmia	r2, {d8-d15}
 	vmrs	r2, fpscr
@@ -102,7 +102,7 @@ ENTRY(__longjmp)
 	bl	PIC_SYM(_C_LABEL(sigprocmask), PLT)
 	ldmfd	sp!, {r0-r2, r14}
 
-#if __ARM_ARCH >= 6 && !defined(SOFTFLOAT_FOR_GCC)
+#if !defined(SOFTFLOAT_FOR_GCC)
 	add	ip, r0, #(_JB_REG_D8 * 4)
 	vldmia	ip, {d8-d15}
 	ldr	ip, [r0, #(_JB_REG_FPSCR * 4)]
diff --git a/lib/libsys/arm/__vdso_gettc.c b/lib/libsys/arm/__vdso_gettc.c
index ea70dec35cd8..cb4bdec1e8ef 100644
--- a/lib/libsys/arm/__vdso_gettc.c
+++ b/lib/libsys/arm/__vdso_gettc.c
@@ -37,7 +37,6 @@
 #include <errno.h>
 #include "libc_private.h"
 
-#if __ARM_ARCH >= 6
 static inline uint64_t
 cp15_cntvct_get(void)
 {
@@ -55,7 +54,6 @@ cp15_cntpct_get(void)
 	__asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg));
 	return (reg);
 }
-#endif
 
 #pragma weak __vdso_gettc
 int
@@ -64,7 +62,6 @@ __vdso_gettc(const struct vdso_timehands *th, u_int *tc)
 
 	if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM)
 		return (ENOSYS);
-#if __ARM_ARCH >= 6
 	/*
 	 * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but
 	 * libc is compiled for ARMv6.  Due to clang issues, .arch
@@ -73,10 +70,6 @@ __vdso_gettc(const struct vdso_timehands *th, u_int *tc)
 	__asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */
 	*tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
 	return (0);
-#else
-	*tc = 0;
-	return (ENOSYS);
-#endif
 }
 
 #pragma weak __vdso_gettimekeep
diff --git a/lib/msun/arm/fenv.c b/lib/msun/arm/fenv.c
index 9f172d5fd7c9..05b3adb05f81 100644
--- a/lib/msun/arm/fenv.c
+++ b/lib/msun/arm/fenv.c
@@ -32,10 +32,6 @@
 
 #include <machine/acle-compat.h>
 
-#if __ARM_ARCH >= 6
-#define FENV_ARMv6
-#endif
-
 /* When SOFTFP_ABI is defined we are using the softfp ABI. */
 #if defined(__VFP_FP__) && !defined(__ARM_PCS_VFP)
 #define SOFTFP_ABI
@@ -52,7 +48,7 @@ const fenv_t __fe_dfl_env = 0;
 
 
 /* If this is a non-mangled softfp version special processing is required */
-#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI) || !defined(FENV_ARMv6)
+#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI)
 
 /*
  * The following macros map between the softfloat emulator's flags and