aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>2023-06-13 10:26:11 +0800
committerPan Li <pan2.li@intel.com>2023-06-13 22:14:06 +0800
commita07dadba85f1b15e270c227dfa70e2fdf331494f (patch)
treeb9c399f2a8df78b9bfaa509d95d9b6f0e279e1dd /gcc
parent325bfe220517d073ddd0f413cf95465d89f273ac (diff)
downloadgcc-a07dadba85f1b15e270c227dfa70e2fdf331494f.zip
gcc-a07dadba85f1b15e270c227dfa70e2fdf331494f.tar.gz
gcc-a07dadba85f1b15e270c227dfa70e2fdf331494f.tar.bz2
RISC-V: Add comments of some functions
gcc/ChangeLog: * config/riscv/riscv-v.cc (rvv_builder::single_step_npatterns_p): Add comment. (shuffle_generic_patterns): Ditto. (expand_vec_perm_const_1): Ditto.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/riscv/riscv-v.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index 34fdb53..d797326 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -457,6 +457,9 @@ rvv_builder::single_step_npatterns_p () const
{ 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, ... }
E.g. NPATTERNS = 8:
{ 2, 2, 2, 2, 2, 2, 2, 2, 8, 8, 8, 8, 8, 8, 8, 8, ... }
+ We only check ele[0] ~ ele[NPATTERNS - 1] whether they are the same.
+ We don't need to check the elements[n] with n >= NPATTERNS since
+ they don't belong to the same pattern.
*/
bool
rvv_builder::npatterns_all_equal_p () const
@@ -2478,6 +2481,8 @@ shuffle_generic_patterns (struct expand_vec_perm_d *d)
return true;
}
+/* This function recognizes and supports different permutation patterns
+ and enable VLA SLP auto-vectorization. */
static bool
expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
{
@@ -2509,6 +2514,8 @@ expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
return false;
}
+/* This function implements TARGET_VECTORIZE_VEC_PERM_CONST by using RVV
+ * instructions. */
bool
expand_vec_perm_const (machine_mode vmode, machine_mode op_mode, rtx target,
rtx op0, rtx op1, const vec_perm_indices &sel)