@@ -36,6 +36,12 @@ along with GCC; see the file COPYING3. If not see
#define DEF_RVV_F_OPS(TYPE, REQUIRE)
#endif
+/* Use "DEF_RVV_F_ARITH_OPS" macro include all floating-point arithmetic types
+ which will be iterated and registered as intrinsic functions. */
+#ifndef DEF_RVV_F_ARITH_OPS
+#define DEF_RVV_F_ARITH_OPS(TYPE, REQUIRE)
+#endif
+
/* Use "DEF_RVV_B_OPS" macro include all bool value which will be
iterated and registered as intrinsic functions. */
#ifndef DEF_RVV_B_OPS
@@ -487,6 +493,30 @@ DEF_RVV_F_OPS (vfloat64m2_t, RVV_REQUIRE_ELEN_FP_64)
DEF_RVV_F_OPS (vfloat64m4_t, RVV_REQUIRE_ELEN_FP_64)
DEF_RVV_F_OPS (vfloat64m8_t, RVV_REQUIRE_ELEN_FP_64)
+DEF_RVV_F_ARITH_OPS (vbfloat16mf4_t, RVV_REQUIRE_ELEN_BF_16 | RVV_REQUIRE_ELEN_64)
+DEF_RVV_F_ARITH_OPS (vbfloat16mf2_t, RVV_REQUIRE_ELEN_BF_16)
+DEF_RVV_F_ARITH_OPS (vbfloat16m1_t, RVV_REQUIRE_ELEN_BF_16)
+DEF_RVV_F_ARITH_OPS (vbfloat16m2_t, RVV_REQUIRE_ELEN_BF_16)
+DEF_RVV_F_ARITH_OPS (vbfloat16m4_t, RVV_REQUIRE_ELEN_BF_16)
+DEF_RVV_F_ARITH_OPS (vbfloat16m8_t, RVV_REQUIRE_ELEN_BF_16)
+
+DEF_RVV_F_ARITH_OPS (vfloat16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_F_ARITH_OPS (vfloat16mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_F_ARITH_OPS (vfloat16m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_F_ARITH_OPS (vfloat16m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_F_ARITH_OPS (vfloat16m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_F_ARITH_OPS (vfloat16m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+
+DEF_RVV_F_ARITH_OPS (vfloat32mf2_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
+DEF_RVV_F_ARITH_OPS (vfloat32m1_t, RVV_REQUIRE_ELEN_FP_32)
+DEF_RVV_F_ARITH_OPS (vfloat32m2_t, RVV_REQUIRE_ELEN_FP_32)
+DEF_RVV_F_ARITH_OPS (vfloat32m4_t, RVV_REQUIRE_ELEN_FP_32)
+DEF_RVV_F_ARITH_OPS (vfloat32m8_t, RVV_REQUIRE_ELEN_FP_32)
+DEF_RVV_F_ARITH_OPS (vfloat64m1_t, RVV_REQUIRE_ELEN_FP_64)
+DEF_RVV_F_ARITH_OPS (vfloat64m2_t, RVV_REQUIRE_ELEN_FP_64)
+DEF_RVV_F_ARITH_OPS (vfloat64m4_t, RVV_REQUIRE_ELEN_FP_64)
+DEF_RVV_F_ARITH_OPS (vfloat64m8_t, RVV_REQUIRE_ELEN_FP_64)
+
DEF_RVV_B_OPS (vbool64_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_B_OPS (vbool32_t, 0)
DEF_RVV_B_OPS (vbool16_t, 0)
@@ -603,23 +633,23 @@ DEF_RVV_FULL_V_U_OPS (vuint64m2_t, RVV_REQUIRE_FULL_V)
DEF_RVV_FULL_V_U_OPS (vuint64m4_t, RVV_REQUIRE_FULL_V)
DEF_RVV_FULL_V_U_OPS (vuint64m8_t, RVV_REQUIRE_FULL_V)
-DEF_RVV_WEXTF_OPS (vfloat32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_WEXTF_OPS (vfloat32m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WEXTF_OPS (vfloat32m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WEXTF_OPS (vfloat32m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WEXTF_OPS (vfloat32m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_WEXTF_OPS (vfloat32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WEXTF_OPS (vfloat32m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WEXTF_OPS (vfloat32m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WEXTF_OPS (vfloat32m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WEXTF_OPS (vfloat32m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_WEXTF_OPS (vfloat64m1_t, RVV_REQUIRE_ELEN_FP_64)
DEF_RVV_WEXTF_OPS (vfloat64m2_t, RVV_REQUIRE_ELEN_FP_64)
DEF_RVV_WEXTF_OPS (vfloat64m4_t, RVV_REQUIRE_ELEN_FP_64)
DEF_RVV_WEXTF_OPS (vfloat64m8_t, RVV_REQUIRE_ELEN_FP_64)
-DEF_RVV_CONVERT_I_OPS (vint16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_CONVERT_I_OPS (vint16mf2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_I_OPS (vint16m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_I_OPS (vint16m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_I_OPS (vint16m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_I_OPS (vint16m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_CONVERT_I_OPS (vint16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_I_OPS (vint16mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_I_OPS (vint16m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_I_OPS (vint16m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_I_OPS (vint16m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_I_OPS (vint16m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_CONVERT_I_OPS (vint32mf2_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_I_OPS (vint32m1_t, 0)
@@ -631,12 +661,12 @@ DEF_RVV_CONVERT_I_OPS (vint64m2_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_I_OPS (vint64m4_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_I_OPS (vint64m8_t, RVV_REQUIRE_ELEN_64)
-DEF_RVV_CONVERT_U_OPS (vuint16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_CONVERT_U_OPS (vuint16mf2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_U_OPS (vuint16m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_U_OPS (vuint16m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_U_OPS (vuint16m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_CONVERT_U_OPS (vuint16m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_CONVERT_U_OPS (vuint16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_U_OPS (vuint16mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_U_OPS (vuint16m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_U_OPS (vuint16m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_U_OPS (vuint16m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_CONVERT_U_OPS (vuint16m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_CONVERT_U_OPS (vuint32mf2_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_U_OPS (vuint32m1_t, 0)
@@ -648,22 +678,22 @@ DEF_RVV_CONVERT_U_OPS (vuint64m2_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_U_OPS (vuint64m4_t, RVV_REQUIRE_ELEN_64)
DEF_RVV_CONVERT_U_OPS (vuint64m8_t, RVV_REQUIRE_ELEN_64)
-DEF_RVV_WCONVERT_I_OPS (vint32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_WCONVERT_I_OPS (vint32m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_I_OPS (vint32m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_I_OPS (vint32m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_I_OPS (vint32m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_WCONVERT_I_OPS (vint32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_I_OPS (vint32m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_I_OPS (vint32m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_I_OPS (vint32m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_I_OPS (vint32m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_WCONVERT_I_OPS (vint64m1_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
DEF_RVV_WCONVERT_I_OPS (vint64m2_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
DEF_RVV_WCONVERT_I_OPS (vint64m4_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
DEF_RVV_WCONVERT_I_OPS (vint64m8_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_WCONVERT_U_OPS (vuint32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_WCONVERT_U_OPS (vuint32m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_U_OPS (vuint32m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_U_OPS (vuint32m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WCONVERT_U_OPS (vuint32m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_WCONVERT_U_OPS (vuint32mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_U_OPS (vuint32m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_U_OPS (vuint32m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_U_OPS (vuint32m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WCONVERT_U_OPS (vuint32m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_WCONVERT_U_OPS (vuint64m1_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
DEF_RVV_WCONVERT_U_OPS (vuint64m2_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
@@ -725,12 +755,12 @@ DEF_RVV_WU_OPS (vuint32m2_t, 0)
DEF_RVV_WU_OPS (vuint32m4_t, 0)
DEF_RVV_WU_OPS (vuint32m8_t, 0)
-DEF_RVV_WF_OPS (vfloat16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64)
-DEF_RVV_WF_OPS (vfloat16mf2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WF_OPS (vfloat16m1_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WF_OPS (vfloat16m2_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WF_OPS (vfloat16m4_t, RVV_REQUIRE_ELEN_FP_16)
-DEF_RVV_WF_OPS (vfloat16m8_t, RVV_REQUIRE_ELEN_FP_16)
+DEF_RVV_WF_OPS (vfloat16mf4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ELEN_64 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WF_OPS (vfloat16mf2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WF_OPS (vfloat16m1_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WF_OPS (vfloat16m2_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WF_OPS (vfloat16m4_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
+DEF_RVV_WF_OPS (vfloat16m8_t, RVV_REQUIRE_ELEN_FP_16 | RVV_REQUIRE_ZVFH)
DEF_RVV_WF_OPS (vfloat32mf2_t, RVV_REQUIRE_ELEN_FP_32 | RVV_REQUIRE_ELEN_64)
DEF_RVV_WF_OPS (vfloat32m1_t, RVV_REQUIRE_ELEN_FP_32)
@@ -1598,6 +1628,7 @@ DEF_RVV_DIU_OPS (vuint64m8_t, RVV_REQUIRE_ELEN_64)
#undef DEF_RVV_I_OPS
#undef DEF_RVV_U_OPS
#undef DEF_RVV_F_OPS
+#undef DEF_RVV_F_ARITH_OPS
#undef DEF_RVV_B_OPS
#undef DEF_RVV_WEXTI_OPS
#undef DEF_RVV_QEXTI_OPS
@@ -284,6 +284,13 @@ static const rvv_type_info f_ops[] = {
#include "riscv-vector-builtins-types.def"
{NUM_VECTOR_TYPES, 0}};
+/* A list of all float for arithmetic will be registered for intrinsic
+ functions. */
+static const rvv_type_info f_arith_ops[] = {
+#define DEF_RVV_F_ARITH_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
+#include "riscv-vector-builtins-types.def"
+ {NUM_VECTOR_TYPES, 0}};
+
/* A list of Double-Widening signed integer will be registered for intrinsic
* functions. */
static const rvv_type_info wexti_ops[] = {
@@ -1560,7 +1567,7 @@ static constexpr const rvv_op_info iu_vvxv_ops
/* A static operand information for vector_type func (vector_type, vector_type,
* vector_type) function registration. */
static constexpr const rvv_op_info f_vvvv_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vv, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
vvv_args /* Args */};
@@ -1568,7 +1575,7 @@ static constexpr const rvv_op_info f_vvvv_ops
/* A static operand information for vector_type func (vector_type, scalar_type,
* vector_type) function registration. */
static constexpr const rvv_op_info f_vvfv_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vf, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
vxv_args /* Args */};
@@ -1608,7 +1615,7 @@ static constexpr const rvv_op_info iu_vvxm_ops
/* A static operand information for vector_type func (vector_type, scalar_type,
* mask_type) function registration. */
static constexpr const rvv_op_info f_vvfm_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vfm, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
vxm_args /* Args */};
@@ -1656,7 +1663,7 @@ static constexpr const rvv_op_info u_mvv_ops
/* A static operand information for mask_type func (vector_type, vector_type)
* function registration. */
static constexpr const rvv_op_info f_mvv_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vv, /* Suffix */
rvv_arg_type_info (RVV_BASE_mask), /* Return type */
vv_args /* Args */};
@@ -1688,7 +1695,7 @@ static constexpr const rvv_op_info u_mvx_ops
/* A static operand information for mask_type func (vector_type, scalar_type)
* function registration. */
static constexpr const rvv_op_info f_mvf_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vf, /* Suffix */
rvv_arg_type_info (RVV_BASE_mask), /* Return type */
vx_args /* Args */};
@@ -1712,7 +1719,7 @@ static constexpr const rvv_op_info u_vvv_ops
/* A static operand information for vector_type func (vector_type, vector_type)
* function registration. */
static constexpr const rvv_op_info f_vvv_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vv, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
vv_args /* Args */};
@@ -1720,7 +1727,7 @@ static constexpr const rvv_op_info f_vvv_ops
/* A static operand information for vector_type func (vector_type, vector_type)
* function registration. */
static constexpr const rvv_op_info f_vvf_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vf, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
vx_args /* Args */};
@@ -1913,7 +1920,7 @@ static constexpr const rvv_op_info iu_x_s_ops
/* A static operand information for scalar_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info f_f_s_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_s, /* Suffix */
rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
v_args /* Args */};
@@ -1929,7 +1936,7 @@ static constexpr const rvv_op_info iu_vs_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info f_vs_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_vs, /* Suffix */
rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
vs_args /* Args */};
@@ -1961,7 +1968,7 @@ static constexpr const rvv_op_info wf_vs_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info f_v_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_v, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
v_args /* Args */};
@@ -1993,7 +2000,7 @@ static constexpr const rvv_op_info f_to_wi_f_v_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info f_to_ni_f_w_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_f_w, /* Suffix */
rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector), /* Return type */
v_args /* Args */};
@@ -2001,7 +2008,7 @@ static constexpr const rvv_op_info f_to_ni_f_w_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info f_to_nu_f_w_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_f_w, /* Suffix */
rvv_arg_type_info (
RVV_BASE_double_trunc_unsigned_vector), /* Return type */
@@ -2010,7 +2017,7 @@ static constexpr const rvv_op_info f_to_nu_f_w_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info i_to_f_x_v_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_x_v, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
x_v_args /* Args */};
@@ -2018,7 +2025,7 @@ static constexpr const rvv_op_info i_to_f_x_v_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info u_to_f_xu_v_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_xu_v, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
xu_v_args /* Args */};
@@ -2026,7 +2033,7 @@ static constexpr const rvv_op_info u_to_f_xu_v_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info i_to_wf_x_v_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_x_v, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
w_x_v_args /* Args */};
@@ -2034,7 +2041,7 @@ static constexpr const rvv_op_info i_to_wf_x_v_ops
/* A static operand information for vector_type func (vector_type)
* function registration. */
static constexpr const rvv_op_info u_to_wf_xu_v_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_xu_v, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
w_xu_v_args /* Args */};
@@ -2442,7 +2449,7 @@ static constexpr const rvv_op_info iu_s_x_ops
/* A static operand information for vector_type func (scalar_type)
* function registration. */
static constexpr const rvv_op_info f_f_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_f, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
x_args /* Args */};
@@ -2450,7 +2457,7 @@ static constexpr const rvv_op_info f_f_ops
/* A static operand information for vector_type func (scalar_type)
* function registration. */
static constexpr const rvv_op_info f_s_f_ops
- = {f_ops, /* Types */
+ = {f_arith_ops, /* Types */
OP_TYPE_f, /* Suffix */
rvv_arg_type_info (RVV_BASE_vector), /* Return type */
x_args /* Args */};
@@ -5763,12 +5770,13 @@ validate_instance_type_required_extensions (const rvv_type_info type,
}
if ((exts & RVV_REQUIRE_ELEN_FP_16)
- && !TARGET_VECTOR_ELEN_FP_16_P (riscv_vector_elen_flags))
+ && (!TARGET_VECTOR_ELEN_FP_16_P (riscv_vector_elen_flags)
+ || ((exts & RVV_REQUIRE_ZVFH) && !TARGET_ZVFH)))
{
error_at (location,
- "built-in function %qE requires the "
- "zvfhmin or zvfh ISA extension",
- fndecl);
+ "built-in function %qE requires the %s ISA extension",
+ fndecl, exts & RVV_REQUIRE_ZVFH ? "zvfh"
+ : "zvfhmin or zvfh");
return false;
}
@@ -111,6 +111,7 @@ static const unsigned int CP_WRITE_CSR = 1U << 5;
#define RVV_REQUIRE_ELEN_FP_16 (1 << 6) /* Require FP ELEN >= 32. */
#define RVV_REQUIRE_ELEN_BF_16 (1 << 7) /* Require BF16. */
#define RVV_REQUIRE_ZVFOFP8MIN (1 << 8) /* Require ZVFOFP8MIN extension. */
+#define RVV_REQUIRE_ZVFH (1 << 9) /* Require ZVFH extension. */
/* Enumerates the required extensions. */
enum required_ext
@@ -7,7 +7,7 @@
vfloat16m1_t f0 (vfloat16m1_t vs2, vfloat16m1_t vs1, size_t vl)
{
- return __riscv_vfadd_vv_f16m1_rm (vs2, vs1, 0, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1_rm' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1_rm (vs2, vs1, 0, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1_rm' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
@@ -5,5 +5,5 @@
vfloat32mf2_t test_vfwsub_wf_f32mf2(vfloat32mf2_t vs2, _Float16 rs1, size_t vl)
{
- return __riscv_vfwsub_wf_f32mf2(vs2, rs1, vl); /* { dg-error {built-in function '__riscv_vfwsub_wf_f32mf2' requires the zvfhmin or zvfh ISA extension} } */
+ return __riscv_vfwsub_wf_f32mf2(vs2, rs1, vl); /* { dg-error {built-in function '__riscv_vfwsub_wf_f32mf2' requires the zvfh ISA extension} } */
}
@@ -5,5 +5,5 @@
vfloat32mf2_t test_vfwadd_wf_f32mf2(vfloat32mf2_t vs2, _Float16 rs1, size_t vl)
{
- return __riscv_vfwadd_wf_f32mf2(vs2, rs1, vl); /* { dg-error {built-in function '__riscv_vfwadd_wf_f32mf2' requires the zvfhmin or zvfh ISA extension} } */
+ return __riscv_vfwadd_wf_f32mf2(vs2, rs1, vl); /* { dg-error {built-in function '__riscv_vfwadd_wf_f32mf2' requires the zvfh ISA extension} } */
}
@@ -7,7 +7,7 @@ vfloat16m1_t
__attribute__((target("arch=+zve32x")))
test_1 (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
{
- return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
@@ -7,7 +7,7 @@ vfloat16m1_t
__attribute__((target("arch=+zve32f")))
test_1 (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
{
- return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
@@ -7,7 +7,7 @@ vfloat16m1_t
__attribute__((target("arch=+zve64x")))
test_1 (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
{
- return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
@@ -7,7 +7,7 @@ vfloat16m1_t
__attribute__((target("arch=+zve64f")))
test_1 (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
{
- return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
@@ -7,7 +7,7 @@ vfloat16m1_t
__attribute__((target("arch=+zve64d")))
test_1 (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
{
- return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfhmin or zvfh ISA extension" } */
+ return __riscv_vfadd_vv_f16m1 (a, b, vl); /* { dg-error "built-in function '__riscv_vfadd_vv_f16m1' requires the zvfh ISA extension" } */
}
/* { dg-error "return type 'vfloat16m1_t' requires the zvfhmin or zvfh ISA extension" "" { target { "riscv*-*-*" } } 0 } */
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv32gcv_zvfhmin -mabi=ilp32d" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvfhmin -mabi=lp64d" { target { rv64 } } } */
+
+#include <riscv_vector.h>
+
+vfloat16m1_t
+test_add (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
+{
+ return __riscv_vfadd (a, b, vl); /* { dg-error "requires the zvfh ISA extension" } */
+}
+
+vfloat32m2_t
+test_widen_add (vfloat16m1_t a, vfloat16m1_t b, size_t vl)
+{
+ return __riscv_vfwadd_vv_f32m2 (a, b, vl); /* { dg-error "requires the zvfh ISA extension" } */
+}
+
+vfloat16m1_t
+test_narrow_convert (vint32m2_t a, size_t vl)
+{
+ return __riscv_vfncvt_f (a, vl); /* { dg-error "requires the zvfh ISA extension" } */
+}