From patchwork Fri Dec 9 09:37:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 87399 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp213848qgi; Fri, 9 Dec 2016 01:38:19 -0800 (PST) X-Received: by 10.99.135.200 with SMTP id i191mr140891818pge.18.1481276299702; Fri, 09 Dec 2016 01:38:19 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 1si33020488plg.120.2016.12.09.01.38.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2016 01:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443863-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443863-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443863-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=G5nQoNzhqPPPG43E L3dmfV0mcf8huea7BccE6NKvcYInTXICr/UImOxfbKccLuDz1A4FqYmDEv1En3Jy AfZzv8A32VP+c/JxQXte/D8EE/5VYwZ3YTcDdRvqC3redyqiiN7DzJJPKhjygNx0 mGehDaFO02eGIWeY7CTk1bMRUrs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=GnEsnw8iHiccz5cGsiHcco 9XPwk=; b=EuULNAtrM4n2AJCpz3kMgZfMQVduqhUlfmL+aCfXWt4fXnevHh1VMU rF5NXS1viT9JpIVJNFYXo4RRjJsWgch1SQ4AtdU7WP8AhH2RhGcBJxcH++3q4udz g00DI/9UW8NBiiOAbYdPF/00KqGtHh56Mbnwu6oDC88R996mfE9/s= Received: (qmail 87152 invoked by alias); 9 Dec 2016 09:38:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 87032 invoked by uid 89); 9 Dec 2016 09:38:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=aeshashc, UD:aeshash.c, aeshash.c, bucket X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Dec 2016 09:37:48 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 125FEBB6; Fri, 9 Dec 2016 10:37:45 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IS5IvOQoc4LR; Fri, 9 Dec 2016 10:37:41 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 26300BB5; Fri, 9 Dec 2016 10:37:41 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id uB99beL2027506; Fri, 9 Dec 2016 10:37:40 +0100 (MET) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches , "gofrontend-dev\@googlegroups.com" Subject: Re: libgo patch committed: Copy hash code from Go 1.7 runtime References: Date: Fri, 09 Dec 2016 10:37:40 +0100 In-Reply-To: (Ian Lance Taylor's message of "Thu, 8 Dec 2016 08:37:56 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Ian, > This patch to libgo copies the memory hashing code from the Go 1.7 > runtime. This is particular important because we earlier copied the > hashmap code from Go 1.7, and that changed hash table sizes from prime > numbers to powers of two. The memory hashing code used before this > patch was fine for prime numbers but for powers of two tended to hash > many values to the same bucket, making maps much much slower than they > should be. > > I rewrote the AES hashing code from gc assembler to C code using > intrinsics. The resulting code generates the same hash code for the > same input as the gc code--that doesn't matter as such, but testing it > ensures that the C code does something useful. > > I changed mips64pe32le to mips64p32le in configure script--noticed > during CL review. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu, both with > and without the AES hashing code. Committed to mainline. this broke Solaris in two different ways: * On both sparc and x86, libgo fails to compile: In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:114:0, from /vol/gcc/src/hg/trunk/local/libgo/runtime/aeshash.c:7: ./runtime.inc:8:12: error: expected identifier or '(' before numeric constant #define m1 3168982561 ^ ./runtime.inc:782:11: note: in expansion of macro 'm1' uint32_t m1; ^~ ./runtime.inc:9:12: error: expected identifier or '(' before numeric constant #define m2 3339683297 ^ ./runtime.inc:783:11: note: in expansion of macro 'm2' uint32_t m2; ^~ ./runtime.inc:10:12: error: expected identifier or '(' before numeric constant #define m3 832293441 ^ ./runtime.inc:784:11: note: in expansion of macro 'm3' uint32_t m3; ^~ ./runtime.inc:11:12: error: expected identifier or '(' before numeric constant #define m4 2336365089 ^ ./runtime.inc:785:11: note: in expansion of macro 'm4' uint32_t m4; ^~ This is similar to what we had with c[01] before, and fixed in the same way: * Once the build completes, on Solaris/x86 with /bin/as every single Go execution test FAILs: ld.so.1: a.out: fatal: /var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libgo/.libs/libgo.so.10: hardware capability (CA_SUNW_HW_1) unsupported: 0x4400000 [ AES SSSE3 ] /vol/gcc/src/hg/trunk/local/libgo/testsuite/gotest[638]: wait: 19831: Killed /vol/gcc/src/hg/trunk/local/libgo/testsuite/gotest[643]: wait: 19832: Terminated /bin/ksh: 9035: Killed FAIL: bufio ld.so.1: array-1.x: fatal: /var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/./libgo/.libs/libgo.so.10: hardware capability (CA_SUNW_HW_1) unsupported: 0x4400000 [ AES SSSE3 ] FAIL: go.go-torture/execute/array-1.go execution, -O0 Again, this is a known issue, previously in libitm and recently in libgfortran. The latter is fixed by my (still unreviewed) patch https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00336.html and can be fixed for libgo along the same lines (on top of the libgfortran etc. one): 2016-12-09 Rainer Orth * configure.ac: Call GCC_CHECK_LINKER_HWCAP. * Makefile.am (AM_LDFLAGS): Initialize to HWCAP_LDFLAGS. [USING_SPLIT_STACK]: Add to AM_LDFLAGS. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University # HG changeset patch # Parent b803ae8e678ea6de73d9892aad7b4b33740ae81a Disable hwcaps on libgo diff --git a/libgo/Makefile.am b/libgo/Makefile.am --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -46,8 +46,10 @@ AM_CFLAGS = -fexceptions -fnon-call-exce -I $(srcdir)/../libgcc -I $(srcdir)/../libbacktrace \ -I $(MULTIBUILDTOP)../../gcc/include +AM_LDFLAGS = $(HWCAP_LDFLAGS) + if USING_SPLIT_STACK -AM_LDFLAGS = -XCClinker $(SPLIT_STACK) +AM_LDFLAGS += -XCClinker $(SPLIT_STACK) endif # Multilib support. diff --git a/libgo/configure.ac b/libgo/configure.ac --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -430,6 +430,9 @@ case "$target" in esac AC_SUBST(OSLDFLAGS) +dnl Check linker hardware capability support. +GCC_CHECK_LINKER_HWCAP + dnl Use -fsplit-stack when compiling C code if available. AC_CACHE_CHECK([whether -fsplit-stack is supported], [libgo_cv_c_split_stack_supported],