public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3709] optabs: Use operand[2] mode in can_vec_set_var_idx_p
@ 2022-11-06 19:52 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2022-11-06 19:52 UTC (permalink / raw)
  To: gcc-cvs

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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-06 19:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06 19:52 [gcc r13-3709] optabs: Use operand[2] mode in can_vec_set_var_idx_p Uros Bizjak

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).