Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Sep 2017 17:58:57 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323934 - in head/sys/arm: arm include
Message-ID:  <201709221758.v8MHwvpa073759@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Sep 22 17:58:57 2017
New Revision: 323934
URL: https://svnweb.freebsd.org/changeset/base/323934

Log:
  Detect NEON and set HWCAP_NEON if present.
  
  Reviewed by:	andrew, ian
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D12389

Modified:
  head/sys/arm/arm/vfp.c
  head/sys/arm/include/elf.h

Modified: head/sys/arm/arm/vfp.c
==============================================================================
--- head/sys/arm/arm/vfp.c	Fri Sep 22 17:57:38 2017	(r323933)
+++ head/sys/arm/arm/vfp.c	Fri Sep 22 17:58:57 2017	(r323934)
@@ -144,6 +144,11 @@ vfp_init(void)
 					    initial_fpscr;
 				}
 			}
+
+			if ((tmp & VMVFR1_LS_MASK) >> VMVFR1_LS_OFF == 1 &&
+			    (tmp & VMVFR1_I_MASK) >> VMVFR1_I_OFF == 1 &&
+			    (tmp & VMVFR1_SP_MASK) >> VMVFR1_SP_OFF == 1)
+				elf_hwcap |= HWCAP_NEON;
 		}
 
 		/* initialize the coprocess 10 and 11 calls

Modified: head/sys/arm/include/elf.h
==============================================================================
--- head/sys/arm/include/elf.h	Fri Sep 22 17:57:38 2017	(r323933)
+++ head/sys/arm/include/elf.h	Fri Sep 22 17:58:57 2017	(r323934)
@@ -117,6 +117,7 @@ __ElfType(Auxinfo);
 
 /* Flags passed in AT_HWCAP. */
 #define	HWCAP_VFP		0x00000040
+#define	HWCAP_NEON		0x00001000
 #define	HWCAP_VFPv3		0x00002000
 #define	HWCAP_VFPv3D16		0x00004000
 #define	HWCAP_VFPD32		0x00080000



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