aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/riscv')
-rw-r--r--gcc/config/riscv/riscv-vsetvl.cc14
-rw-r--r--gcc/config/riscv/riscv-vsetvl.def4
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index e9de217..a4016bee 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -223,6 +223,8 @@ enum emit_type
EMIT_AFTER,
};
+static const int MAX_LMUL = 8;
+
/* dump helper functions */
static const char *
vlmul_to_str (vlmul_type vlmul)
@@ -1445,14 +1447,13 @@ private:
inline bool prev_ratio_valid_for_next_sew_p (const vsetvl_info &prev,
const vsetvl_info &next)
{
- return prev.get_ratio () >= (next.get_sew () / 8);
+ return prev.get_ratio () >= (next.get_sew () / MAX_LMUL);
}
inline bool next_ratio_valid_for_prev_sew_p (const vsetvl_info &prev,
const vsetvl_info &next)
{
- return next.get_ratio () >= (prev.get_sew () / 8);
+ return next.get_ratio () >= (prev.get_sew () / MAX_LMUL);
}
-
inline bool sew_ge_and_ratio_eq_p (const vsetvl_info &prev,
const vsetvl_info &next)
{
@@ -1470,6 +1471,13 @@ private:
return sew_ge_p (prev, next) && prev_sew_le_next_max_sew_p (prev, next)
&& next_ratio_valid_for_prev_sew_p (prev, next);
}
+ inline bool
+ sew_ge_and_prev_sew_le_next_max_sew_and_ratio_eq_p (
+ const vsetvl_info &prev, const vsetvl_info &next)
+ {
+ return sew_ge_p (prev, next) && prev_sew_le_next_max_sew_p (prev, next)
+ && ratio_eq_p (prev, next);
+ }
inline bool sew_le_and_next_sew_le_prev_max_sew_p (const vsetvl_info &prev,
const vsetvl_info &next)
{
diff --git a/gcc/config/riscv/riscv-vsetvl.def b/gcc/config/riscv/riscv-vsetvl.def
index 2dfff71d..d7a5ada 100644
--- a/gcc/config/riscv/riscv-vsetvl.def
+++ b/gcc/config/riscv/riscv-vsetvl.def
@@ -53,8 +53,8 @@ DEF_SEW_LMUL_RULE (sew_lmul, ge_sew, sew_lmul,
sew_ge_and_prev_sew_le_next_max_sew_p, nop)
DEF_SEW_LMUL_RULE (
sew_lmul, ratio_and_ge_sew, sew_lmul,
- sew_ge_and_prev_sew_le_next_max_sew_and_next_ratio_valid_for_prev_sew_p,
- sew_ge_and_prev_sew_le_next_max_sew_and_next_ratio_valid_for_prev_sew_p, nop)
+ sew_ge_and_prev_sew_le_next_max_sew_and_ratio_eq_p,
+ sew_ge_and_prev_sew_le_next_max_sew_and_ratio_eq_p, nop)
DEF_SEW_LMUL_RULE (ratio_only, sew_lmul, sew_lmul, ratio_eq_p, always_false,
use_next_sew_lmul)