From patchwork Thu Sep 21 07:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hu, Lin1" X-Patchwork-Id: 142758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4667854vqi; Thu, 21 Sep 2023 00:27:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdGMWByE/AA8InJB7mS4Pt95+CAguN8PMUYb/c7kMv3UprshugbinBUQG8tls41UjzuKPQ X-Received: by 2002:a17:906:1053:b0:9ae:4d6d:ba4f with SMTP id j19-20020a170906105300b009ae4d6dba4fmr3143615ejj.42.1695281273635; Thu, 21 Sep 2023 00:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695281273; cv=none; d=google.com; s=arc-20160816; b=gcoUGiqB+AFTqfLPNfW1ceMz1KuqtaugVnv53AUXv8+hpbSKDGTjc3KSGn1zBt1TLZ xDhz6DoVwqMjFpMFvW878xbG5Yr+SlZUslQoaVDg8RIDzP35uGWu0ju7kZAl1ZXF20Mm GLQWvbhWSF+vtvVN6ZcQGRL3HVIp0DU0ZFr1+zLCxjZYAOrlrUIjXPg3ZeXz8dcuHrRO ihSMVd4Lkgb9nbixfTqFhPC/Cj95M9hNbM7JRviSVpkpc+FKGsdYwZRYh2VYEk/WNNYp 15T+2mEEl8wLoERVmr4AZPdXp66/bub0tIOYK9VabDWSoWvr2FnMz81+XYWl9nmLIJ9m Fmtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=Xs3CmYfdZOxfJpI1OsoAZDtOZg6OUuC3QcwI8tf4E+I=; fh=sF/NGAqCthaRflPLk0tS85YHxOxp+1SAOPUzsMi6/xU=; b=rvPF4FEy87OqVsXVJGheixoFREusdt7foekPgrfigYCR8f3GDKjp9fYg+FcavQFRfg r8w95Xz7TQkKKLRgw2f3ECM2Vg+aaaj7BbYnEnU03fsqXAq5BtW4DIj0+sO8B1MAsp/o I3x4GvRqn6i/EvBZKvJI5Sxa1FkBHhoab1itLkmANBe0zDAy0n7e+zqAHesU7ZipJ8oT ub7K+0+/TCF5mmTaJs2cu8kdyD8i/fjNh3RxetIGMLlkrRphqlfAy6jd58JV4weT3N9V sS/GWen2U6Q2BGDMHw5RNujI/Ec8GIaYIgLdCnxM6RFfmRQmgIEghevPtLswq5GIP8tx JxVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=auS06QOL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id rp25-20020a170906d97900b009a9e1e4e467si794592ejb.18.2023.09.21.00.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 00:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=auS06QOL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D1CEC3861883 for ; Thu, 21 Sep 2023 07:24:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id 68A48385703C for ; Thu, 21 Sep 2023 07:22:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68A48385703C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695280959; x=1726816959; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4WjSflmpm+nytvYcfQp5oGl2ohkto/29GbQ7KBJPK9E=; b=auS06QOLtoyNMD8FEHipZzwUi1HezI+6Y3f0Kq4orPKH1sAbapsDxuAh jE96B1y5Nw2kwDOmc+OK6e0uHGV3BxWVZNDjaJaheYL55GLX2TwVnLksk 9pB6sJuJDG2K1ihqVmpH0AYjf7edZPwD+swj0BbTjweJAbHoW8zA3cMbu xVHzlyfoS3Eq0FqzgorBMudy4blM/Q7XFNiKwzf4VGlr+2eSJmjcG5c3u kv3x57AtBz4OLpdke0E5NotsK7nnneEqvwilomRpoO5VhH3wZJXVXn0wu JrVN5XYnVVE1c7XmjSkr7nSKV4PY2iRhG02zWkrL0ihb3Df6jWE0MmA+Q Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="380352159" X-IronPort-AV: E=Sophos;i="6.03,164,1694761200"; d="scan'208";a="380352159" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 00:22:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="817262190" X-IronPort-AV: E=Sophos;i="6.03,164,1694761200"; d="scan'208";a="817262190" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga004.fm.intel.com with ESMTP; 21 Sep 2023 00:22:17 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 6AE49100514D; Thu, 21 Sep 2023 15:22:14 +0800 (CST) From: "Hu, Lin1" To: gcc-patches@gcc.gnu.org Cc: hongtao.liu@intel.com, ubizjak@gmail.com, haochen.jiang@intel.com Subject: [PATCH 18/18] Allow -mno-evex512 usage Date: Thu, 21 Sep 2023 15:20:13 +0800 Message-Id: <20230921072013.2124750-19-lin1.hu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230921072013.2124750-1-lin1.hu@intel.com> References: <20230921072013.2124750-1-lin1.hu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777631256671186413 X-GMAIL-MSGID: 1777631256671186413 From: Haochen Jiang gcc/ChangeLog: * config/i386/i386.opt: Allow -mno-evex512. gcc/testsuite/ChangeLog: * gcc.target/i386/noevex512-1.c: New test. * gcc.target/i386/noevex512-2.c: Ditto. * gcc.target/i386/noevex512-3.c: Ditto. --- gcc/config/i386/i386.opt | 2 +- gcc/testsuite/gcc.target/i386/noevex512-1.c | 13 +++++++++++++ gcc/testsuite/gcc.target/i386/noevex512-2.c | 13 +++++++++++++ gcc/testsuite/gcc.target/i386/noevex512-3.c | 13 +++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/noevex512-1.c create mode 100644 gcc/testsuite/gcc.target/i386/noevex512-2.c create mode 100644 gcc/testsuite/gcc.target/i386/noevex512-3.c diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 6d8601b1f75..34fc167af82 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -1312,5 +1312,5 @@ Target Alias(mtune-ctrl=, use_scatter, ^use_scatter) Enable vectorization for scatter instruction. mevex512 -Target RejectNegative Mask(ISA2_EVEX512) Var(ix86_isa_flags2) Save +Target Mask(ISA2_EVEX512) Var(ix86_isa_flags2) Save Support 512 bit vector built-in functions and code generation. diff --git a/gcc/testsuite/gcc.target/i386/noevex512-1.c b/gcc/testsuite/gcc.target/i386/noevex512-1.c new file mode 100644 index 00000000000..7fd45f15be6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/noevex512-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -march=x86-64 -mavx512f -mno-evex512 -Wno-psabi" } */ +/* { dg-final { scan-assembler-not ".%zmm" } } */ + +typedef double __m512d __attribute__ ((__vector_size__ (64), __may_alias__)); + +__m512d +foo () +{ + __m512d a, b; + a = a + b; + return a; +} diff --git a/gcc/testsuite/gcc.target/i386/noevex512-2.c b/gcc/testsuite/gcc.target/i386/noevex512-2.c new file mode 100644 index 00000000000..1c206e385d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/noevex512-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64 -mavx512bw -mno-evex512" } */ + +#include + +long long +foo (long long c) +{ + register long long a __asm ("k7") = c; + long long b = foo (a); + asm volatile ("" : "+k" (b)); /* { dg-error "inconsistent operand constraints in an 'asm'" } */ + return b; +} diff --git a/gcc/testsuite/gcc.target/i386/noevex512-3.c b/gcc/testsuite/gcc.target/i386/noevex512-3.c new file mode 100644 index 00000000000..10e00c2d61c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/noevex512-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=x86-64 -Wno-psabi -mavx512f" } */ +/* { dg-final { scan-assembler-not ".%zmm" } } */ + +typedef double __m512d __attribute__ ((__vector_size__ (64), __may_alias__)); + +__attribute__ ((target ("no-evex512"))) __m512d +foo () +{ + __m512d a, b; + a = a + b; + return a; +}