[libc-commits] [compiler-rt] [libc] [compiler-rt][builtins] libc-backed bfloat16 extend/truncate builtins (PR #211881)
via libc-commits
libc-commits at lists.llvm.org
Sat Aug 8 14:26:15 PDT 2026
================
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __extendbfsf2, extend bfloat16 to float,
+/// on top of LLVM-libc's shared::extendbfsf2.
+///
+//===----------------------------------------------------------------------===//
+
+#define SRC_BFLOAT16
+#define DST_SINGLE
+#include "fp_extend.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/extendbfsf2.h"
+
+extern "C" COMPILER_RT_ABI dst_t __extendbfsf2(src_t a) {
+ return LIBC_NAMESPACE::shared::extendbfsf2(__builtin_bit_cast(uint16_t, a));
----------------
hulxv wrote:
ok, let's merge #211882 first, please
https://github.com/llvm/llvm-project/pull/211881
More information about the libc-commits
mailing list