Skip to content

[libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,l,f128} and setpayloadl. #102413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from Aug 8, 2024
Merged

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2024

No description provided.

@llvmbot llvmbot added the libc label Aug 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 8, 2024

@llvm/pr-subscribers-libc

Author: Job Henandez Lara (Jobhdez)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/102413.diff

19 Files Affected:

  • (modified) libc/config/linux/aarch64/entrypoints.txt (+3)
  • (modified) libc/config/linux/arm/entrypoints.txt (+2)
  • (modified) libc/config/linux/riscv/entrypoints.txt (+3)
  • (modified) libc/config/linux/x86_64/entrypoints.txt (+3)
  • (modified) libc/docs/math/index.rst (+1-1)
  • (modified) libc/newhdrgen/yaml/math.yaml (+22)
  • (modified) libc/spec/stdc.td (+3)
  • (modified) libc/src/math/CMakeLists.txt (+3)
  • (modified) libc/src/math/generic/CMakeLists.txt (+37)
  • (added) libc/src/math/generic/setpayloadsig.cpp (+20)
  • (added) libc/src/math/generic/setpayloadsigf.cpp (+20)
  • (added) libc/src/math/generic/setpayloadsigf128.cpp (+20)
  • (added) libc/src/math/setpayloadsig.h (+20)
  • (added) libc/src/math/setpayloadsigf.h (+20)
  • (added) libc/src/math/setpayloadsigf128.h (+21)
  • (modified) libc/test/src/math/smoke/CMakeLists.txt (+37)
  • (added) libc/test/src/math/smoke/setpayloadsig_test.cpp (+13)
  • (added) libc/test/src/math/smoke/setpayloadsigf128_test.cpp (+13)
  • (added) libc/test/src/math/smoke/setpayloadsigf_test.cpp (+13)
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index cdc93f437bf5fa..fcf2dd766bd2d5 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -546,6 +546,8 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.scalbnl
     libc.src.math.setpayload
     libc.src.math.setpayloadf
+    libc.src.math.setpayloadsig
+    libc.src.math.setpayloadsigf
     libc.src.math.sin
     libc.src.math.sincos
     libc.src.math.sincosf
@@ -726,6 +728,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
     libc.src.math.roundf128
     libc.src.math.scalbnf128
     libc.src.math.setpayloadf128
+    libc.src.math.setpayloadsigf128
     libc.src.math.sqrtf128
     libc.src.math.totalorderf128
     libc.src.math.totalordermagf128
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index 5d33faad0cb0bb..9d648b754579e9 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -376,6 +376,8 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.scalbnl
     libc.src.math.setpayload
     libc.src.math.setpayloadf
+    libc.src.math.setpayloadsig
+    libc.src.math.setpayloadsigf
     libc.src.math.sin
     libc.src.math.sincos
     libc.src.math.sincosf
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 66dd6e261f3d63..d98a7b43ec0ff9 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -549,6 +549,8 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.scalbnl
     libc.src.math.setpayload
     libc.src.math.setpayloadf
+    libc.src.math.setpayloadsig
+    libc.src.math.setpayloadsigf
     libc.src.math.sin
     libc.src.math.sincos
     libc.src.math.sincosf
@@ -633,6 +635,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
     libc.src.math.roundf128
     libc.src.math.scalbnf128
     libc.src.math.setpayloadf128
+    libc.src.math.setpayloadsigf128
     libc.src.math.sqrtf128
     libc.src.math.totalorderf128
     libc.src.math.totalordermagf128
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index ace1b1b08eb12b..24ffb52ee00d70 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -549,6 +549,8 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.scalbnl
     libc.src.math.setpayload
     libc.src.math.setpayloadf
+    libc.src.math.setpayloadsig
+    libc.src.math.setpayloadsigf
     libc.src.math.sin
     libc.src.math.sincos
     libc.src.math.sincosf
@@ -722,6 +724,7 @@ if(LIBC_TYPES_HAS_FLOAT128)
     libc.src.math.roundf128
     libc.src.math.scalbnf128
     libc.src.math.setpayloadf128
+    libc.src.math.setpayloadsigf128
     libc.src.math.sqrtf128
     libc.src.math.totalorderf128
     libc.src.math.totalordermagf128
diff --git a/libc/docs/math/index.rst b/libc/docs/math/index.rst
index c665ce397f9b7d..0df1d5ec4b5fea 100644
--- a/libc/docs/math/index.rst
+++ b/libc/docs/math/index.rst
@@ -226,7 +226,7 @@ Basic Operations
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | setpayload       | |check|          | |check|         |                        | |check|              | |check|                | F.10.13.2              | N/A                        |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
-| setpayloadsig    |                  |                 |                        | |check|              |                        | F.10.13.3              | N/A                        |
+| setpayloadsig    | |check|          | |check|         |                        | |check|              | |check|                | F.10.13.3              | N/A                        |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
 | totalorder       | |check|          | |check|         |                        | |check|              | |check|                | F.10.12.1              | N/A                        |
 +------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+----------------------------+
diff --git a/libc/newhdrgen/yaml/math.yaml b/libc/newhdrgen/yaml/math.yaml
index 12410c1d41e8cf..ae19811a6a0d36 100644
--- a/libc/newhdrgen/yaml/math.yaml
+++ b/libc/newhdrgen/yaml/math.yaml
@@ -1773,6 +1773,20 @@ functions:
       - type: _Float16 *
       - type: _Float16
     guard: LIBC_TYPES_HAS_FLOAT16
+  - name: setpayloadsig
+    standards:
+      - stdc
+    return_type: double
+    arguments:
+      - type: double *
+      - type: double
+  - name: setpayloadsigf
+    standards:
+      - stdc
+    return_type: int
+    arguments:
+      - type: float *
+      - type: float
   - name: setpayloadsigf16
     standards:
       - stdc
@@ -1781,6 +1795,14 @@ functions:
       - type: _Float16 *
       - type: _Float16
     guard: LIBC_TYPES_HAS_FLOAT16
+   - name: setpayloadsigf128
+    standards:
+      - stdc
+    return_type: int
+    arguments:
+      - type: float128 *
+      - type: float128
+    guard: LIBC_TYPES_HAS_FLOAT128
   - name: totalorderf16
     standards:
       - stdc
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index 6f974e4384a535..4d586de02e130a 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -761,7 +761,10 @@ def StdC : StandardSpec<"stdc"> {
           GuardedFunctionSpec<"setpayloadf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Type>], "LIBC_TYPES_HAS_FLOAT16">,
 	  GuardedFunctionSpec<"setpayloadf128", RetValSpec<IntType>, [ArgSpec<Float128Ptr>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
 
+          FunctionSpec<"setpayloadsig", RetValSpec<IntType>, [ArgSpec<DoublePtr>, ArgSpec<DoubleType>]>,
+          FunctionSpec<"setpayloadsigf", RetValSpec<IntType>, [ArgSpec<FloatPtr>, ArgSpec<FloatType>]>,
           GuardedFunctionSpec<"setpayloadsigf16", RetValSpec<IntType>, [ArgSpec<Float16Ptr>, ArgSpec<Float16Type>], "LIBC_TYPES_HAS_FLOAT16">,
+	  GuardedFunctionSpec<"setpayloadsigf128", RetValSpec<IntType>, [ArgSpec<Float128Ptr>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT128">,
 
           GuardedFunctionSpec<"f16addf128", RetValSpec<Float16Type>, [ArgSpec<Float128Type>, ArgSpec<Float128Type>], "LIBC_TYPES_HAS_FLOAT16_AND_FLOAT128">,
 
diff --git a/libc/src/math/CMakeLists.txt b/libc/src/math/CMakeLists.txt
index a0bd5269169fa3..fb36c49216ba81 100644
--- a/libc/src/math/CMakeLists.txt
+++ b/libc/src/math/CMakeLists.txt
@@ -439,7 +439,10 @@ add_math_entrypoint_object(setpayloadf)
 add_math_entrypoint_object(setpayloadf16)
 add_math_entrypoint_object(setpayloadf128)
 
+add_math_entrypoint_object(setpayloadsig)
+add_math_entrypoint_object(setpayloadsigf)
 add_math_entrypoint_object(setpayloadsigf16)
+add_math_entrypoint_object(setpayloadsigf128)
 
 add_math_entrypoint_object(sincos)
 add_math_entrypoint_object(sincosf)
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index be5cc2e02635af..602417386667f1 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -4499,6 +4499,30 @@ add_entrypoint_object(
     -O3
 )
 
+add_entrypoint_object(
+  setpayloadsig
+  SRCS
+    setpayloadsig.cpp
+  HDRS
+    ../setpayloadsig.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+  COMPILE_OPTIONS
+    -O3
+)
+
+add_entrypoint_object(
+  setpayloadsigf
+  SRCS
+    setpayloadsigf.cpp
+  HDRS
+    ../setpayloadsigf.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+  COMPILE_OPTIONS
+    -O3
+)
+
 add_entrypoint_object(
   setpayloadsigf16
   SRCS
@@ -4512,6 +4536,19 @@ add_entrypoint_object(
     -O3
 )
 
+add_entrypoint_object(
+  setpayloadsigf128
+  SRCS
+    setpayloadsigf128.cpp
+  HDRS
+    ../setpayloadsigf128.h
+  DEPENDS
+    libc.src.__support.macros.properties.types
+    libc.src.__support.FPUtil.basic_operations
+  COMPILE_OPTIONS
+    -O3
+)
+
 add_entrypoint_object(
   f16add
   SRCS
diff --git a/libc/src/math/generic/setpayloadsig.cpp b/libc/src/math/generic/setpayloadsig.cpp
new file mode 100644
index 00000000000000..fa8b165ca12777
--- /dev/null
+++ b/libc/src/math/generic/setpayloadsig.cpp
@@ -0,0 +1,20 @@
+//===-- Implementation of setpayloadsig function --------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/setpayloadsig.h"
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, setpayloadsig, (double *res, double pl)) {
+  return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigf.cpp b/libc/src/math/generic/setpayloadsigf.cpp
new file mode 100644
index 00000000000000..ec9d98f2123a86
--- /dev/null
+++ b/libc/src/math/generic/setpayloadsigf.cpp
@@ -0,0 +1,20 @@
+//===-- Implementation of setpayloadsigf function -------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/setpayloadsigf.h"
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, setpayloadsigf, (float *res, float pl)) {
+  return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigf128.cpp b/libc/src/math/generic/setpayloadsigf128.cpp
new file mode 100644
index 00000000000000..d98e4d1fc8b1cf
--- /dev/null
+++ b/libc/src/math/generic/setpayloadsigf128.cpp
@@ -0,0 +1,20 @@
+//===-- Implementation of setpayloadsigf128 function ----------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/setpayloadsigf128.h"
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, setpayloadsigf128, (float128 *res, float128 pl)) {
+  return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/setpayloadsig.h b/libc/src/math/setpayloadsig.h
new file mode 100644
index 00000000000000..8059e6f018210c
--- /dev/null
+++ b/libc/src/math/setpayloadsig.h
@@ -0,0 +1,20 @@
+//===-- Implementation header for setpayloadsig -----------------*- 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_SETPAYLOADSIG_H
+#define LLVM_LIBC_SRC_MATH_SETPAYLOADSIG_H
+
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int setpayloadsig(double *res, double pl);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_SETPAYLOADSIG_H
diff --git a/libc/src/math/setpayloadsigf.h b/libc/src/math/setpayloadsigf.h
new file mode 100644
index 00000000000000..e7a0175682ea7c
--- /dev/null
+++ b/libc/src/math/setpayloadsigf.h
@@ -0,0 +1,20 @@
+//===-- Implementation header for setpayloadsigf ----------------*- 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_SETPAYLOADSIGF_H
+#define LLVM_LIBC_SRC_MATH_SETPAYLOADSIGF_H
+
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int setpayloadsigf(float *res, float pl);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_SETPAYLOADSIGF_H
diff --git a/libc/src/math/setpayloadsigf128.h b/libc/src/math/setpayloadsigf128.h
new file mode 100644
index 00000000000000..4e036b9c8ba007
--- /dev/null
+++ b/libc/src/math/setpayloadsigf128.h
@@ -0,0 +1,21 @@
+//===-- Implementation header for setpayloadsigf128 -------------*- 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_SETPAYLOADSIGF128_H
+#define LLVM_LIBC_SRC_MATH_SETPAYLOADSIGF128_H
+
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+int setpayloadsigf128(float128 *res, float128 pl);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_MATH_SETPAYLOADSIGF128_H
diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index 6becaa569e62af..272295d3841a5a 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -3957,6 +3957,30 @@ add_fp_unittest(
     libc.src.math.setpayloadf128
 )
 
+add_fp_unittest(
+  setpayloadsig_test
+  SUITE
+    libc-math-smoke-tests
+  SRCS
+    setpayloadsig_test.cpp
+  HDRS
+    SetPayloadSigTest.h
+  DEPENDS
+    libc.src.math.setpayloadsig
+)
+
+add_fp_unittest(
+  setpayloadsigf_test
+  SUITE
+    libc-math-smoke-tests
+  SRCS
+    setpayloadsigf_test.cpp
+  HDRS
+    SetPayloadSigTest.h
+  DEPENDS
+    libc.src.math.setpayloadsigf
+)
+
 add_fp_unittest(
   setpayloadsigf16_test
   SUITE
@@ -3969,6 +3993,19 @@ add_fp_unittest(
     libc.src.math.setpayloadsigf16
 )
 
+add_fp_unittest(
+  setpayloadsigf128_test
+  SUITE
+    libc-math-smoke-tests
+  SRCS
+    setpayloadsigf128_test.cpp
+  HDRS
+    SetPayloadSigTest.h
+  DEPENDS
+    libc.src.math.setpayloadsigf128
+)
+
+
 add_fp_unittest(
   f16add_test
   SUITE
diff --git a/libc/test/src/math/smoke/setpayloadsig_test.cpp b/libc/test/src/math/smoke/setpayloadsig_test.cpp
new file mode 100644
index 00000000000000..4a7dea73bbc8f6
--- /dev/null
+++ b/libc/test/src/math/smoke/setpayloadsig_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for setpayloadsig ---------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "SetPayloadSigTest.h"
+
+#include "src/math/setpayloadsig.h"
+
+LIST_SETPAYLOADSIG_TESTS(double, LIBC_NAMESPACE::setpayloadsig)
diff --git a/libc/test/src/math/smoke/setpayloadsigf128_test.cpp b/libc/test/src/math/smoke/setpayloadsigf128_test.cpp
new file mode 100644
index 00000000000000..ea7d0268b3a29e
--- /dev/null
+++ b/libc/test/src/math/smoke/setpayloadsigf128_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for setpayloadsigf128 -----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "SetPayloadSigTest.h"
+
+#include "src/math/setpayloadsigf128.h"
+
+LIST_SETPAYLOADSIG_TESTS(float128, LIBC_NAMESPACE::setpayloadsigf128)
diff --git a/libc/test/src/math/smoke/setpayloadsigf_test.cpp b/libc/test/src/math/smoke/setpayloadsigf_test.cpp
new file mode 100644
index 00000000000000..dd8ca2fe86ece0
--- /dev/null
+++ b/libc/test/src/math/smoke/setpayloadsigf_test.cpp
@@ -0,0 +1,13 @@
+//===-- Unittests for setpayloadsigf --------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "SetPayloadSigTest.h"
+
+#include "src/math/setpayloadsigf.h"
+
+LIST_SETPAYLOADSIG_TESTS(float, LIBC_NAMESPACE::setpayloadsigf)

Copy link

github-actions bot commented Aug 8, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@ghost ghost changed the title [libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,f128} [libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,l,f128} Aug 8, 2024
@lntue lntue changed the title [libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,l,f128} [libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,l,f128} and setpayloadl. Aug 8, 2024
@lntue lntue merged commit aae7c38 into llvm:main Aug 8, 2024
7 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 8, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building libc at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/3341

Here is the relevant piece of the build log for the reference:

Step 5 (compile-openmp) failure: build (failure)
...
0.866 [198/34/305] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.qsort.dir/qsort.cpp.o
0.866 [197/34/306] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.qsort_r.dir/qsort_r.cpp.o
0.867 [196/34/307] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.rand.dir/rand.cpp.o
0.867 [195/34/308] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.exit.dir/exit.cpp.o
0.867 [194/34/309] Building CXX object libc/src/stdlib/gpu/CMakeFiles/libc.src.stdlib.gpu.aligned_alloc.dir/aligned_alloc.cpp.o
0.885 [193/34/310] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.puts.dir/puts.cpp.o
0.886 [192/34/311] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.remove.dir/remove.cpp.o
0.886 [191/34/312] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.strtoll.dir/strtoll.cpp.o
0.887 [190/34/313] Building CXX object libc/src/stdlib/gpu/CMakeFiles/libc.src.stdlib.gpu.free.dir/free.cpp.o
0.897 [189/34/314] Generating header  from /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/runtimes/../libc/newhdrgen/yaml/math.yaml and /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/include/math.h.def
FAILED: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/math.h 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/include && /usr/bin/python3.8 /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/newhdrgen/yaml_to_classes.py /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/runtimes/../libc/newhdrgen/yaml/math.yaml --h_def_file /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/include/math.h.def --e=__assert_fail --e=isalnum --e=isalpha --e=isascii --e=isblank --e=iscntrl --e=isdigit --e=isgraph --e=islower --e=isprint --e=ispunct --e=isspace --e=isupper --e=isxdigit --e=toascii --e=tolower --e=toupper --e=bcmp --e=bcopy --e=bzero --e=index --e=memccpy --e=memchr --e=memcmp --e=memcpy --e=memmem --e=memmove --e=mempcpy --e=memrchr --e=memset --e=rindex --e=stpcpy --e=stpncpy --e=strcasecmp --e=strcasestr --e=strcat --e=strchr --e=strchrnul --e=strcmp --e=strcoll --e=strcpy --e=strcspn --e=strdup --e=strerror --e=strlcat --e=strlcpy --e=strlen --e=strncasecmp --e=strncat --e=strncmp --e=strncpy --e=strndup --e=strnlen --e=strpbrk --e=strrchr --e=strsep --e=strspn --e=strstr --e=strtok --e=strtok_r --e=strxfrm --e=stdc_bit_ceil_uc --e=stdc_bit_ceil_ui --e=stdc_bit_ceil_ul --e=stdc_bit_ceil_ull --e=stdc_bit_ceil_us --e=stdc_bit_floor_uc --e=stdc_bit_floor_ui --e=stdc_bit_floor_ul --e=stdc_bit_floor_ull --e=stdc_bit_floor_us --e=stdc_bit_width_uc --e=stdc_bit_width_ui --e=stdc_bit_width_ul --e=stdc_bit_width_ull --e=stdc_bit_width_us --e=stdc_count_ones_uc --e=stdc_count_ones_ui --e=stdc_count_ones_ul --e=stdc_count_ones_ull --e=stdc_count_ones_us --e=stdc_count_zeros_uc --e=stdc_count_zeros_ui --e=stdc_count_zeros_ul --e=stdc_count_zeros_ull --e=stdc_count_zeros_us --e=stdc_first_leading_one_uc --e=stdc_first_leading_one_ui --e=stdc_first_leading_one_ul --e=stdc_first_leading_one_ull --e=stdc_first_leading_one_us --e=stdc_first_leading_zero_uc --e=stdc_first_leading_zero_ui --e=stdc_first_leading_zero_ul --e=stdc_first_leading_zero_ull --e=stdc_first_leading_zero_us --e=stdc_first_trailing_one_uc --e=stdc_first_trailing_one_ui --e=stdc_first_trailing_one_ul --e=stdc_first_trailing_one_ull --e=stdc_first_trailing_one_us --e=stdc_first_trailing_zero_uc --e=stdc_first_trailing_zero_ui --e=stdc_first_trailing_zero_ul --e=stdc_first_trailing_zero_ull --e=stdc_first_trailing_zero_us --e=stdc_has_single_bit_uc --e=stdc_has_single_bit_ui --e=stdc_has_single_bit_ul --e=stdc_has_single_bit_ull --e=stdc_has_single_bit_us --e=stdc_leading_ones_uc --e=stdc_leading_ones_ui --e=stdc_leading_ones_ul --e=stdc_leading_ones_ull --e=stdc_leading_ones_us --e=stdc_leading_zeros_uc --e=stdc_leading_zeros_ui --e=stdc_leading_zeros_ul --e=stdc_leading_zeros_ull --e=stdc_leading_zeros_us --e=stdc_trailing_ones_uc --e=stdc_trailing_ones_ui --e=stdc_trailing_ones_ul --e=stdc_trailing_ones_ull --e=stdc_trailing_ones_us --e=stdc_trailing_zeros_uc --e=stdc_trailing_zeros_ui --e=stdc_trailing_zeros_ul --e=stdc_trailing_zeros_ull --e=stdc_trailing_zeros_us --e=_Exit --e=abort --e=abs --e=atexit --e=atof --e=atoi --e=atol --e=atoll --e=bsearch --e=div --e=exit --e=labs --e=ldiv --e=llabs --e=lldiv --e=qsort --e=qsort_r --e=rand --e=srand --e=strtod --e=strtof --e=strtol --e=strtold --e=strtoll --e=strtoul --e=strtoull --e=at_quick_exit --e=quick_exit --e=aligned_alloc --e=calloc --e=free --e=malloc --e=realloc --e=errno --e=clearerr --e=fclose --e=printf --e=vprintf --e=fprintf --e=vfprintf --e=snprintf --e=sprintf --e=vsnprintf --e=vsprintf --e=asprintf --e=vasprintf --e=sscanf --e=vsscanf --e=feof --e=ferror --e=fflush --e=fgetc --e=fgets --e=fopen --e=fputc --e=fputs --e=fread --e=fseek --e=ftell --e=fwrite --e=getc --e=getchar --e=putc --e=putchar --e=puts --e=remove --e=stderr --e=stdin --e=stdout --e=ungetc --e=imaxabs --e=imaxdiv --e=strtoimax --e=strtoumax --e=clock --e=clock_gettime --e=nanosleep --e=wctob --e=rpc_host_call --e=acos --e=acosf --e=acosh --e=acoshf --e=asin --e=asinf --e=asinh --e=asinhf --e=atan --e=atan2 --e=atan2f --e=atanf --e=atanh --e=atanhf --e=cbrt --e=cbrtf --e=ceil --e=ceilf --e=copysign --e=copysignf --e=cos --e=cosf --e=cosh --e=coshf --e=erf --e=erff --e=exp --e=exp10 --e=exp10f --e=exp2 --e=exp2f --e=expf --e=expm1 --e=expm1f --e=fabs --e=fabsf --e=fadd --e=fdim --e=fdimf --e=floor --e=floorf --e=fma --e=fmaf --e=fmax --e=fmaxf --e=fmin --e=fminf --e=fmod --e=fmodf --e=frexp --e=frexpf --e=getpayload --e=getpayloadf --e=hypot --e=hypotf --e=ilogb --e=ilogbf --e=ldexp --e=ldexpf --e=llogb --e=llogbf --e=llrint --e=llrintf --e=llround --e=llroundf --e=log --e=log10 --e=log10f --e=log1p --e=log1pf --e=log2 --e=log2f --e=logf --e=lrint --e=lrintf --e=lround --e=lroundf --e=modf --e=modff --e=nan --e=nanf --e=nearbyint --e=nearbyintf --e=nextafter --e=nextafterf --e=nexttoward --e=nexttowardf --e=pow --e=powf --e=powi --e=powif --e=remainder --e=remainderf --e=remquo --e=remquof --e=rint --e=rintf --e=round --e=roundf --e=scalbn --e=scalbnf --e=sin --e=sincos --e=sincosf --e=sinf --e=sinh --e=sinhf --e=sqrt --e=sqrtf --e=tan --e=tanf --e=tanh --e=tanhf --e=tgamma --e=tgammaf --e=lgamma --e=lgamma_r --e=trunc --e=truncf --e=canonicalizef16 --e=ceilf16 --e=copysignf16 --e=f16add --e=f16addf --e=f16div --e=f16divf --e=f16fma --e=f16fmaf --e=f16mul --e=f16mulf --e=f16sqrt --e=f16sqrtf --e=f16sub --e=f16subf --e=fabsf16 --e=fdimf16 --e=floorf16 --e=fmaxf16 --e=fmaximum_mag_numf16 --e=fmaximum_magf16 --e=fmaximum_numf16 --e=fmaximumf16 --e=fminf16 --e=fminimum_mag_numf16 --e=fminimum_magf16 --e=fminimum_numf16 --e=fminimumf16 --e=fmodf16 --e=frexpf16 --e=fromfpf16 --e=fromfpxf16 --e=getpayloadf16 --e=ilogbf16 --e=ldexpf16 --e=llogbf16 --e=llrintf16 --e=llroundf16 --e=logbf16 --e=lrintf16 --e=lroundf16 --e=modff16 --e=nanf16 --e=nearbyintf16 --e=nextafterf16 --e=nextdownf16 --e=nexttowardf16 --e=nextupf16 --e=remainderf16 --e=remquof16 --e=rintf16 --e=roundevenf16 --e=roundf16 --e=scalblnf16 --e=scalbnf16 --e=setpayloadf16 --e=setpayloadsigf16 --e=totalorderf16 --e=totalordermagf16 --e=truncf16 --e=ufromfpf16 --e=ufromfpxf16 --output_dir /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/math.h
Traceback (most recent call last):
  File "/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/newhdrgen/yaml_to_classes.py", line 292, in <module>
    main(
  File "/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/newhdrgen/yaml_to_classes.py", line 234, in main
    header = load_yaml_file(yaml_file, header_class, entry_points)
  File "/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/newhdrgen/yaml_to_classes.py", line 121, in load_yaml_file
    yaml_data = yaml.load(f, Loader=yaml.FullLoader)
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr/lib/python3/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 392, in parse_block_sequence_entry
    raise ParserError("while parsing a block collection", self.marks[-1],
yaml.parser.ParserError: while parsing a block collection
  in "/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/runtimes/../libc/newhdrgen/yaml/math.yaml", line 10, column 3
expected <block end>, but found '<block sequence start>'
  in "/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/runtimes/../libc/newhdrgen/yaml/math.yaml", line 1834, column 4
0.897 [189/33/315] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.strtoul.dir/strtoul.cpp.o
0.903 [189/32/316] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strcmp.dir/strcmp.cpp.o
0.911 [189/31/317] Generating /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/llvm-libc-decls/math.h
FAILED: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/llvm-libc-decls/math.h 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/include && /usr/bin/python3.8 /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/newhdrgen/yaml_to_classes.py /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/runtimes/../libc/newhdrgen/yaml/math.yaml --export-decls --e=__assert_fail --e=isalnum --e=isalpha --e=isascii --e=isblank --e=iscntrl --e=isdigit --e=isgraph --e=islower --e=isprint --e=ispunct --e=isspace --e=isupper --e=isxdigit --e=toascii --e=tolower --e=toupper --e=bcmp --e=bcopy --e=bzero --e=index --e=memccpy --e=memchr --e=memcmp --e=memcpy --e=memmem --e=memmove --e=mempcpy --e=memrchr --e=memset --e=rindex --e=stpcpy --e=stpncpy --e=strcasecmp --e=strcasestr --e=strcat --e=strchr --e=strchrnul --e=strcmp --e=strcoll --e=strcpy --e=strcspn --e=strdup --e=strerror --e=strlcat --e=strlcpy --e=strlen --e=strncasecmp --e=strncat --e=strncmp --e=strncpy --e=strndup --e=strnlen --e=strpbrk --e=strrchr --e=strsep --e=strspn --e=strstr --e=strtok --e=strtok_r --e=strxfrm --e=stdc_bit_ceil_uc --e=stdc_bit_ceil_ui --e=stdc_bit_ceil_ul --e=stdc_bit_ceil_ull --e=stdc_bit_ceil_us --e=stdc_bit_floor_uc --e=stdc_bit_floor_ui --e=stdc_bit_floor_ul --e=stdc_bit_floor_ull --e=stdc_bit_floor_us --e=stdc_bit_width_uc --e=stdc_bit_width_ui --e=stdc_bit_width_ul --e=stdc_bit_width_ull --e=stdc_bit_width_us --e=stdc_count_ones_uc --e=stdc_count_ones_ui --e=stdc_count_ones_ul --e=stdc_count_ones_ull --e=stdc_count_ones_us --e=stdc_count_zeros_uc --e=stdc_count_zeros_ui --e=stdc_count_zeros_ul --e=stdc_count_zeros_ull --e=stdc_count_zeros_us --e=stdc_first_leading_one_uc --e=stdc_first_leading_one_ui --e=stdc_first_leading_one_ul --e=stdc_first_leading_one_ull --e=stdc_first_leading_one_us --e=stdc_first_leading_zero_uc --e=stdc_first_leading_zero_ui --e=stdc_first_leading_zero_ul --e=stdc_first_leading_zero_ull --e=stdc_first_leading_zero_us --e=stdc_first_trailing_one_uc --e=stdc_first_trailing_one_ui --e=stdc_first_trailing_one_ul --e=stdc_first_trailing_one_ull --e=stdc_first_trailing_one_us --e=stdc_first_trailing_zero_uc --e=stdc_first_trailing_zero_ui --e=stdc_first_trailing_zero_ul --e=stdc_first_trailing_zero_ull --e=stdc_first_trailing_zero_us --e=stdc_has_single_bit_uc --e=stdc_has_single_bit_ui --e=stdc_has_single_bit_ul --e=stdc_has_single_bit_ull --e=stdc_has_single_bit_us --e=stdc_leading_ones_uc --e=stdc_leading_ones_ui --e=stdc_leading_ones_ul --e=stdc_leading_ones_ull --e=stdc_leading_ones_us --e=stdc_leading_zeros_uc --e=stdc_leading_zeros_ui --e=stdc_leading_zeros_ul --e=stdc_leading_zeros_ull --e=stdc_leading_zeros_us --e=stdc_trailing_ones_uc --e=stdc_trailing_ones_ui --e=stdc_trailing_ones_ul --e=stdc_trailing_ones_ull --e=stdc_trailing_ones_us --e=stdc_trailing_zeros_uc --e=stdc_trailing_zeros_ui --e=stdc_trailing_zeros_ul --e=stdc_trailing_zeros_ull --e=stdc_trailing_zeros_us --e=_Exit --e=abort --e=abs --e=atexit --e=atof --e=atoi --e=atol --e=atoll --e=bsearch --e=div --e=exit --e=labs --e=ldiv --e=llabs --e=lldiv --e=qsort --e=qsort_r --e=rand --e=srand --e=strtod --e=strtof --e=strtol --e=strtold --e=strtoll --e=strtoul --e=strtoull --e=at_quick_exit --e=quick_exit --e=aligned_alloc --e=calloc --e=free --e=malloc --e=realloc --e=errno --e=clearerr --e=fclose --e=printf --e=vprintf --e=fprintf --e=vfprintf --e=snprintf --e=sprintf --e=vsnprintf --e=vsprintf --e=asprintf --e=vasprintf --e=sscanf --e=vsscanf --e=feof --e=ferror --e=fflush --e=fgetc --e=fgets --e=fopen --e=fputc --e=fputs --e=fread --e=fseek --e=ftell --e=fwrite --e=getc --e=getchar --e=putc --e=putchar --e=puts --e=remove --e=stderr --e=stdin --e=stdout --e=ungetc --e=imaxabs --e=imaxdiv --e=strtoimax --e=strtoumax --e=clock --e=clock_gettime --e=nanosleep --e=wctob --e=rpc_host_call --e=acos --e=acosf --e=acosh --e=acoshf --e=asin --e=asinf --e=asinh --e=asinhf --e=atan --e=atan2 --e=atan2f --e=atanf --e=atanh --e=atanhf --e=cbrt --e=cbrtf --e=ceil --e=ceilf --e=copysign --e=copysignf --e=cos --e=cosf --e=cosh --e=coshf --e=erf --e=erff --e=exp --e=exp10 --e=exp10f --e=exp2 --e=exp2f --e=expf --e=expm1 --e=expm1f --e=fabs --e=fabsf --e=fadd --e=fdim --e=fdimf --e=floor --e=floorf --e=fma --e=fmaf --e=fmax --e=fmaxf --e=fmin --e=fminf --e=fmod --e=fmodf --e=frexp --e=frexpf --e=getpayload --e=getpayloadf --e=hypot --e=hypotf --e=ilogb --e=ilogbf --e=ldexp --e=ldexpf --e=llogb --e=llogbf --e=llrint --e=llrintf --e=llround --e=llroundf --e=log --e=log10 --e=log10f --e=log1p --e=log1pf --e=log2 --e=log2f --e=logf --e=lrint --e=lrintf --e=lround --e=lroundf --e=modf --e=modff --e=nan --e=nanf --e=nearbyint --e=nearbyintf --e=nextafter --e=nextafterf --e=nexttoward --e=nexttowardf --e=pow --e=powf --e=powi --e=powif --e=remainder --e=remainderf --e=remquo --e=remquof --e=rint --e=rintf --e=round --e=roundf --e=scalbn --e=scalbnf --e=sin --e=sincos --e=sincosf --e=sinf --e=sinh --e=sinhf --e=sqrt --e=sqrtf --e=tan --e=tanf --e=tanh --e=tanhf --e=tgamma --e=tgammaf --e=lgamma --e=lgamma_r --e=trunc --e=truncf --e=canonicalizef16 --e=ceilf16 --e=copysignf16 --e=f16add --e=f16addf --e=f16div --e=f16divf --e=f16fma --e=f16fmaf --e=f16mul --e=f16mulf --e=f16sqrt --e=f16sqrtf --e=f16sub --e=f16subf --e=fabsf16 --e=fdimf16 --e=floorf16 --e=fmaxf16 --e=fmaximum_mag_numf16 --e=fmaximum_magf16 --e=fmaximum_numf16 --e=fmaximumf16 --e=fminf16 --e=fminimum_mag_numf16 --e=fminimum_magf16 --e=fminimum_numf16 --e=fminimumf16 --e=fmodf16 --e=frexpf16 --e=fromfpf16 --e=fromfpxf16 --e=getpayloadf16 --e=ilogbf16 --e=ldexpf16 --e=llogbf16 --e=llrintf16 --e=llroundf16 --e=logbf16 --e=lrintf16 --e=lroundf16 --e=modff16 --e=nanf16 --e=nearbyintf16 --e=nextafterf16 --e=nextdownf16 --e=nexttowardf16 --e=nextupf16 --e=remainderf16 --e=remquof16 --e=rintf16 --e=roundevenf16 --e=roundf16 --e=scalblnf16 --e=scalbnf16 --e=setpayloadf16 --e=setpayloadsigf16 --e=totalorderf16 --e=totalordermagf16 --e=truncf16 --e=ufromfpf16 --e=ufromfpxf16 --output_dir /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa/llvm-libc-decls/math.h
Traceback (most recent call last):

@mikhailramalho
Copy link
Member

@Jobhdez this PR broke rv32 build: https://lab.llvm.org/staging/#/builders/196/builds/423/steps/8/logs/stdio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants