bsd.cpu.mk: Simplify armv[67] support

Drop a clause that's no longer relevant to v4/v5. Drop support for
softfloat for v[45]. Simplify soft float expression by assuming we're
always either armv6 or armv7.

Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38584
This commit is contained in:
Warner Losh 2023-02-14 09:49:26 -07:00
parent e88e989439
commit 3ae78d66d9

View File

@ -103,9 +103,9 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
_CPUCFLAGS = -mfloat-abi=softfp
. elif ${CPUTYPE} == "cortexa"
_CPUCFLAGS = -march=armv7 -mfpu=vfp
. elif ${CPUTYPE:Marmv[4567]*} != ""
. elif ${CPUTYPE:Marmv[67]*} != ""
# Handle all the armvX types that FreeBSD runs:
# armv4, armv4t, armv5, armv5te, armv6, armv6t2, armv7, armv7-a, armv7ve
# armv6, armv6t2, armv7, armv7-a, armv7ve
# they require -march=. All the others require -mcpu=.
_CPUCFLAGS = -march=${CPUTYPE}
. else
@ -292,17 +292,11 @@ MACHINE_CPU += armv6
. if ${MACHINE_ARCH:Marmv7*} != ""
MACHINE_CPU += armv7
. endif
# armv6 and armv7 are a hybrid. It can use the softfp ABI, but doesn't emulate
# floating point in the general case, so don't define softfp for it at this
# time. arm is pure softfp, so define it for them.
. if ${MACHINE_ARCH:Marmv[67]*} == ""
MACHINE_CPU += softfp
. endif
# Normally armv6 and armv7 are hard float ABI from FreeBSD 11 onwards. However
# when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow building of
# soft-float ABI libraries. In this case, we have to add the -mfloat-abi=softfp
# to force that.
. if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
. if defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
# Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI
# not a nice optimization. Please note: softfp ABI uses hardware floating
# instructions, but passes arguments to function calls in integer regsiters.