[llvm-branch-commits] [compiler-rt] [libc] [compiler-rt][builtins] libc-backed single-float comparison builtins (PR #212651)

Muhammad Bassiouni via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 4 17:02:46 PDT 2026


================
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's float comparison routines
+/// (__lesf2/__gesf2/__unordsf2 and their aliases) on top of LLVM-libc's shared
+/// comparison builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+#include "fp_compare_impl.inc"
+#include "fp_libc_config.h"
+#include "shared/builtins/gesf2.h"
+#include "shared/builtins/lesf2.h"
+#include "shared/builtins/unordsf2.h"
+
+extern "C" {
+
+COMPILER_RT_ABI CMP_RESULT __lesf2(fp_t a, fp_t b) {
+  return LIBC_NAMESPACE::shared::lesf2(a, b);
+}
+#if defined(__ELF__)
----------------
bassiounix wrote:

```suggestion
#ifdef __ELF__
```

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


More information about the llvm-branch-commits mailing list