From patchwork Thu May 21 12:54:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1295190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=xLhDNJUM; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49SV2P45Gtz9sRK for ; Thu, 21 May 2020 22:54:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 57788386F80C; Thu, 21 May 2020 12:54:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57788386F80C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590065690; bh=jpBuyevCRROfcdGwTr6Q4hegvfroRm9O3cfOfjuDDRw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xLhDNJUMLFqoWXlr7xkk9kNQ27lsX73K+mhQecdLbH/EKutyDRTMo3OvNrtDScydm 1ByJba1kVCxBamzGYVHYSHQq0fecsMUHzW2CPEdh6Hq6OJDQ45hyrptOjVB4YWckmP PiwEC4kGvNnwzb6DNZ5Ca8XoXB8z89OJ7Efb2jX8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by sourceware.org (Postfix) with ESMTPS id 9269C3972464 for ; Thu, 21 May 2020 12:54:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9269C3972464 Received: by mail-pj1-x1043.google.com with SMTP id q24so2985724pjd.1 for ; Thu, 21 May 2020 05:54:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jpBuyevCRROfcdGwTr6Q4hegvfroRm9O3cfOfjuDDRw=; b=FpRACbWjA0+PAm3g+lipnfMmVzf/EpasvNe/i0hSQS8Lsfj6NOuGOcHR+a0DDBNh/u fPTOmtayxxem3Xsrc7lpS+5xexC4tZrwzkR7gqFf0d0b1akGigbbZMNsKeiJxxPVGAGp nlEyikCsLDThZr8sBt3ArQWP4kN9MRqr9ddluSxmSgt2WFkK0yexhjVDBlrhRpwoIBnu klgPYzoDGtiFGswye1KePD7nPae6sM2s3oErv4ADIkg4IapKay2HiHLC4FsU5dULSzLH 6rSK2MAVPUkZt8cb3g3BmJSAqvY61Aey7sHSqaxx02G+ziDkbEAwFmCSw/XCcT9awwUw qwtw== X-Gm-Message-State: AOAM5315nbtwZwjoYYbRM4ibgrSopEL5NznubhRPWePODMyTKsMbi9Of +0XL/85ssakGb3UEeoaIBBiaBihr X-Google-Smtp-Source: ABdhPJxIM47YidvyqgS7SKTuf/ZwAiXpNox0u7FrFQxkO/CeOdQyaCsSgTsXsbLzc+cAkNKda+Ijsw== X-Received: by 2002:a17:90b:1082:: with SMTP id gj2mr11796259pjb.225.1590065687444; Thu, 21 May 2020 05:54:47 -0700 (PDT) Received: from gnu-tools-1.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id l23sm2580848pff.80.2020.05.21.05.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 05:54:46 -0700 (PDT) Received: from gnu-tools-1.localdomain (localhost [127.0.0.1]) by gnu-tools-1.localdomain (Postfix) with ESMTP id B12D61C03B5; Thu, 21 May 2020 05:54:45 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] x86: Handle -mavx512vpopcntdq for -march=native Date: Thu, 21 May 2020 05:54:45 -0700 Message-Id: <20200521125445.14526-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Uros Bizjak Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available. PR target/95258 * config/i386/driver-i386.c (host_detect_local_cpu): Detect AVX512VPOPCNTDQ. --- gcc/config/i386/driver-i386.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 7612ddfb846..3a816400729 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -420,6 +420,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) unsigned int has_avx5124fmaps = 0, has_avx5124vnniw = 0; unsigned int has_gfni = 0, has_avx512vbmi2 = 0; unsigned int has_avx512bitalg = 0; + unsigned int has_avx512vpopcntdq = 0; unsigned int has_shstk = 0; unsigned int has_avx512vnni = 0, has_vaes = 0; unsigned int has_vpclmulqdq = 0; @@ -528,6 +529,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) has_vaes = ecx & bit_VAES; has_vpclmulqdq = ecx & bit_VPCLMULQDQ; has_avx512bitalg = ecx & bit_AVX512BITALG; + has_avx512vpopcntdq = ecx & bit_AVX512VPOPCNTDQ; has_movdiri = ecx & bit_MOVDIRI; has_movdir64b = ecx & bit_MOVDIR64B; has_enqcmd = ecx & bit_ENQCMD; @@ -1189,6 +1191,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect"; const char *tsxldtrk = has_tsxldtrk ? " -mtsxldtrk " : " -mno-tsxldtrk"; const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg"; + const char *avx512vpopcntdq = has_avx512vpopcntdq ? " -mavx512vpopcntdq" : " -mno-avx512vpopcntdq"; const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri"; const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b"; const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd"; @@ -1210,9 +1213,9 @@ const char *host_detect_local_cpu (int argc, const char **argv) avx512ifma, avx512vbmi, avx5124fmaps, avx5124vnniw, clwb, mwaitx, clzero, pku, rdpid, gfni, shstk, avx512vbmi2, avx512vnni, vaes, vpclmulqdq, - avx512bitalg, movdiri, movdir64b, waitpkg, cldemote, - ptwrite, avx512bf16, enqcmd, avx512vp2intersect, - serialize, tsxldtrk, NULL); + avx512bitalg, avx512vpopcntdq, movdiri, movdir64b, + waitpkg, cldemote, ptwrite, avx512bf16, enqcmd, + avx512vp2intersect, serialize, tsxldtrk, NULL); } done: