From: Bill Schmidt <wschmidt@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com
Subject: Re: [PATCH 04/18] rs6000: Handle some recent MMA builtin changes
Date: Fri, 17 Sep 2021 10:14:36 -0500 [thread overview]
Message-ID: <867f3321-f967-5b06-a84c-6a90065892b7@linux.ibm.com> (raw)
In-Reply-To: <20210916233856.GP1583@gate.crashing.org>
Thanks! I'll remove the elses in the committed patch, along with a TODO
comment for the additional factoring opportunity for when I get to that
stage.
Thanks for all the reviews!
Bill
On 9/16/21 6:38 PM, Segher Boessenkool wrote:
> Hi!
>
> On Wed, Sep 01, 2021 at 11:13:40AM -0500, Bill Schmidt wrote:
>> Peter Bergner recently added two new builtins __builtin_vsx_lxvp and
>> __builtin_vsx_stxvp. These happened to break a pattern in MMA builtins that
>> I had been using to automate gimple folding of MMA builtins. Previously,
>> every MMA function that could be folded had an associated internal function
>> that it was folded into. The LXVP/STXVP builtins are just folded directly
>> into memory operations.
>>
>> Instead of relying on this pattern, this patch adds a new attribute to
>> builtins called "mmaint," which is set for all MMA builtins that have an
>> associated internal builtin. The naming convention that adds _INTERNAL to
>> the builtin index name remains.
>>
>> The rest of the patch is just duplicating Peter's patch, using the new
>> builtin infrastructure.
>> * config/rs6000/rs6000-call.c
>> (rs6000_gimple_fold_new_mma_builtin): Handle RS6000_BIF_LXVP and
>> RS6000_BIF_STXVP.
> It is fine to end a changelog line in a colon.
>
>> + else if (fncode == RS6000_BIF_LXVP)
>> + {
>> + push_gimplify_context (true);
>> + tree offset = gimple_call_arg (stmt, 0);
>> + tree ptr = gimple_call_arg (stmt, 1);
>> + tree lhs = gimple_call_lhs (stmt);
>> + if (TREE_TYPE (TREE_TYPE (ptr)) != vector_pair_type_node)
>> + ptr = build1 (VIEW_CONVERT_EXPR,
>> + build_pointer_type (vector_pair_type_node), ptr);
>> + tree mem = build_simple_mem_ref (build2 (POINTER_PLUS_EXPR,
>> + TREE_TYPE (ptr), ptr, offset));
>> + gimplify_assign (lhs, mem, &new_seq);
>> + pop_gimplify_context (NULL);
>> + gsi_replace_with_seq (gsi, new_seq, true);
>> + return true;
>> + }
> Fwiw, all those cases return, so those "else" are not needed. Also it
> would be nice if this could be factored a bit better, hrm.
>
> Is that "if" in there useful? Maybe add a helper function for it, then?
>
> Anyway: okay for trunk. Thanks!
>
>
> Segher
next prev parent reply other threads:[~2021-09-17 15:14 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 16:13 [PATCHv5 00/18] Replace the Power target-specific builtin machinery Bill Schmidt
2021-09-01 16:13 ` [PATCH 01/18] rs6000: Handle overloads during program parsing Bill Schmidt
2021-09-13 17:17 ` will schmidt
2021-09-13 23:53 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 02/18] rs6000: Move __builtin_mffsl to the [always] stanza Bill Schmidt
2021-09-13 17:53 ` will schmidt
2021-09-16 22:52 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 03/18] rs6000: Handle gimple folding of target built-ins Bill Schmidt
2021-09-13 18:42 ` will schmidt
2021-09-14 22:36 ` Bill Schmidt
2021-09-16 22:58 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 04/18] rs6000: Handle some recent MMA builtin changes Bill Schmidt
2021-09-13 19:02 ` will schmidt
2021-09-16 23:38 ` Segher Boessenkool
2021-09-17 15:14 ` Bill Schmidt [this message]
2021-09-01 16:13 ` [PATCH 05/18] rs6000: Support for vectorizing built-in functions Bill Schmidt
2021-09-13 19:29 ` will schmidt
2021-09-17 12:17 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 06/18] rs6000: Builtin expansion, part 1 Bill Schmidt
2021-10-31 3:24 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 07/18] rs6000: Builtin expansion, part 2 Bill Schmidt
2021-11-01 12:18 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 08/18] rs6000: Builtin expansion, part 3 Bill Schmidt
2021-11-03 1:15 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 09/18] rs6000: Builtin expansion, part 4 Bill Schmidt
2021-11-03 1:52 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 10/18] rs6000: Builtin expansion, part 5 Bill Schmidt
2021-11-04 0:55 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 11/18] rs6000: Builtin expansion, part 6 Bill Schmidt
2021-11-04 1:24 ` Segher Boessenkool
2021-11-07 15:28 ` Bill Schmidt
2021-11-07 21:05 ` Segher Boessenkool
2021-11-08 13:16 ` Bill Schmidt
2021-09-01 16:13 ` [PATCH 12/18] rs6000: Update rs6000_builtin_decl Bill Schmidt
2021-11-05 20:27 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 13/18] rs6000: Miscellaneous uses of rs6000_builtins_decl_x Bill Schmidt
2021-11-05 20:36 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 14/18] rs6000: Debug support Bill Schmidt
2021-11-05 21:34 ` Segher Boessenkool
2021-11-09 15:06 ` Bill Schmidt
2021-09-01 16:13 ` [PATCH 15/18] rs6000: Update altivec.h for automated interfaces Bill Schmidt
2021-11-05 22:08 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 16/18] rs6000: Test case adjustments Bill Schmidt
2021-11-05 22:37 ` Segher Boessenkool
2021-11-11 20:06 ` Bill Schmidt
2021-11-11 20:55 ` Bill Schmidt
2021-09-01 16:13 ` [PATCH 17/18] rs6000: Enable the new builtin support Bill Schmidt
2021-11-05 22:10 ` Segher Boessenkool
2021-09-01 16:13 ` [PATCH 18/18] rs6000: Add escape-newline support for builtins files Bill Schmidt
2021-11-05 23:50 ` Segher Boessenkool
2021-11-08 19:40 ` Bill Schmidt
2021-09-13 13:33 ` [PATCHv5 00/18] Replace the Power target-specific builtin machinery Bill Schmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=867f3321-f967-5b06-a84c-6a90065892b7@linux.ibm.com \
--to=wschmidt@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).