Skip to content

Commit b6799e4

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merge upstream LLVM into amd-gfx12
2 parents 5cf45ce + 9609655 commit b6799e4

File tree

40 files changed

+1581
-234
lines changed

40 files changed

+1581
-234
lines changed

.github/workflows/build-ci-container-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
jobs:
2121
build-ci-container-windows:
2222
if: github.repository_owner == 'llvm'
23-
runs-on: windows-2019
23+
runs-on: windows-2022
2424
outputs:
2525
container-name: ${{ steps.vars.outputs.container-name }}
2626
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
@@ -34,7 +34,7 @@ jobs:
3434
id: vars
3535
run: |
3636
$tag = [int64](Get-Date -UFormat %s)
37-
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2019"
37+
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2022"
3838
echo "container-name=${container_name}" >> $env:GITHUB_OUTPUT
3939
echo "container-name-tag=${container_name}:${tag}" >> $env:GITHUB_OUTPUT
4040
echo "container-filename=ci-windows-${tag}.tar" >> $env:GITHUB_OUTPUT
@@ -58,7 +58,7 @@ jobs:
5858
- build-ci-container-windows
5959
permissions:
6060
packages: write
61-
runs-on: windows-2019
61+
runs-on: windows-2022
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
steps:

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Agent image for LLVM org cluster.
22
# .net 4.8 is required by chocolately package manager.
3-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
3+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
44

55
# Restore the default Windows shell for correct batch processing.
66
SHELL ["cmd", "/S", "/C"]

libc/shared/math.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "math/frexpf.h"
1717
#include "math/frexpf128.h"
1818
#include "math/frexpf16.h"
19+
#include "math/ldexpf.h"
1920
#include "math/ldexpf128.h"
21+
#include "math/ldexpf16.h"
2022

2123
#endif // LLVM_LIBC_SHARED_MATH_H

libc/shared/math/ldexpf.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- Shared ldexpf function ----------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SHARED_MATH_LDEXPF_H
10+
#define LLVM_LIBC_SHARED_MATH_LDEXPF_H
11+
12+
#include "shared/libc_common.h"
13+
#include "src/__support/math/ldexpf.h"
14+
15+
namespace LIBC_NAMESPACE_DECL {
16+
namespace shared {
17+
18+
using math::ldexpf;
19+
20+
} // namespace shared
21+
} // namespace LIBC_NAMESPACE_DECL
22+
23+
#endif // LLVM_LIBC_SHARED_MATH_LDEXPF_H

libc/shared/math/ldexpf16.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//===-- Shared ldexpf16 function --------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SHARED_MATH_LDEXPF16_H
10+
#define LLVM_LIBC_SHARED_MATH_LDEXPF16_H
11+
12+
#include "include/llvm-libc-macros/float16-macros.h"
13+
14+
#ifdef LIBC_TYPES_HAS_FLOAT16
15+
16+
#include "shared/libc_common.h"
17+
#include "src/__support/math/ldexpf16.h"
18+
19+
namespace LIBC_NAMESPACE_DECL {
20+
21+
namespace shared {
22+
23+
using math::ldexpf16;
24+
25+
} // namespace shared
26+
27+
} // namespace LIBC_NAMESPACE_DECL
28+
29+
#endif // LIBC_TYPES_HAS_FLOAT16
30+
31+
#endif // LLVM_LIBC_SHARED_MATH_LDEXPF16_H

libc/src/__support/math/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,21 @@ add_header_library(
9292
libc.src.__support.FPUtil.manipulation_functions
9393
libc.include.llvm-libc-types.float128
9494
)
95+
96+
add_header_library(
97+
ldexpf16
98+
HDRS
99+
ldexpf16.h
100+
DEPENDS
101+
libc.src.__support.macros.properties.types
102+
libc.src.__support.FPUtil.manipulation_functions
103+
libc.include.llvm-libc-macros.float16_macros
104+
)
105+
106+
add_header_library(
107+
ldexpf
108+
HDRS
109+
ldexpf.h
110+
DEPENDS
111+
libc.src.__support.FPUtil.manipulation_functions
112+
)

libc/src/__support/math/ldexpf.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===-- Implementation header for ldexpf ------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF_H
10+
#define LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF_H
11+
12+
#include "src/__support/FPUtil/ManipulationFunctions.h"
13+
#include "src/__support/common.h"
14+
#include "src/__support/macros/config.h"
15+
16+
namespace LIBC_NAMESPACE_DECL {
17+
18+
namespace math {
19+
20+
static constexpr float ldexpf(float x, int exp) {
21+
return fputil::ldexp(x, exp);
22+
}
23+
24+
} // namespace math
25+
26+
} // namespace LIBC_NAMESPACE_DECL
27+
28+
#endif // LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF_H

libc/src/__support/math/ldexpf16.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//===-- Implementation header for ldexpf16 ----------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF16_H
10+
#define LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF16_H
11+
12+
#include "include/llvm-libc-macros/float16-macros.h"
13+
14+
#ifdef LIBC_TYPES_HAS_FLOAT16
15+
16+
#include "src/__support/FPUtil/ManipulationFunctions.h"
17+
#include "src/__support/common.h"
18+
#include "src/__support/macros/config.h"
19+
20+
namespace LIBC_NAMESPACE_DECL {
21+
22+
namespace math {
23+
24+
static constexpr float16 ldexpf16(float16 x, int exp) {
25+
return fputil::ldexp(x, exp);
26+
}
27+
28+
} // namespace math
29+
30+
} // namespace LIBC_NAMESPACE_DECL
31+
32+
#endif // LIBC_TYPES_HAS_FLOAT16
33+
34+
#endif // LLVM_LIBC_SRC___SUPPORT_MATH_LDEXPF16_H

libc/src/math/generic/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ add_entrypoint_object(
19131913
HDRS
19141914
../ldexpf.h
19151915
DEPENDS
1916-
libc.src.__support.FPUtil.manipulation_functions
1916+
libc.src.__support.math.ldexpf
19171917
)
19181918

19191919
add_entrypoint_object(
@@ -1933,8 +1933,7 @@ add_entrypoint_object(
19331933
HDRS
19341934
../ldexpf16.h
19351935
DEPENDS
1936-
libc.src.__support.macros.properties.types
1937-
libc.src.__support.FPUtil.manipulation_functions
1936+
libc.src.__support.math.ldexpf16
19381937
)
19391938

19401939
add_entrypoint_object(

libc/src/math/generic/ldexpf.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/math/ldexpf.h"
10-
#include "src/__support/FPUtil/ManipulationFunctions.h"
11-
#include "src/__support/common.h"
12-
#include "src/__support/macros/config.h"
10+
#include "src/__support/math/ldexpf.h"
1311

1412
namespace LIBC_NAMESPACE_DECL {
1513

1614
LLVM_LIBC_FUNCTION(float, ldexpf, (float x, int exp)) {
17-
return fputil::ldexp(x, exp);
15+
return math::ldexpf(x, exp);
1816
}
1917

2018
} // namespace LIBC_NAMESPACE_DECL

0 commit comments

Comments
 (0)