Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 13:46:26 +0100
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        freebsd-arm@freebsd.org
Subject:   [RFC] Add and armv7hf TARGET_ARCH
Message-ID:  <20141006134626.59cc5573@bender.lan>

next in thread | raw e-mail | index | archive | help
--MP_/zm6LfqDX0bxY7WsUXeQjGKV
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I'm interested in peoples opinion on creating a new TARGET_ARCH to
target ARMv7 SoCs. This will target all the current Cortex-A chips we
support but not the Raspberry Pi. My intention with this is to have it
become the tier 1 arm platform.

This platform will support 32-bit Cortex-A based SoCs with a VFP
unit. As it would be targeting ARMv7 we could look at supporting
Thumb-2.

As the VFP unit is optional and future SoCs without it will only be
supported by the armv6 TARGET_ARCH, however I would expect almost all
ARMv7 designs to include it.

There is a downside to this, and as far as I know the problems are:
 * It could be confusing to figure out which TARGET_ARCH you need.
 * The Raspberry Pi will not be supported as its core is too old.

I've attached my patch to build as armv7hf. It has been tested on a
Wandboard Quad.

Comments?

Andrew

--MP_/zm6LfqDX0bxY7WsUXeQjGKV
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=armv7hf.diff

Index: Makefile
===================================================================
--- Makefile	(revision 272619)
+++ Makefile	(working copy)
@@ -168,7 +168,7 @@
 _TARGET_ARCH=	${TARGET:S/pc98/i386/}
 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
     ${TARGET_ARCH} != ${MACHINE_ARCH}
-_TARGET=		${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/}
+_TARGET=		${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/}
 .endif
 .if defined(TARGET) && !defined(_TARGET)
 _TARGET=${TARGET}
@@ -374,7 +374,7 @@
 #
 .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
 TARGETS?=amd64 arm i386 mips pc98 powerpc sparc64
-TARGET_ARCHES_arm?=	arm armeb armv6 armv6hf
+TARGET_ARCHES_arm?=	arm armeb armv6 armv7hf
 TARGET_ARCHES_mips?=	mipsel mips mips64el mips64 mipsn32
 TARGET_ARCHES_powerpc?=	powerpc powerpc64
 TARGET_ARCHES_pc98?=	i386
Index: Makefile.inc1
===================================================================
--- Makefile.inc1	(revision 272619)
+++ Makefile.inc1	(working copy)
@@ -140,7 +140,7 @@
 VERSION=	FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
 .endif
 
-KNOWN_ARCHES?=	amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
+KNOWN_ARCHES?=	amd64 arm armeb/arm armv6/arm armv7hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
 .if ${TARGET} == ${TARGET_ARCH}
 _t=		${TARGET}
 .else
Index: contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp	(revision 272619)
+++ contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp	(working copy)
@@ -2516,7 +2516,9 @@
 
   // If we have T2 ops, we can materialize the address directly via movt/movw
   // pair. This is always cheaper.
-  if (Subtarget->useMovt()) {
+  if (Subtarget->useMovt() &&
+      (Subtarget->getTargetTriple().getOS() != Triple::FreeBSD ||
+       getTargetMachine().getRelocationModel() != Reloc::Static)) {
     ++NumMovwMovt;
     // FIXME: Once remat is capable of dealing with instructions with register
     // operands, expand this into two nodes.
Index: gnu/usr.bin/binutils/Makefile.inc0
===================================================================
--- gnu/usr.bin/binutils/Makefile.inc0	(revision 272619)
+++ gnu/usr.bin/binutils/Makefile.inc0	(working copy)
@@ -7,7 +7,7 @@
 VERSION=	"2.17.50 [FreeBSD] 2007-07-03"
 
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .else
 TARGET_CPUARCH=${MACHINE_CPUARCH}
 .endif
Index: gnu/usr.bin/cc/Makefile.tgt
===================================================================
--- gnu/usr.bin/cc/Makefile.tgt	(revision 272619)
+++ gnu/usr.bin/cc/Makefile.tgt	(working copy)
@@ -4,7 +4,7 @@
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
 
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .else
 TARGET_CPUARCH=${MACHINE_CPUARCH}
 .endif
Index: gnu/usr.bin/gdb/Makefile.inc
===================================================================
--- gnu/usr.bin/gdb/Makefile.inc	(revision 272619)
+++ gnu/usr.bin/gdb/Makefile.inc	(working copy)
@@ -21,7 +21,7 @@
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
 
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .else
 TARGET_CPUARCH=${MACHINE_CPUARCH}
 .endif
Index: gnu/usr.bin/gdb/libgdb/Makefile
===================================================================
--- gnu/usr.bin/gdb/libgdb/Makefile	(revision 272619)
+++ gnu/usr.bin/gdb/libgdb/Makefile	(working copy)
@@ -4,7 +4,7 @@
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
 
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .else
 TARGET_CPUARCH=${MACHINE_CPUARCH}
 .endif
Index: lib/clang/clang.build.mk
===================================================================
--- lib/clang/clang.build.mk	(revision 272619)
+++ lib/clang/clang.build.mk	(working copy)
@@ -30,8 +30,8 @@
 TARGET_ABI=	unknown
 .endif
 
-TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-${TARGET_ABI}-freebsd11.0
-BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-unknown-freebsd11.0
+TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/:C/armv7hf/armv7/}-${TARGET_ABI}-freebsd11.0
+BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/:C/armv7hf/armv7/}-unknown-freebsd11.0
 CFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
 		-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
 		-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
Index: lib/libc/arm/aeabi/Makefile.inc
===================================================================
--- lib/libc/arm/aeabi/Makefile.inc	(revision 272619)
+++ lib/libc/arm/aeabi/Makefile.inc	(working copy)
@@ -9,7 +9,7 @@
 SRCS+=	aeabi_double.c		\
 	aeabi_float.c
 .endif
-.if ${MACHINE_ARCH:Marmv6*}
+.if ${MACHINE_ARCH:Marmv[67]*}
 SRCS+=	aeabi_vfp_double.S	\
 	aeabi_vfp_float.S
 .endif
Index: lib/libkvm/Makefile
===================================================================
--- lib/libkvm/Makefile	(revision 272619)
+++ lib/libkvm/Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 .if defined(TARGET_ARCH) && !defined(COMPAT_32BIT)
 KVM_XARCH=${TARGET_ARCH}
-KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .else
 KVM_XARCH=${MACHINE_ARCH}
 KVM_XCPUARCH=${MACHINE_CPUARCH}
Index: share/mk/sys.mk
===================================================================
--- share/mk/sys.mk	(revision 272619)
+++ share/mk/sys.mk	(working copy)
@@ -13,7 +13,7 @@
 # and/or endian.  This is called MACHINE_CPU in NetBSD, but that's used
 # for something different in FreeBSD.
 #
-MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
+MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
 .endif
 
 # If the special target .POSIX appears (without prerequisites or
Index: usr.bin/xlint/Makefile.inc
===================================================================
--- usr.bin/xlint/Makefile.inc	(revision 272619)
+++ usr.bin/xlint/Makefile.inc	(working copy)
@@ -8,7 +8,7 @@
 # These assignments duplicate much of the functionality of
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=	${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/}
+TARGET_CPUARCH=	${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6|v7)?(eb|hf)?/arm/}
 .else
 TARGET_CPUARCH=	${MACHINE_CPUARCH}
 TARGET_ARCH=	${MACHINE_ARCH}

--MP_/zm6LfqDX0bxY7WsUXeQjGKV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141006134626.59cc5573>