diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2022-11-06 20:51:01 +0100 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2022-11-06 20:51:54 +0100 |
commit | c56826d0f3b143a9cb64ee263707046f8073c1b6 (patch) | |
tree | b42d12dc47866cce6175990d5bc14e5535c51847 | |
parent | e3b10249119fb4258fb83d21d805a04f30b63152 (diff) | |
download | gcc-c56826d0f3b143a9cb64ee263707046f8073c1b6.zip gcc-c56826d0f3b143a9cb64ee263707046f8073c1b6.tar.gz gcc-c56826d0f3b143a9cb64ee263707046f8073c1b6.tar.bz2 |
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.
-rw-r--r-- | gcc/optabs.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/optabs.cc b/gcc/optabs.cc index c2a6f97..9fc9b1f 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); |