public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-3709] optabs: Use operand[2] mode in can_vec_set_var_idx_p
Date: Sun,  6 Nov 2022 19:52:04 +0000 (GMT)	[thread overview]
Message-ID: <20221106195212.B0DAE3858D20@sourceware.org> (raw)

https://gcc.gnu.org/g:c56826d0f3b143a9cb64ee263707046f8073c1b6

commit r13-3709-gc56826d0f3b143a9cb64ee263707046f8073c1b6
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sun Nov 6 20:51:01 2022 +0100

    optabs: Use operand[2] mode in can_vec_set_var_idx_p
    
    Use operand[2] mode in can_vec_set_var_idx_p when checking vec_set_optab.
    
    This change allows non-VOID index operand in vec_set_optab.
    
    2022-11-06  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/ChangeLog:
    
            * optabs.cc (can_vec_set_var_idx_p): Use operand[2]
            mode when checking vec_set_optab.

Diff:
---
 gcc/optabs.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/optabs.cc b/gcc/optabs.cc
index c2a6f971d74..9fc9b1fc6e9 100644
--- a/gcc/optabs.cc
+++ b/gcc/optabs.cc
@@ -4344,12 +4344,17 @@ can_vec_set_var_idx_p (machine_mode vec_mode)
     return false;
 
   machine_mode inner_mode = GET_MODE_INNER (vec_mode);
+
   rtx reg1 = alloca_raw_REG (vec_mode, LAST_VIRTUAL_REGISTER + 1);
   rtx reg2 = alloca_raw_REG (inner_mode, LAST_VIRTUAL_REGISTER + 2);
-  rtx reg3 = alloca_raw_REG (VOIDmode, LAST_VIRTUAL_REGISTER + 3);
 
   enum insn_code icode = optab_handler (vec_set_optab, vec_mode);
 
+  const struct insn_data_d *data = &insn_data[icode];
+  machine_mode idx_mode = data->operand[2].mode;
+
+  rtx reg3 = alloca_raw_REG (idx_mode, LAST_VIRTUAL_REGISTER + 3);
+
   return icode != CODE_FOR_nothing && insn_operand_matches (icode, 0, reg1)
 	 && insn_operand_matches (icode, 1, reg2)
 	 && insn_operand_matches (icode, 2, reg3);

                 reply	other threads:[~2022-11-06 19:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221106195212.B0DAE3858D20@sourceware.org \
    --to=uros@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.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).