From patchwork Wed Jan 18 10:48:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 45153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2264643wrn; Wed, 18 Jan 2023 02:49:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvUdKMOjAG0FXD1aZXnbOHDcIfDml5jD4Ox4z8Se8zjT+6pS7/afESiW1plbCmV1fvb/jsW X-Received: by 2002:a17:906:d971:b0:870:7e7d:97a7 with SMTP id rp17-20020a170906d97100b008707e7d97a7mr5959988ejb.72.1674038973782; Wed, 18 Jan 2023 02:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674038973; cv=none; d=google.com; s=arc-20160816; b=VLfrMRS7ebAE7w/iZQaNFeKHfP6fqqrv6YvkMGBi3hB6HbVbePv4c89hlOoq5vKg+/ lPuciuPyiPBoe8qfWbMeBFt/cUzbe2NF2EQ3Ab4cquTgj+cAy701/EREGOvdVSfu6gQC RlpUuZ9oBSyJoGgRvJ4XLy9HtXBXnQC5KXRAbs+ChLoMEdN9EYBYKFKgfRq1VcMBzsCa 76aVWfKBRLXkuBAlHw4iMyeX9zdm7kmVKBSfnYj7d2njqr7+fbG/Df14RqBNfU4IbgEm UP9L4/UDTb3IkF2dqvaczA2PYpNwR4Mvh+I9JdzpPAn9VZsueAIhQT3M9UEG8EA8ze/E 3q6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=IP8WuUoT8rZPI8IRsXEgn8wOUaEziHQxsIcM3V46a6s=; b=B9lVnr+PV4lo80Z8rl4P/pdD2u93076fugJo5ldz+QsPAdgHxAb9dVDu3URO1D6p5F PYRYyupku9MBaAa247Jf4yLePDXWwz+9a/vMnhrcvxpFKlcbHd6ob81gAkoBlDpAsEtq C+U1tIPb79VlfaufHAsCUght/hDVj5ukXDkdUr7OwPalkTTTXvdvjzRgtvTWKFWjYXBC peCwwqZy6fSNoYwIHW7eHWQtwnVZUy4gXHXuAbfXCVRJP9jvWNb4ErUQrvln4+0TFrdH jphbG9txyhoEh7GXn1oO2fXMJ3/fUwn4ypwoSLRtF/EFuXmKHKTlracJzk+xCuS36kY+ aRXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YhiAfDNQ; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dm3-20020a170907948300b007c157940720si35053019ejc.440.2023.01.18.02.49.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 02:49:33 -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=@gcc.gnu.org header.s=default header.b=YhiAfDNQ; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 18C453858C62 for ; Wed, 18 Jan 2023 10:49:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18C453858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674038970; bh=IP8WuUoT8rZPI8IRsXEgn8wOUaEziHQxsIcM3V46a6s=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YhiAfDNQwv7C3MEHRE1h51V7skBS87Sku+X8AL1qOQdmO/ljOQKatYwtcJOm2xYVG MhsO8DiEpi+gVjwc+v58ceDVymuTVZkcvUOFj3CyDEwIgdq2JZDqwZqYmjH+6SaVpW +ygAmKQ5QfgNzGFNn3OCtz2zacqCjFlHQJoMg3P4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 107CA3858C2C for ; Wed, 18 Jan 2023 10:48:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 107CA3858C2C Received: by mail-wr1-x433.google.com with SMTP id d2so13362625wrp.8 for ; Wed, 18 Jan 2023 02:48:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IP8WuUoT8rZPI8IRsXEgn8wOUaEziHQxsIcM3V46a6s=; b=Gs3e7N6tks+F63lJl7IeCNbZG15fdW/d8P4m/Rp+mX0vZttZgvbie6ugeBaTogmUGq +RZQmEkE+QkACAvAhGSvNQlL3zMzbM0uk8BTqeWYU408bKoaP1Rz93QvcsNKOjfoaHLi 0jlqD9CTDScYsm8bKWXMnjCNIvizh3RM2k59d8hq1hoK6G3z/NsXH51ShEFDKvOJb3Qz coq7o5EHegyCPs+ttlvxtazJB5UTP7pzjXFfg2tWawgpSoaWegRdfhq5qBG+ueqwZRVh hqyG+fhky+dPO1YaYABUr99Zs4YhoP0/dQ5ez/JD5EOnpU3uBzpXTGJ0Y0nG53UH7qer DlWg== X-Gm-Message-State: AFqh2kpTHpq/SM6CDzgW1WmW5Rk+d2pZmAQStPOq+Rqu9UxhwdvS6e8Y eoWTZCEInLmILJABd3LYStrz+4pLdLRW6ZY2M4OsdJMHE2WkIQ== X-Received: by 2002:adf:f701:0:b0:2bd:dbb1:7e52 with SMTP id r1-20020adff701000000b002bddbb17e52mr289462wrp.173.1674038925417; Wed, 18 Jan 2023 02:48:45 -0800 (PST) MIME-Version: 1.0 Date: Wed, 18 Jan 2023 16:18:07 +0530 Message-ID: Subject: [aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns. To: gcc Patches , Richard Sandiford X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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 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: Prathamesh Kulkarni via Gcc-patches From: Prathamesh Kulkarni Reply-To: Prathamesh Kulkarni Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755357091087637488?= X-GMAIL-MSGID: =?utf-8?q?1755357091087637488?= Hi Richard, Based on your suggestion in the other thread, the patch uses exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns. Bootstrap+test in progress on aarch64-linux-gnu. Does it look OK ? Thanks, Prathamesh [aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns. gcc/ChangeLog: * gcc/config/aarch64-simd.md (aarch64_simd_vec_set): Use exact_log2 (INTVAL (operands[2])) >= 0 as condition for gating the pattern. (aarch64_simd_vec_copy_lane): Likewise. (aarch64_simd_vec_copy_lane_): Likewise. diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 104088f67d2..7cc8c00f0ec 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -1064,7 +1064,7 @@ (match_operand: 1 "aarch64_simd_nonimmediate_operand" "w,?r,Utv")) (match_operand:VALL_F16 3 "register_operand" "0,0,0") (match_operand:SI 2 "immediate_operand" "i,i,i")))] - "TARGET_SIMD" + "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0" { int elt = ENDIAN_LANE_N (, exact_log2 (INTVAL (operands[2]))); operands[2] = GEN_INT ((HOST_WIDE_INT) 1 << elt); @@ -1093,7 +1093,7 @@ [(match_operand:SI 4 "immediate_operand" "i")]))) (match_operand:VALL_F16 1 "register_operand" "0") (match_operand:SI 2 "immediate_operand" "i")))] - "TARGET_SIMD" + "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0" { int elt = ENDIAN_LANE_N (, exact_log2 (INTVAL (operands[2]))); operands[2] = GEN_INT (HOST_WIDE_INT_1 << elt); @@ -1114,7 +1114,7 @@ [(match_operand:SI 4 "immediate_operand" "i")]))) (match_operand:VALL_F16_NO_V2Q 1 "register_operand" "0") (match_operand:SI 2 "immediate_operand" "i")))] - "TARGET_SIMD" + "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0" { int elt = ENDIAN_LANE_N (, exact_log2 (INTVAL (operands[2]))); operands[2] = GEN_INT (HOST_WIDE_INT_1 << elt);