From patchwork Thu Oct 26 10:25:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 830564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465186-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wTOCK56i"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yN37f3n4wz9t2r for ; Thu, 26 Oct 2017 21:26:03 +1100 (AEDT) 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=Aokv32ws0EHQqHtci0CKaBz6Bq7R9OsLgOaqC+9wpIpjHk13XNVxv a0cNStoOpcEO6D49YnjA5uv9CJEQoY28+Ecaih27sGP08M2PkvnYlL4RJKjsQoAR OSXDwe9tR8uAymtrxA7YHzxali7nzAbap4JvfrEbV9PhpTeEdhwqGU= 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:subject:date:message-id:mime-version:content-type; s= default; bh=F+zWNdv1NiC3AGZbhhKiIa5+zBA=; b=wTOCK56iMGhjDbGMZyE6 cFWVkTVuP0nKz+5SnCZY8EcuqzmQoS7kvzY3CNuEzTbXayOkSoibOybMRyTiM47e 1tsJf3kuvQ2FTiSucQYNT+JKRL64q8IiZqXAL5/BoXjXngdkU/ElimlYVvIBcj5L K/XJ/Sx01rI/OpQYkaAdouU= Received: (qmail 84400 invoked by alias); 26 Oct 2017 10:25:55 -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 84385 invoked by uid 89); 26 Oct 2017 10:25:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Studio, studio 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; Thu, 26 Oct 2017 10:25:48 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 4A23FD84 for ; Thu, 26 Oct 2017 12:25:40 +0200 (CEST) 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 wU0hdampf5YS for ; Thu, 26 Oct 2017 12:25:38 +0200 (CEST) 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 12704D83 for ; Thu, 26 Oct 2017 12:25:38 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id v9QAPYGP004250; Thu, 26 Oct 2017 12:25:34 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [build] Use -xbrace_comment=no with recent Solaris/x86 as Date: Thu, 26 Oct 2017 12:25:34 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Recent versions of Solaris/x86 as (based on Studio 12.6 fbe) support AVX512 insns, but with a caveat as explained in as(1): -xbrace_comment=yes The assembler treats the text within the braces {} as comments. If you want the text within braces to be treated as regular AVX512 instruction, place the text within double braces {{}}. This was done for backwards compatibility reasons, it seems. To have full compatiblity with gas syntax, one needs to pass -xbrace_comment=no. The following patch checks if the assembler used supports that option and passes it on if so. Bootstrapped without regressions on i386-pc-solaris2.1[01]. Will install shortly and backport to the gcc-7 and gcc-6 branches. Rainer # HG changeset patch # Parent bbb7e8e9e5d2b76cd92a4ae42703471b2a14f898 Use -xbrace_comment=no with recent Solaris/x86 as diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -65,8 +65,16 @@ along with GCC; see the file COPYING3. #define ASM_CPU64_DEFAULT_SPEC "-xarch=generic64" #endif +/* Since Studio 12.6, as needs -xbrace_comment=no so its AVX512 syntax is + fully compatible with gas. */ +#ifdef HAVE_AS_XBRACE_COMMENT_OPTION +#define ASM_XBRACE_COMMENT_SPEC "-xbrace_comment=no" +#else +#define ASM_XBRACE_COMMENT_SPEC "" +#endif + #undef ASM_CPU_SPEC -#define ASM_CPU_SPEC "%(asm_cpu_default)" +#define ASM_CPU_SPEC "%(asm_cpu_default) " ASM_XBRACE_COMMENT_SPEC /* Don't include ASM_PIC_SPEC. While the Solaris 10+ assembler accepts -K PIC, it gives many warnings: diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4033,6 +4033,11 @@ foo: nop ;; esac + gcc_GAS_CHECK_FEATURE([-xbrace_comment], gcc_cv_as_ix86_xbrace_comment,, + [-xbrace_comment=no], [.text],, + [AC_DEFINE(HAVE_AS_XBRACE_COMMENT_OPTION, 1, + [Define if your assembler supports -xbrace_comment option.])]) + # Test if the assembler supports the section flag 'e' for specifying # an excluded section. gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e,