lang_hooks.types.simulate_enum_decl (input_location, "RVV_VXRM", &values);
}
+/* Register the frm enum. */
+static void
+register_frm ()
+{
+ auto_vec<string_int_pair, 5> values;
+#define DEF_RVV_FRM_ENUM(NAME, VALUE) \
+ values.quick_push (string_int_pair ("FRM_" #NAME, VALUE));
+#include "riscv-vector-builtins.def"
+#undef DEF_RVV_FRM_ENUM
+
+ lang_hooks.types.simulate_enum_decl (input_location, "RVV_FRM", &values);
+}
+
/* Implement #pragma riscv intrinsic vector. */
void
handle_pragma_vector ()
/* Define the enums. */
register_vxrm ();
+ register_frm ();
/* Define the functions. */
function_table = new hash_table<registered_function_hasher> (1023);
#define DEF_RVV_VXRM_ENUM(NAME, VALUE)
#endif
+/* Define RVV_FRM rounding mode enum for floating-point intrinsics. */
+#ifndef DEF_RVV_FRM_ENUM
+#define DEF_RVV_FRM_ENUM(NAME, VALUE)
+#endif
+
/* SEW/LMUL = 64:
Only enable when TARGET_MIN_VLEN > 32.
Machine mode = VNx1BImode when TARGET_MIN_VLEN < 128.
DEF_RVV_VXRM_ENUM (RDN, VXRM_RDN)
DEF_RVV_VXRM_ENUM (ROD, VXRM_ROD)
+DEF_RVV_FRM_ENUM (RNE, FRM_RNE)
+DEF_RVV_FRM_ENUM (RTZ, FRM_RTZ)
+DEF_RVV_FRM_ENUM (RDN, FRM_RDN)
+DEF_RVV_FRM_ENUM (RUP, FRM_RUP)
+DEF_RVV_FRM_ENUM (RMM, FRM_RMM)
+
#include "riscv-vector-type-indexer.gen.def"
#undef DEF_RVV_PRED_TYPE
#undef DEF_RVV_BASE_TYPE
#undef DEF_RVV_TYPE_INDEX
#undef DEF_RVV_VXRM_ENUM
+#undef DEF_RVV_FRM_ENUM
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
+
+#include "riscv_vector.h"
+
+size_t f0 ()
+{
+ return FRM_RNE;
+}
+
+size_t f1 ()
+{
+ return FRM_RTZ;
+}
+
+size_t f2 ()
+{
+ return FRM_RDN;
+}
+
+size_t f3 ()
+{
+ return FRM_RUP;
+}
+
+size_t f4 ()
+{
+ return FRM_RMM;
+}
+
+/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*0} 1} } */
+/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*1} 1} } */
+/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*2} 1} } */
+/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*3} 1} } */
+/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*4} 1} } */