From patchwork Wed Jan 17 17:30:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 188905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:30f:b0:101:a8e8:374 with SMTP id ia15csp64037dyb; Wed, 17 Jan 2024 09:30:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHURg64suMWijLfgteJa1+lwRHBjjlHH1n89eW2amxHCDozcBJ2elKZjvx3n7vSWqX1SamP X-Received: by 2002:ac8:5804:0:b0:42a:6d:d331 with SMTP id g4-20020ac85804000000b0042a006dd331mr3926416qtg.103.1705512658901; Wed, 17 Jan 2024 09:30:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705512658; cv=pass; d=google.com; s=arc-20160816; b=XEoVr27GUibGL4tJfJEZ3U1sXn6xm+kvdmIcbNHOargd+kR+2Enqsoz6P+5D4qHHSk ePzhczuJTVx0A/YlqSNErM+142aVGEz7tjGSyAGk4ahfpIUrRS3Bm7w8SosRXBIfaUzj lq28feGKxsR32rXLhpO+HeV9IW83KbnBkixVSUuXnziq99F4DikJspSMYB9PSad/04sX 1UfCiGm1VnQyJ+OHm5YnX2v8Jt8OXBF99lJnYe9YnDyFm/OB2Fh3yhh2eGYQLllRKQPi uY3WCtzGC48qBc+MtaNn7QBmIOwDBQ3WZZaoDFCeyZHaYBnxQq86YkC3FcWJ/tjEJpag NMtQ== ARC-Message-Signature: i=2; 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-disposition :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=1LWG5ACYpLXI+nmj9X7XBhK4dkYnI1YORE8bGR+673o=; fh=FOh+UTsA0zRpEq95zkUef19gOrEd5td7tlIw4QB6nZU=; b=K7LvQal7R46EAPCqZzNhYTUDnycH7DhlDqbyC/s7H5BO+zRN06LSmANMY7JBtPl+l3 PcRwvZmYybeNQBhf2iTyZuwS6qv5wIs6Mkrf0CtdqAt29qW29+IZ0LXo+6HIprt88D69 yxWPIFcMf9I+K/xuHXfqIBZ8Xb5btOtId2JiJ9FZHuStwD2wziA5iORIKCicG6mMBlEL Ltp2PLKmJwS8guReHC+CCHL20WPKQ+QkK6sae2EtXWWdYb1H706p4P1PDpHtik0qIgr5 4VaO7//NCn9lvapABAofZALFtZptXYlXflQobEl9cthdStXCegp6tCF7egScBr4wFyxz xOcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=QJtg7BYh; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p15-20020a05622a00cf00b00429fc4e840esi4528592qtw.736.2024.01.17.09.30.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:30:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=QJtg7BYh; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98ED43858410 for ; Wed, 17 Jan 2024 17:30:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 4D09D385840F for ; Wed, 17 Jan 2024 17:30:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D09D385840F Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kam.mff.cuni.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D09D385840F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.113.20.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705512616; cv=none; b=qDYy443we+ic+P7qnoCK8rdNN1q88ckrnjHW9Dmejpy5sUd8rdNqzqzzYT/esG4LFAqDGev69kGcVBDr8lKdW36jiFGHcsriiPf3+sbjMzWh/L9HAhY2FrjCMxSEEajDJipX0PGhEJ1rCBRLLiCEfRlE05u69FmBllYIERd9zhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705512616; c=relaxed/simple; bh=TRzFpQ/yf87DlPNvkzww5WpAS5n+ACyffpjkj/I5p9c=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=f+4DrOJRB+uhHEgkZFUwz4YZO/a+zfqPlno61g52X0S0r0ya/mfPCBrpD3jvEg63gY5hSmzDghWnD9oxeYmwgMF01FBetgUai/D4krikHN4HGbbbPp8S4tzh1d+MjBO9GY4yx+n5XcRnZzwbqg0B7nQtlpq3JMeNCfBGyrjJcYA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 69F72283B66; Wed, 17 Jan 2024 18:30:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1705512613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=1LWG5ACYpLXI+nmj9X7XBhK4dkYnI1YORE8bGR+673o=; b=QJtg7BYhtwhgpun2scXfOptFDU224QzYGAUS5op5Y/ywQ9Tc/eNFu+EZcQAQ9PTrqUXCYk u5D3xi39e6VI8bfzVvrMwPdZcYoe0VdBp62Ys856p2MgT7lEk5WYjFNB6ERoKljZatC5WV EN1zW04St6MBQoXxYUEr2RJdGbutoOQ= Date: Wed, 17 Jan 2024 18:30:13 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, crazylht@gmail.com Subject: Fix handling of X86_TUNE_AVOID_512FMA_CHAINS Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: 1788359641714690182 X-GMAIL-MSGID: 1788359641714690182 Hi, I have noticed quite bad pasto in handling of X86_TUNE_AVOID_512FMA_CHAINS. At the moment it is ignored, but X86_TUNE_AVOID_256FMA_CHAINS controls 512FMA too. This patch fixes it, we may want to re-check how that works on AVX512 machines. Bootstrapped/regtested x86_64-linux, will commit it shortly. Honza gcc/ChangeLog: * config/i386/i386-options.cc (ix86_option_override_internal): Fix handling of X86_TUNE_AVOID_512FMA_CHAINS. diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index 3605c2c53fb..b6f634e9a32 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -3248,7 +3248,7 @@ ix86_option_override_internal (bool main_args_p, = (cf_protection_level) (opts->x_flag_cf_protection | CF_SET); } - if (ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS]) + if (ix86_tune_features [X86_TUNE_AVOID_512FMA_CHAINS]) SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 512); else if (ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS]) SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 256);