[compiler-rt] 800d5e1 - Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 02:27:51 PDT 2022
Author: Phoebe Wang
Date: 2022-08-10T17:27:44+08:00
New Revision: 800d5e178f2b36123f93d6d7733aa737da03b009
URL: https://github.com/llvm/llvm-project/commit/800d5e178f2b36123f93d6d7733aa737da03b009
DIFF: https://github.com/llvm/llvm-project/commit/800d5e178f2b36123f93d6d7733aa737da03b009.diff
LOG: Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit 0729d00135ccbe1514a49168bbf26986823235c2.
Buildbot https://lab.llvm.org/buildbot/#/builders/19/builds/11989 failed
with "error: ISO C requires a translation unit to contain at least one declaration [-Werror,-Wempty-translation-unit]"
Added:
Modified:
compiler-rt/cmake/builtin-config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
compiler-rt/lib/builtins/fp_trunc.h
compiler-rt/lib/builtins/truncdfbf2.c
compiler-rt/lib/builtins/truncsfbf2.c
Removed:
################################################################################
diff --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index 62e8281b919c..5aa2114fab93 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -30,14 +30,6 @@ _Float16 foo(_Float16 x) {
"
)
-builtin_check_c_compiler_source(COMPILER_RT_HAS_BFLOAT16
-"
-__bf16 foo(__bf16 x) {
- return x;
-}
-"
-)
-
builtin_check_c_compiler_source(COMPILER_RT_HAS_ASM_LSE
"
asm(\".arch armv8-a+lse\");
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 05c37930dae8..6143457cc933 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -699,8 +699,6 @@ else ()
append_list_if(COMPILER_RT_HAS_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS)
- append_list_if(COMPILER_RT_HAS_BFLOAT16 -DCOMPILER_RT_HAS_BFLOAT16 BUILTIN_CFLAGS)
-
append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 BUILTIN_CFLAGS)
# These flags would normally be added to CMAKE_C_FLAGS by the llvm
diff --git a/compiler-rt/lib/builtins/fp_trunc.h b/compiler-rt/lib/builtins/fp_trunc.h
index 91f614528ab3..7a54564a3520 100644
--- a/compiler-rt/lib/builtins/fp_trunc.h
+++ b/compiler-rt/lib/builtins/fp_trunc.h
@@ -60,7 +60,7 @@ typedef uint16_t dst_rep_t;
static const int dstSigBits = 10;
#elif defined DST_BFLOAT
-typedef __bf16 dst_t;
+typedef uint16_t dst_t;
typedef uint16_t dst_rep_t;
#define DST_REP_C UINT16_C
static const int dstSigBits = 7;
diff --git a/compiler-rt/lib/builtins/truncdfbf2.c b/compiler-rt/lib/builtins/truncdfbf2.c
index b87385eeaca0..dbd54dcd50ca 100644
--- a/compiler-rt/lib/builtins/truncdfbf2.c
+++ b/compiler-rt/lib/builtins/truncdfbf2.c
@@ -6,11 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#if defined(COMPILER_RT_HAS_BFLOAT16)
#define SRC_DOUBLE
#define DST_BFLOAT
#include "fp_trunc_impl.inc"
COMPILER_RT_ABI dst_t __truncdfbf2(double a) { return __truncXfYf2__(a); }
-
-#endif
diff --git a/compiler-rt/lib/builtins/truncsfbf2.c b/compiler-rt/lib/builtins/truncsfbf2.c
index 42ddab32a2f1..6bed116af986 100644
--- a/compiler-rt/lib/builtins/truncsfbf2.c
+++ b/compiler-rt/lib/builtins/truncsfbf2.c
@@ -6,11 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#if defined(COMPILER_RT_HAS_BFLOAT16)
#define SRC_SINGLE
#define DST_BFLOAT
#include "fp_trunc_impl.inc"
COMPILER_RT_ABI dst_t __truncsfbf2(float a) { return __truncXfYf2__(a); }
-
-#endif
More information about the llvm-commits
mailing list