Skip to content

Commit d206763

Browse files
8376602: [Vector API] Upgrade SLEEF library from v3.6.1 to v3.9 in Incubator Vector API
1 parent 784dd56 commit d206763

174 files changed

Lines changed: 20732 additions & 28711 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

make/UpdateSleefSource.gmk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ifneq ($(OPENJDK_BUILD_OS), linux)
4848
endif
4949

5050
SLEEF_SUPPORT_DIR := $(MAKESUPPORT_OUTPUTDIR)/sleef
51-
SLEEF_SOURCE_BASE_DIR := $(TOPDIR)/src/jdk.incubator.vector/linux/native/libsleef
51+
SLEEF_SOURCE_BASE_DIR := $(TOPDIR)/src/jdk.incubator.vector/unix/native/libsleef
5252
SLEEF_SOURCE_DIR := $(SLEEF_SOURCE_BASE_DIR)/upstream
5353
SLEEF_TARGET_DIR := $(SLEEF_SOURCE_BASE_DIR)/generated
5454
SLEEF_NATIVE_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/native
@@ -82,7 +82,11 @@ $(eval $(call SetupExecute, sleef_native_config, \
8282
INFO := Configuring native sleef build, \
8383
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
8484
WORKING_DIR := $(SLEEF_SOURCE_DIR), \
85-
COMMAND := $(CMAKE) -S . -B $(SLEEF_NATIVE_BUILD_DIR), \
85+
COMMAND := $(CMAKE) -S . -B $(SLEEF_NATIVE_BUILD_DIR) \
86+
-DCMAKE_INSTALL_PREFIX=$(SLEEF_NATIVE_BUILD_DIR) \
87+
-DSLEEF_BUILD_TESTS=OFF \
88+
-DSLEEF_ENABLE_SSL=OFF \
89+
-DSLEEF_ENABLE_TESTER4=OFF, \
8690
))
8791

8892
TARGETS := $(sleef_native_config)
@@ -106,6 +110,10 @@ $(eval $(call SetupExecute, sleef_cross_config, \
106110
-DCMAKE_C_COMPILER=$(CC) \
107111
-DCMAKE_TOOLCHAIN_FILE=$(SLEEF_CMAKE_FILE) \
108112
-DNATIVE_BUILD_DIR=$(SLEEF_NATIVE_BUILD_DIR) \
113+
-DCMAKE_INSTALL_PREFIX=$(SLEEF_CROSS_BUILD_DIR) \
114+
-DSLEEF_BUILD_TESTS=OFF \
115+
-DSLEEF_ENABLE_SSL=OFF \
116+
-DSLEEF_ENABLE_TESTER4=OFF \
109117
-DSLEEF_BUILD_INLINE_HEADERS=TRUE \
110118
$(EXTRA_CROSS_OPTIONS), \
111119
))
@@ -139,7 +147,7 @@ $(eval $(call SetupCopyFiles, copy_generated_sleef_source, \
139147
DEST := $(SLEEF_TARGET_DIR), \
140148
))
141149

142-
TARGETS := $(copy_generated_sleef_source)
150+
TARGETS := $(copy_static_sleef_source) $(copy_generated_sleef_source)
143151

144152
################################################################################
145153

src/jdk.incubator.vector/linux/legal/sleef.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## SLEEF v3.6.1
1+
## SLEEF v3.9.0
22

33
### Notice
44
```

src/jdk.incubator.vector/unix/native/libsleef/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This directory contains the source code for the SLEEF library, the
44
**SIMD Library for Evaluating Elementary Functions**. For more information on
55
SLEEF, see https://sleef.org/.
66

7-
The currently imported libsleef sources is version 3.6.1, which has
8-
git tag `3.6.1` and git commit hash `6ee14bcae5fe92c2ff8b000d5a01102dab08d774`.
7+
The currently imported libsleef sources is version 3.9.0, which has
8+
git tag `3.9.0` and git commit hash `906ca758b7b7922f35a13f6fa8733935564cb948`.
99

1010
# About the libsleef integration in the JDK
1111

src/jdk.incubator.vector/unix/native/libsleef/generated/misc.h

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright Naoki Shibata and contributors 2010 - 2024.
1+
// Copyright Naoki Shibata and contributors 2010 - 2025.
22
// Distributed under the Boost Software License, Version 1.0.
33
// (See accompanying file LICENSE.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
@@ -13,10 +13,15 @@
1313
#include <string.h>
1414
#endif
1515

16+
1617
#ifndef M_PI
1718
#define M_PI 3.141592653589793238462643383279502884
1819
#endif
1920

21+
#ifndef M_PIf
22+
# define M_PIf ((float)M_PI)
23+
#endif
24+
2025
#ifndef M_PIl
2126
#define M_PIl 3.141592653589793238462643383279502884L
2227
#endif
@@ -137,9 +142,17 @@
137142
#define L2Lf 1.428606765330187045e-06f
138143

139144
#define R_LN2f 1.442695040888963407359924681001892137426645954152985934135449406931f
140-
#ifndef M_PIf
141-
# define M_PIf ((float)M_PI)
142-
#endif
145+
146+
// Overflow bounds
147+
148+
// - exp(x) overflows for x over (also used in pow)
149+
#define LOG_DBL_MAX 0x1.62e42fefa39efp+9 /* 709.782712893384 */
150+
151+
// Other bounds
152+
153+
// - log1p(f)(x) approximation holds up to x equals
154+
#define LOG1PF_BOUND 0x1.2ced32p+126 /* 1.0e+38 */
155+
#define LOG1P_BOUND 0x1.c7b1f3cac7433p+1019 /* 1.0e+307 */
143156

144157
//
145158

@@ -183,17 +196,13 @@ typedef struct {
183196
} Sleef_longdouble2;
184197
#endif
185198

186-
#if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER)
199+
#if (defined (__GNUC__) || defined (__clang__)) && !defined(_MSC_VER)
187200

188201
#define LIKELY(condition) __builtin_expect(!!(condition), 1)
189202
#define UNLIKELY(condition) __builtin_expect(!!(condition), 0)
190203
#define RESTRICT __restrict__
191204

192-
#ifndef __arm__
193205
#define ALIGNED(x) __attribute__((aligned(x)))
194-
#else
195-
#define ALIGNED(x)
196-
#endif
197206

198207
#if defined(SLEEF_GENHEADER)
199208

@@ -229,15 +238,15 @@ typedef struct {
229238
#define SLEEF_INFINITYf __builtin_inff()
230239
#define SLEEF_INFINITYl __builtin_infl()
231240

232-
#if defined(__INTEL_COMPILER) || defined (__clang__)
241+
#if defined (__clang__)
233242
#define SLEEF_INFINITYq __builtin_inf()
234243
#define SLEEF_NANq __builtin_nan("")
235244
#else
236245
#define SLEEF_INFINITYq __builtin_infq()
237246
#define SLEEF_NANq (SLEEF_INFINITYq - SLEEF_INFINITYq)
238247
#endif
239248

240-
#elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER)
249+
#elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__)) && !defined(_MSC_VER)
241250

242251
#if defined(SLEEF_GENHEADER)
243252

@@ -249,6 +258,9 @@ typedef struct {
249258
#else // #if defined(SLEEF_GENHEADER)
250259

251260
#define INLINE __forceinline
261+
#ifdef CONST
262+
#undef CONST
263+
#endif
252264
#define CONST
253265
#ifndef SLEEF_STATIC_LIBS
254266
#define EXPORT __declspec(dllexport)
@@ -265,7 +277,7 @@ typedef struct {
265277
#define LIKELY(condition) (condition)
266278
#define UNLIKELY(condition) (condition)
267279

268-
#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) && !defined(SLEEF_GENHEADER)
280+
#if (defined(__GNUC__) || defined(__CLANG__)) && defined(__x86_64__) && !defined(SLEEF_GENHEADER)
269281
#include <x86intrin.h>
270282
#endif
271283

@@ -294,7 +306,7 @@ typedef struct {
294306
#endif
295307
#endif
296308

297-
#endif // #elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER)
309+
#endif // #elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__)) && !defined(_MSC_VER)
298310

299311
#if !defined(__linux__)
300312
#define isinff(x) ((x) == SLEEF_INFINITYf || (x) == -SLEEF_INFINITYf)
@@ -305,15 +317,9 @@ typedef struct {
305317

306318
#endif // #ifndef __MISC_H__
307319

308-
#ifdef ENABLE_AAVPCS
309-
#define VECTOR_CC __attribute__((aarch64_vector_pcs))
310-
#else
311-
#define VECTOR_CC
312-
#endif
313-
314320
//
315321

316-
#if defined (__GNUC__) && !defined(__INTEL_COMPILER)
322+
#if defined (__GNUC__)
317323
#pragma GCC diagnostic ignored "-Wpragmas"
318324
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
319325
#if !defined (__clang__)

0 commit comments

Comments
 (0)