[libc-commits] [libc] [libc] wrong guards in `totalorderbf16` and `totalordermagbf16` (PR #188241)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 24 06:13:05 PDT 2026


https://github.com/Sukumarsawant created https://github.com/llvm/llvm-project/pull/188241

Currently the guards for `totalorderbf16` and `totalordermagbf16` are as follows:
```
#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
#define LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
-
#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
```
and 
```
#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
#define LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
-
#endif // LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
```
This Pr intends to fix that with correct guards as `TOTALORDERBF16` and `TOTALORDERMAGBF16`

>From 8ff15923d3823afec405e470c46a7d82ba5bae55 Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Tue, 24 Mar 2026 18:34:57 +0530
Subject: [PATCH 1/2] nit in guard

---
 libc/src/math/totalorderbf16.h    | 42 +++++++++++++++----------------
 libc/src/math/totalordermagbf16.h | 42 +++++++++++++++----------------
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/libc/src/math/totalorderbf16.h b/libc/src/math/totalorderbf16.h
index 2414852db92b8..ec07103429e0f 100644
--- a/libc/src/math/totalorderbf16.h
+++ b/libc/src/math/totalorderbf16.h
@@ -1,21 +1,21 @@
-//===-- Implementation header for totalorderbf16 ----------------*- C++ -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
-#define LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
-
-#include "src/__support/macros/config.h"
-#include "src/__support/macros/properties/types.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-int totalorderbf16(const bfloat16 *x, const bfloat16 *y);
-
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC_MATH_TOTALORDERF16_H
+//===-- Implementation header for totalorderbf16 ----------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
+#define LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int totalorderbf16(const bfloat16 *x, const bfloat16 *y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
diff --git a/libc/src/math/totalordermagbf16.h b/libc/src/math/totalordermagbf16.h
index c48de1ca8e540..a6b13df2753ab 100644
--- a/libc/src/math/totalordermagbf16.h
+++ b/libc/src/math/totalordermagbf16.h
@@ -1,21 +1,21 @@
-//===-- Implementation header for totalordermagbf16 -------------*- C++ -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
-#define LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
-
-#include "src/__support/macros/config.h"
-#include "src/__support/macros/properties/types.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-int totalordermagbf16(const bfloat16 *x, const bfloat16 *y);
-
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGF16_H
+//===-- Implementation header for totalordermagbf16 -------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
+#define LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int totalordermagbf16(const bfloat16 *x, const bfloat16 *y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H

>From bbd08b1ef9fb5781010a6582514ab30e36537b80 Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Tue, 24 Mar 2026 18:41:53 +0530
Subject: [PATCH 2/2] lf

---
 libc/src/math/totalorderbf16.h    | 42 +++++++++++++++----------------
 libc/src/math/totalordermagbf16.h | 42 +++++++++++++++----------------
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/libc/src/math/totalorderbf16.h b/libc/src/math/totalorderbf16.h
index ec07103429e0f..31daec4ac64fb 100644
--- a/libc/src/math/totalorderbf16.h
+++ b/libc/src/math/totalorderbf16.h
@@ -1,21 +1,21 @@
-//===-- Implementation header for totalorderbf16 ----------------*- C++ -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
-#define LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
-
-#include "src/__support/macros/config.h"
-#include "src/__support/macros/properties/types.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-int totalorderbf16(const bfloat16 *x, const bfloat16 *y);
-
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
+//===-- Implementation header for totalorderbf16 ----------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
+#define LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int totalorderbf16(const bfloat16 *x, const bfloat16 *y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_TOTALORDERBF16_H
diff --git a/libc/src/math/totalordermagbf16.h b/libc/src/math/totalordermagbf16.h
index a6b13df2753ab..e60d28bf1d450 100644
--- a/libc/src/math/totalordermagbf16.h
+++ b/libc/src/math/totalordermagbf16.h
@@ -1,21 +1,21 @@
-//===-- Implementation header for totalordermagbf16 -------------*- C++ -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
-#define LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
-
-#include "src/__support/macros/config.h"
-#include "src/__support/macros/properties/types.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-int totalordermagbf16(const bfloat16 *x, const bfloat16 *y);
-
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
+//===-- Implementation header for totalordermagbf16 -------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
+#define LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int totalordermagbf16(const bfloat16 *x, const bfloat16 *y);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGBF16_H



More information about the libc-commits mailing list