[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)
YunQiang Su via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 11 22:16:47 PDT 2024
================
@@ -372,6 +372,31 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
// HAS_MAYTRAP: declare float @llvm.experimental.constrained.minnum.f32(
// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.minnum.f80(
+ fmaximum_num(*d,*d); fmaximum_numf(f,f); fmaximum_numl(*l,*l);
+
+// NO__ERRNO: declare double @llvm.maximumnum.f64(double, double) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare float @llvm.maximumnum.f32(float, float) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare x86_fp80 @llvm.maximumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare double @llvm.maximumnum.f64(double, double) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare float @llvm.maximumnum.f32(float, float) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare x86_fp80 @llvm.maximumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_MAYTRAP: declare double @llvm.maximumnum.f64(
+// HAS_MAYTRAP: declare float @llvm.maximumnum.f32(
+// HAS_MAYTRAP: declare x86_fp80 @llvm.maximumnum.f80(
+
+ fminimum_num(*d,*d); fminimum_numf(f,f); fminimum_numl(*l,*l);
+
+// NO__ERRNO: declare double @llvm.minimumnum.f64(double, double) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare float @llvm.minimumnum.f32(float, float) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare x86_fp80 @llvm.minimumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare double @llvm.minimumnum.f64(double, double) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare float @llvm.minimumnum.f32(float, float) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare x86_fp80 @llvm.minimumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_MAYTRAP: declare double @llvm.minimumnum.f64(
+// HAS_MAYTRAP: declare float @llvm.minimumnum.f32(
----------------
wzssyqa wrote:
Sorry. I don't understand it well. Do you mean that we use `--check-prefixes` instead of `--check-prefix`?
https://github.com/llvm/llvm-project/pull/96281
More information about the cfe-commits
mailing list