From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by sourceware.org (Postfix) with ESMTPS id 9650E388A82B; Thu, 3 Sep 2020 10:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9650E388A82B Received: by mail-ed1-x542.google.com with SMTP id l21so2119351eds.7; Thu, 03 Sep 2020 03:30:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1NHtXL83tsEk8Bhnj23PzWjaJb6VakBXUqxcRR2OX0s=; b=d4tMNOeVnIHyXO4VLQ3lqo9T9xtrlem32uGQbsjkT1fgMpsehpfi2wBJ8aL3C+wjZS uAt+kPKYKiF57WZpBJ3uqPOY0wx8FnZyllT/2qZBlDAq9S/+IaBPJWP/HrraA78hQXtb JdWXNoEVptp8/w+MM5sljtGoPjYUZzmWYfTukveUfKYA9qFq+kekK+6g5wU2xtGcxdsf VXoZb0LFeVYC6f/AoiFK9gqLKPhl5zCzP5W0SkMb1gdJcOj50gVwQIJnokQ6QZEyQBDi Yom11IYhSTbkxYbWNv25mGXmLLdfN56Z1J0e1lQLnidqy8MtBlu4KrySaQzQUlK6JP5F Z2lw== X-Gm-Message-State: AOAM532UGJekfokm5H7vLSovFMtKMipAz+3TcVfapOVIBgMEkkBkuWwD kuOX2vjHTsjt71PprNkk7fFudnj75D6CLHe7DvU= X-Google-Smtp-Source: ABdhPJxn1wYLI6O8528bFt9rxQjzs9u7ZHZwp1vyPNFxrBIa8ph0IfZQBt7+gZAJrBjcwD1isZDzzNO9gtzF7ZIiWqY= X-Received: by 2002:a50:84a2:: with SMTP id 31mr2413900edq.138.1599129000677; Thu, 03 Sep 2020 03:30:00 -0700 (PDT) MIME-Version: 1.0 References: <20200831090647.152432-1-luoxhu@linux.ibm.com> <20200831170414.GJ28786@gate.crashing.org> <3aec8b6f-8cf5-bd48-eb4e-c7b82e88dcd7@linux.ibm.com> <53017f5c-d81b-6fe2-6c5d-1496249313f1@linux.ibm.com> <599b6eff-42fc-82ef-c822-f3502997798a@linux.ibm.com> In-Reply-To: <599b6eff-42fc-82ef-c822-f3502997798a@linux.ibm.com> From: Richard Biener Date: Thu, 3 Sep 2020 12:29:49 +0200 Message-ID: Subject: Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251] To: luoxhu Cc: Segher Boessenkool , Bill Schmidt , GCC Patches , linkw@gcc.gnu.org, David Edelsohn Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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-List-Received-Date: Thu, 03 Sep 2020 10:30:02 -0000 On Thu, Sep 3, 2020 at 11:20 AM luoxhu wrote: > > > > On 2020/9/2 17:30, Richard Biener wrote: > >> so maybe bypass convert_vector_to_array_for_subscript for special circumstance > >> like "i = v[n%4]" or "v[n&3]=i" to generate vec_extract or vec_insert builtin > >> call a relative simpler method? > > I think you have it backward. You need to work with what > > convert_vector_to_array_for_subscript > > gives and deal with it during RTL expansion / optimization to generate > > more optimal > > code for power. The goal is to have as little target specific > > builtins during the GIMPLE > > optimization phase (because we cannot work out its semantics in optimizers). > > OK, got it, will add optabs vec_insert and expand "VIEW_CONVERT_EXPR(v1)[_1] = i_6(D);" > expressions to rs6000_expand_vector_insert instead of builtin call. > vec_extract already has optabs and "i = v[n%4]" should be in another patch > after this. There is already vec_set and vec_extract - the question is whether the expander tries those for variable index. Richard. > > Thanks, > Xionghu >