public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: luoxhu <luoxhu@linux.ibm.com>
To: will schmidt <will_schmidt@vnet.ibm.com>, gcc-patches@gcc.gnu.org
Cc: segher@kernel.crashing.org, wschmidt@linux.ibm.com,
	linkw@gcc.gnu.org, dje.gcc@gmail.com
Subject: Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]
Date: Tue, 1 Sep 2020 19:43:30 +0800	[thread overview]
Message-ID: <f5f3814e-5174-1fab-1d6b-05e201e3167b@linux.ibm.com> (raw)
In-Reply-To: <59f44334a725e2ffb9650b1f2b7f826b4c2d5461.camel@vnet.ibm.com>

Hi,

On 2020/9/1 00:47, will schmidt wrote:
>> +  tmode = TYPE_MODE (TREE_TYPE (arg0));
>> +  mode1 = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0)));
>> +  mode2 = TYPE_MODE ((TREE_TYPE (arg2)));
>> +  gcc_assert (VECTOR_MODE_P (tmode));
>> +
>> +  op0 = expand_expr (arg0, NULL_RTX, tmode, EXPAND_NORMAL);
>> +  op1 = expand_expr (arg1, NULL_RTX, mode1, EXPAND_NORMAL);
>> +  op2 = expand_expr (arg2, NULL_RTX, mode2, EXPAND_NORMAL);
>> +
>> +  if (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode)
>> +    op1 = convert_modes (mode1, GET_MODE (op1), op1, true);
>> +
>> +  op0 = force_reg (tmode, op0);
>> +  op1 = force_reg (mode1, op1);
>> +  op2 = force_reg (mode2, op2);
>> +
>> +  target = gen_reg_rtx (V16QImode);
> Should that be tmode, or is V16QImode always correct here?


Thanks for the review.
Yes, the target should be TImode here, but the followed call
rs6000_expand_vector_insert needs a lot of emit_insns in it, 
using V16QI could reuse most of patterns in existed md files,
after returning from this function, there will be a convert from
V16QImode to TImode to make the type same:

expr.c: convert_move (target, temp, TYPE_UNSIGNED (TREE_TYPE (exp))); 

and I've tested this with V2DI, V2DF V4SI, V4SF, V8HI, V16QI on
Power9-LE and Power8-BE, the result correctness is ensured.
Other comments are modified.  Will update it later if no disagreements
about the implementation.


Thanks,
Xionghu

> 
>> +  rs6000_expand_vector_insert (target, op0, op1, op2);
>> +
>> +  return target;
>> +}

  reply	other threads:[~2020-09-01 11:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31  9:06 Xiong Hu Luo
2020-08-31 12:43 ` Richard Biener
2020-08-31 16:47 ` will schmidt
2020-09-01 11:43   ` luoxhu [this message]
2020-08-31 17:04 ` Segher Boessenkool
2020-09-01  8:09   ` luoxhu
2020-09-01 13:07     ` Richard Biener
2020-09-02  9:26       ` luoxhu
2020-09-02  9:30         ` Richard Biener
2020-09-03  9:20           ` luoxhu
2020-09-03 10:29             ` Richard Biener
2020-09-04  6:16               ` luoxhu
2020-09-04  6:38                 ` luoxhu
2020-09-04  7:19                   ` Richard Biener
2020-09-04  7:23                     ` Richard Biener
2020-09-04  9:18                       ` luoxhu
2020-09-04 10:23                         ` Segher Boessenkool
2020-09-07  5:43                           ` [PATCH v2] " luoxhu
2020-09-07 11:57                             ` Richard Biener
2020-09-08  8:11                               ` luoxhu
2020-09-08  8:26                                 ` Richard Biener
2020-09-09  1:47                                   ` luoxhu
2020-09-09  7:30                                     ` Richard Biener
2020-09-09 13:47                                   ` Segher Boessenkool
2020-09-09 14:28                                     ` Richard Biener
2020-09-09 16:00                                       ` Segher Boessenkool
2020-09-10 10:08                                         ` Richard Biener
2020-09-14  8:05                                           ` luoxhu
2020-09-14  9:47                                             ` Richard Biener
2020-09-14 10:47                                               ` Richard Sandiford
2020-09-14 11:22                                                 ` Richard Biener
2020-09-14 11:49                                                   ` Richard Sandiford
2020-09-14 21:06                                                 ` Segher Boessenkool
2020-09-14 20:59                                               ` Segher Boessenkool
2020-09-15  3:56                                               ` luoxhu
2020-09-15  6:51                                                 ` Richard Biener
2020-09-15 16:16                                                   ` Segher Boessenkool
2020-09-16  8:31                                                     ` Richard Biener
2020-09-16 11:11                                                       ` Segher Boessenkool
2020-09-16  6:15                                                   ` luoxhu
2020-09-16  8:41                                                     ` Richard Biener
2020-09-14 20:21                                           ` Segher Boessenkool
2020-09-01 14:02     ` [PATCH] " Segher Boessenkool

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=f5f3814e-5174-1fab-1d6b-05e201e3167b@linux.ibm.com \
    --to=luoxhu@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=will_schmidt@vnet.ibm.com \
    --cc=wschmidt@linux.ibm.com \
    /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).