aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv/riscv-vector-builtins.h
diff options
context:
space:
mode:
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>2023-02-08 10:30:24 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-02-12 14:44:37 +0800
commitcb44a16d212e9d0c402340fe6627501ca2e50fb8 (patch)
tree95150dfa81f60ad26d09bbf3b369cd59aca9aeb6 /gcc/config/riscv/riscv-vector-builtins.h
parent5e620b36cd34b85b0e28c34160245d84bc5acd68 (diff)
downloadgcc-cb44a16d212e9d0c402340fe6627501ca2e50fb8.zip
gcc-cb44a16d212e9d0c402340fe6627501ca2e50fb8.tar.gz
gcc-cb44a16d212e9d0c402340fe6627501ca2e50fb8.tar.bz2
RISC-V: Add vadc/vsbc C/C++ API support
gcc/ChangeLog: * config/riscv/riscv-protos.h (simm5_p): Add vadc/vsbc support. * config/riscv/riscv-v.cc (simm32_p): Ditto. * config/riscv/riscv-vector-builtins-bases.cc (class vadc): New class. (class vsbc): Ditto. (BASE): Ditto. * config/riscv/riscv-vector-builtins-bases.h: Ditto. * config/riscv/riscv-vector-builtins-functions.def (vadc): Ditto. (vsbc): Ditto. * config/riscv/riscv-vector-builtins-shapes.cc (struct no_mask_policy_def): Ditto. (SHAPE): Ditto. * config/riscv/riscv-vector-builtins-shapes.h: Ditto. * config/riscv/riscv-vector-builtins.cc (rvv_arg_type_info::get_base_vector_type): Add vadc/vsbc support. (rvv_arg_type_info::get_tree_type): Ditto. (function_expander::use_exact_insn): Ditto. * config/riscv/riscv-vector-builtins.h (enum rvv_base_type): Ditto. (function_base::use_mask_predication_p): New function. * config/riscv/vector-iterators.md: New iterator. * config/riscv/vector.md (@pred_adc<mode>): New pattern. (@pred_sbc<mode>): Ditto. (@pred_adc<mode>_scalar): Ditto. (@pred_sbc<mode>_scalar): Ditto. (*pred_adc<mode>_scalar): Ditto. (*pred_adc<mode>_extended_scalar): Ditto. (*pred_sbc<mode>_scalar): Ditto. (*pred_sbc<mode>_extended_scalar): Ditto.
Diffstat (limited to 'gcc/config/riscv/riscv-vector-builtins.h')
-rw-r--r--gcc/config/riscv/riscv-vector-builtins.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-vector-builtins.h b/gcc/config/riscv/riscv-vector-builtins.h
index d033a2e..4f78c29 100644
--- a/gcc/config/riscv/riscv-vector-builtins.h
+++ b/gcc/config/riscv/riscv-vector-builtins.h
@@ -140,6 +140,7 @@ enum rvv_base_type
{
RVV_BASE_vector,
RVV_BASE_scalar,
+ RVV_BASE_mask,
RVV_BASE_unsigned_vector,
RVV_BASE_unsigned_scalar,
RVV_BASE_vector_ptr,
@@ -384,6 +385,9 @@ public:
/* Return true if intrinsic can be overloaded. */
virtual bool can_be_overloaded_p (enum predication_type_index) const;
+ /* Return true if intrinsics use mask predication. */
+ virtual bool use_mask_predication_p () const;
+
/* Expand the given call into rtl. Return the result of the function,
or an arbitrary value if the function doesn't return a result. */
virtual rtx expand (function_expander &) const = 0;
@@ -509,6 +513,14 @@ function_base::apply_mask_policy_p () const
return true;
}
+/* We choose to return true by default since most of the intrinsics use
+ mask predication. */
+inline bool
+function_base::use_mask_predication_p () const
+{
+ return true;
+}
+
/* Since most of intrinsics can be overloaded, we set it true by default. */
inline bool
function_base::can_be_overloaded_p (enum predication_type_index) const