public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: 钟居哲 <juzhe.zhong@rivai.ai>
To: richard.sandiford <richard.sandiford@arm.com>,
	 rdapp.gcc <rdapp.gcc@gmail.com>
Cc: rguenther <rguenther@suse.de>,  gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Re: [PATCH] expmed: Perform mask extraction via QImode [PR112773].
Date: Wed, 13 Dec 2023 22:07:25 +0800	[thread overview]
Message-ID: <1A2D44B4D6633B55+202312132207248705120@rivai.ai> (raw)
In-Reply-To: <mptfs066vum.fsf@arm.com>

[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]

Thanks Richard.

LGTM for RISC-V part.

Thanks Robin for fixing it.



juzhe.zhong@rivai.ai
 
From: Richard Sandiford
Date: 2023-12-13 22:05
To: Robin Dapp
CC: Richard Biener; gcc-patches; juzhe.zhong\@rivai.ai
Subject: Re: [PATCH] expmed: Perform mask extraction via QImode [PR112773].
Robin Dapp <rdapp.gcc@gmail.com> writes:
> @@ -1758,16 +1759,19 @@ extract_bit_field_1 (rtx str_rtx, poly_uint64 bitsize, poly_uint64 bitnum,
>    if (VECTOR_MODE_P (outermode) && !MEM_P (op0))
>      {
>        scalar_mode innermode = GET_MODE_INNER (outermode);
>        enum insn_code icode
>  = convert_optab_handler (vec_extract_optab, outermode, innermode);
>        poly_uint64 pos;
> -      if (icode != CODE_FOR_nothing
> -   && known_eq (bitsize, GET_MODE_BITSIZE (innermode))
> -   && multiple_p (bitnum, GET_MODE_BITSIZE (innermode), &pos))
> +      if ((icode != CODE_FOR_nothing
> +    && known_eq (bitsize, GET_MODE_PRECISION (innermode))
> +    && multiple_p (bitnum, GET_MODE_PRECISION (innermode), &pos)))
 
This adds an extra, unnecessary layer of bracketing.  OK for the
target-independent parts without that.
 
Thanks,
Richard
 
>  {
>    class expand_operand ops[3];
>  
> -   create_output_operand (&ops[0], target, innermode);
> +   create_output_operand (&ops[0], target,
> + insn_data[icode].operand[0].mode);
>    ops[0].target = 1;
>    create_input_operand (&ops[1], op0, outermode);
>    create_integer_operand (&ops[2], pos);
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/pr112773.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/pr112773.c
> new file mode 100644
> index 00000000000..5f7374b0040
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/pr112773.c
> @@ -0,0 +1,20 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-march=rv32gcv_zvl256b -mabi=ilp32d -O3" } */
> +
> +long long a;
> +int b, c;
> +int *d;
> +void e(unsigned f) {
> +  for (;; ++c)
> +    if (f) {
> +      a = 0;
> +      for (; a <= 3; a++) {
> +        f = 0;
> +        for (; f <= 0; f++)
> +          if ((long)a)
> +            break;
> +      }
> +      if (b)
> +        *d = f;
> +    }
> +}
 

      reply	other threads:[~2023-12-13 14:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 10:55 Robin Dapp
2023-12-04 14:11 ` Richard Biener
2023-12-05 10:17   ` Robin Dapp
2023-12-05 12:21     ` Richard Biener
2023-12-11 10:43       ` Robin Dapp
2023-12-12 15:01         ` Richard Sandiford
2023-12-12 15:11           ` Robin Dapp
2023-12-12 15:32             ` Richard Sandiford
2023-12-13 12:21               ` Robin Dapp
2023-12-13 14:05                 ` Richard Sandiford
2023-12-13 14:07                   ` 钟居哲 [this message]

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=1A2D44B4D6633B55+202312132207248705120@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdapp.gcc@gmail.com \
    --cc=rguenther@suse.de \
    --cc=richard.sandiford@arm.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).