From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id ECA48382FAE0 for ; Wed, 16 Nov 2022 19:21:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECA48382FAE0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=7sQuIjwqHzumKXRZgKLaNQNLqVGVtgUQhcGyLzFQiQQ=; b=YogXxqzPW+q4gQa5z/Zcfeshu8U9BkUT44pVisat2JbVsMvbx0DU0nfp Z4RrfOFwRF1ui7+8Y6Cem4WHPUCEF/6pMxakdGNz3qM5XZQUPPVoTcpom 2f5PISQ220jxuutYBfAOjDcDuTltwqpHj2A4CBuY+b9uQ7iKkt6XBnZLV g=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=marc.glisse@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,169,1665439200"; d="scan'208";a="78580909" Received: from clt-128-93-180-89.vpn.inria.fr ([128.93.180.89]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:21:57 +0100 Date: Wed, 16 Nov 2022 20:21:55 +0100 (CET) From: Marc Glisse To: Hongyu Wang cc: gcc-patches@gcc.gnu.org, hongtao.liu@intel.com Subject: Re: [PATCH] Optimize VEC_PERM_EXPR with same permutation index and operation [PR98167] In-Reply-To: <20221104000432.15254-1-hongyu.wang@intel.com> Message-ID: References: <20221104000432.15254-1-hongyu.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Fri, 4 Nov 2022, Hongyu Wang via Gcc-patches wrote: > This is a follow-up patch for PR98167 > > The sequence > c1 = VEC_PERM_EXPR (a, a, mask) > c2 = VEC_PERM_EXPR (b, b, mask) > c3 = c1 op c2 > can be optimized to > c = a op b > c3 = VEC_PERM_EXPR (c, c, mask) > for all integer vector operation, and float operation with > full permutation. Hello, I assume the "full permutation" condition is to avoid performing some extra operations that would raise exception flags. If so, are there conditions (-fno-trapping-math?) where the transformation would be safe with arbitrary shuffles? -- Marc Glisse