From owner-svn-src-all@freebsd.org Tue Jan 31 05:27:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42A1CC9B28; Tue, 31 Jan 2017 05:27:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 39ED61733; Tue, 31 Jan 2017 05:27:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 20059D644D1; Tue, 31 Jan 2017 16:26:56 +1100 (AEDT) Date: Tue, 31 Jan 2017 16:26:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern In-Reply-To: <201701310326.v0V3QW30024375@repo.freebsd.org> Message-ID: <20170131153411.G1061@besplex.bde.org> References: <201701310326.v0V3QW30024375@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=uODR78-PWboclYSAja4A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 05:27:05 -0000 On Tue, 31 Jan 2017, Conrad E. Meyer wrote: > Log: > calculate_crc32c: Add SSE4.2 implementation on x86 This breaks building with gcc-4.2.1, and depends on using non-kernel clang headers for clang. > Modified: head/sys/conf/files.amd64 > ============================================================================== > --- head/sys/conf/files.amd64 Tue Jan 31 01:55:29 2017 (r313005) > +++ head/sys/conf/files.amd64 Tue Jan 31 03:26:32 2017 (r313006) > @@ -593,6 +593,11 @@ compat/ndis/subr_pe.c optional ndisapi > compat/ndis/subr_usbd.c optional ndisapi pci > compat/ndis/winx64_wrap.S optional ndisapi pci > # > +crc32_sse42.o standard \ I don't want it, but it is standard. > + dependency "$S/libkern/x86/crc32_sse42.c" \ > + compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ -msse4 is not supported by gcc-4.2.1, Removing nostdinc pollutes the build with host headers, and the one needed might not be installed, and it doesn't exist for gcc-4.2.1. Similarly for i386. > Modified: head/sys/libkern/crc32.c > ============================================================================== > --- head/sys/libkern/crc32.c Tue Jan 31 01:55:29 2017 (r313005) > +++ head/sys/libkern/crc32.c Tue Jan 31 03:26:32 2017 (r313006) > @@ -46,8 +46,14 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include Style bug. libkern.h is part if systm.h. > #include Ordering bug. systm.h is a prerequisite for all kernel headers except param.h, since it defines macros which might be used by other headers. > Added: head/sys/libkern/x86/crc32_sse42.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/libkern/x86/crc32_sse42.c Tue Jan 31 03:26:32 2017 (r313006) > @@ -0,0 +1,288 @@ > ... > +#ifdef USERSPACE_TESTING > +#include > +#else > +#include > +#include > +#include > +#include > +#endif Style and ordering bugs, as above. > + > +#include This header is outside of the kernel source tree. It is not even in /usr/include, but clang finds it in: crc32_sse42.o: /usr/bin/../lib/clang/3.9.0/include/nmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/smmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/tmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/pmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/emmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/xmmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/mmintrin.h \ /usr/bin/../lib/clang/3.9.0/include/f16cintrin.h \ /usr/bin/../lib/clang/3.9.0/include/popcntintrin.h nmmintrin.h doesn't exist for gcc-4.2.1. gcc-4.2.1 has some of the other intrin.h files, but they aren't installed in FreeBSD-9, and of course they don't support newer SSE. Inline asm is much less unportable than intrinsics. kib used the correct method of .byte's in asms to avoid depending on assembler support for newer instructions. .byte is still used for clflush on amd64 and i386. It used to be used for invpcid on amd64. I can't find where it is or was used for xsave stuff. Bruce