[clang] [CIR][CodeGen] Implement BI__builtin_fpclassify function (PR #183893)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 08:54:12 PST 2026


================
@@ -2210,3 +2210,10 @@ double my_roundeven(double x) {
   // OGCG: define{{.*}}@my_roundeven(
   // OGCG: call double @llvm.roundeven.f64(
 }
+
+int fpclassify(float f) {
+  return __builtin_fpclassify(0, 1, 2, 3, 4, f);
+  // CIR: %{{.*}} = cir.is_fp_class %{{.*}}, fcNan : (!cir.float) -> !cir.bool
----------------
andykaylor wrote:

This needs to be expanded to check all the operations produced.

https://github.com/llvm/llvm-project/pull/183893


More information about the cfe-commits mailing list