git: 4e76e4c301c7 - main - Remove obsolete code gated on _ARM_ARCH_*
Andrew Turner
andrew at FreeBSD.org
Thu Jan 28 10:51:32 UTC 2021
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=4e76e4c301c72698e111580e278872a8323fba50
commit 4e76e4c301c72698e111580e278872a8323fba50
Author: Andrew Turner <andrew at FreeBSD.org>
AuthorDate: 2021-01-28 10:41:45 +0000
Commit: Andrew Turner <andrew at FreeBSD.org>
CommitDate: 2021-01-28 10:41:45 +0000
Remove obsolete code gated on _ARM_ARCH_*
This is all code only run on ARMv4 and ARMv5. Support for these have
been dropped from FreeBSD.
Differential Revision: https://reviews.freebsd.org/D28314
---
lib/libc/arm/string/ffs.S | 28 ----------------------------
lib/libc/arm/string/memset.S | 41 -----------------------------------------
stand/arm/uboot/start.S | 2 --
sys/arm/arm/machdep.c | 2 +-
sys/libkern/arm/ffs.S | 29 -----------------------------
5 files changed, 1 insertion(+), 101 deletions(-)
diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S
index 1e25960d9bec..5756dd81d21d 100644
--- a/lib/libc/arm/string/ffs.S
+++ b/lib/libc/arm/string/ffs.S
@@ -48,38 +48,10 @@ ENTRY(ffs)
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
rsb r1, r0, #0
ands r0, r0, r1
-#ifndef _ARM_ARCH_5
- /*
- * now r0 has at most one set bit, call this X
- * if X = 0, all further instructions are skipped
- */
- adrne r2, .L_ffs_table
- orrne r0, r0, r0, lsl #4 /* r0 = X * 0x11 */
- orrne r0, r0, r0, lsl #6 /* r0 = X * 0x451 */
- rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */
-
- /* now lookup in table indexed on top 6 bits of r0 */
- ldrbne r0, [ r2, r0, lsr #26 ]
-
- RET
-.text;
-.type .L_ffs_table, _ASM_TYPE_OBJECT;
-.L_ffs_table:
-/* 0 1 2 3 4 5 6 7 */
- .byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */
- .byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */
- .byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */
- .byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */
- .byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */
- .byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */
- .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */
- .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */
-#else
itt ne
clzne r0, r0
rsbne r0, r0, #32
RET
-#endif
END(ffs)
.section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S
index 96d2f93183c4..6ac64274db95 100644
--- a/lib/libc/arm/string/memset.S
+++ b/lib/libc/arm/string/memset.S
@@ -105,20 +105,14 @@ ENTRY(memset)
#ifndef _BZERO
orr r3, r3, r3, lsl #8 /* Extend value to 16-bits */
#endif
-#ifdef _ARM_ARCH_5E
tst ip, #0x04 /* Quad-align for armv5e */
-#else
- cmp r1, #0x10
-#endif
#ifndef _BZERO
orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */
#endif
-#ifdef _ARM_ARCH_5E
itt ne
subne r1, r1, #0x04 /* Quad-align if necessary */
strne r3, [ip], #0x04
cmp r1, #0x10
-#endif
blt .Lmemset_loop4 /* If less than 16 then use words */
mov r2, r3 /* Duplicate data */
cmp r1, #0x80 /* If < 128 then skip the big loop */
@@ -127,7 +121,6 @@ ENTRY(memset)
/* Do 128 bytes at a time */
.Lmemset_loop128:
subs r1, r1, #0x80
-#ifdef _ARM_ARCH_5E
itttt ge
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
@@ -148,24 +141,6 @@ ENTRY(memset)
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
-#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
-#endif
bgt .Lmemset_loop128
it eq
RETeq /* Zero length so just exit */
@@ -176,17 +151,10 @@ ENTRY(memset)
.Lmemset_loop32:
subs r1, r1, #0x20
itttt ge
-#ifdef _ARM_ARCH_5E
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
-#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
-#endif
bgt .Lmemset_loop32
it eq
RETeq /* Zero length so just exit */
@@ -195,13 +163,8 @@ ENTRY(memset)
/* Deal with 16 bytes or more */
itt ge
-#ifdef _ARM_ARCH_5E
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
-#else
- stmiage ip!, {r2-r3}
- stmiage ip!, {r2-r3}
-#endif
it eq
RETeq /* Zero length so just exit */
@@ -217,15 +180,11 @@ ENTRY(memset)
it eq
RETeq /* Zero length so just exit */
-#ifdef _ARM_ARCH_5E
/* Compensate for 64-bit alignment check */
adds r1, r1, #0x04
it eq
RETeq
cmp r1, #2
-#else
- cmp r1, #-2
-#endif
strb r3, [ip], #0x01 /* Set 1 byte */
it ge
diff --git a/stand/arm/uboot/start.S b/stand/arm/uboot/start.S
index ede6a620e08f..781d4829df35 100644
--- a/stand/arm/uboot/start.S
+++ b/stand/arm/uboot/start.S
@@ -39,12 +39,10 @@
.globl _start
_start:
-#ifdef _ARM_ARCH_6
mrc p15, 0, ip, c1, c0, 0
orr ip, ip, #(CPU_CONTROL_UNAL_ENABLE)
orr ip, ip, #(CPU_CONTROL_AFLT_ENABLE)
mcr p15, 0, ip, c1, c0, 0
-#endif
/* Save the arguments and return register before calling self_reloc */
push {r0, r1, r9, lr}
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 3296adaaa44b..3d966527599d 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$");
#endif
-#ifndef _ARM_ARCH_6
+#if __ARM_ARCH < 6
#error FreeBSD requires ARMv6 or later
#endif
diff --git a/sys/libkern/arm/ffs.S b/sys/libkern/arm/ffs.S
index 1ddec95de0b1..871ca64b9a84 100644
--- a/sys/libkern/arm/ffs.S
+++ b/sys/libkern/arm/ffs.S
@@ -51,37 +51,8 @@ ENTRY(ffs)
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
rsb r1, r0, #0
ands r0, r0, r1
-#ifndef _ARM_ARCH_5
-
- /*
- * now r0 has at most one set bit, call this X
- * if X = 0, all further instructions are skipped
- */
- adrne r2, .L_ffs_table
- orrne r0, r0, r0, lsl #4 /* r0 = X * 0x11 */
- orrne r0, r0, r0, lsl #6 /* r0 = X * 0x451 */
- rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */
-
- /* now lookup in table indexed on top 6 bits of r0 */
- ldrbne r0, [ r2, r0, lsr #26 ]
-
- RET
-.text;
-.type .L_ffs_table, _ASM_TYPE_OBJECT;
-.L_ffs_table:
-/* 0 1 2 3 4 5 6 7 */
- .byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */
- .byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */
- .byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */
- .byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */
- .byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */
- .byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */
- .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */
- .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */
-#else
clzne r0, r0
rsbne r0, r0, #32
RET
-#endif
END(ffs)
More information about the dev-commits-src-all
mailing list