diff --git a/sysdeps/riscv/rvd/math-use-builtins-fmax.h b/sysdeps/riscv/rvd/math-use-builtins-fmax.h
new file mode 100644
index 0000000000..8865377475
--- /dev/null
+++ b/sysdeps/riscv/rvd/math-use-builtins-fmax.h
@@ -0,0 +1,15 @@
+/* This does not affect fmax and fmaxf, which have their own
+   implementations in rvd and rvf: the instruction returns the number for
+   a signaling NaN operand where C requires a quiet NaN, so they need an
+   explicit check.  Only the fmaximum and fminimum families and hypot use
+   these builtins.  */
+#if __GNUC_PREREQ (13, 0)
+# define USE_FMAX_BUILTIN 1
+# define USE_FMAXF_BUILTIN 1
+#else
+# define USE_FMAX_BUILTIN 0
+# define USE_FMAXF_BUILTIN 0
+#endif
+
+#define USE_FMAXL_BUILTIN 0
+#define USE_FMAXF128_BUILTIN 0
diff --git a/sysdeps/riscv/rvd/math-use-builtins-fmin.h b/sysdeps/riscv/rvd/math-use-builtins-fmin.h
new file mode 100644
index 0000000000..06e46bf7dd
--- /dev/null
+++ b/sysdeps/riscv/rvd/math-use-builtins-fmin.h
@@ -0,0 +1,15 @@
+/* This does not affect fmin and fminf, which have their own
+   implementations in rvd and rvf: the instruction returns the number for
+   a signaling NaN operand where C requires a quiet NaN, so they need an
+   explicit check.  Only the fmaximum and fminimum families and hypot use
+   these builtins.  */
+#if __GNUC_PREREQ (13, 0)
+# define USE_FMIN_BUILTIN 1
+# define USE_FMINF_BUILTIN 1
+#else
+# define USE_FMIN_BUILTIN 0
+# define USE_FMINF_BUILTIN 0
+#endif
+
+#define USE_FMINL_BUILTIN 0
+#define USE_FMINF128_BUILTIN 0
