Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
container:
image: debian:trixie-slim

task:
name: Alpine (musl + GCC + SIMDE_NO_NATIVE)
skip: $BRANCH == "master" || ($BRANCH != 'ci/cirrus' && $BRANCH =~ '^ci/.+')
container:
image: alpine:latest
env:
CC: gcc
CXX: g++
install_dependencies_script:
- apk add --no-cache build-base meson ninja python3
configure_script:
- meson setup build -Dc_args="-DSIMDE_NO_NATIVE -Wextra -Werror" -Dcpp_args="-DSIMDE_NO_NATIVE -Wextra -Werror"
build_script:
- ninja -C build -v -j 3
test_script:
- ninja -C build -v test

task:
name: Sanitizers
skip: $BRANCH == "master" || ($BRANCH != 'ci/cirrus' && $BRANCH =~ '^ci/.+')
Expand Down
21 changes: 17 additions & 4 deletions simde/simde-math.h
Original file line number Diff line number Diff line change
Expand Up @@ -1266,9 +1266,17 @@ simde_math_fpclass(double v, const int imm8) {
#endif

#if !defined(simde_math_roundeven)
/* GCC 10+ lowers __builtin_roundeven to a libm roundeven() call when
* the target has no native instruction. roundeven() is C23 and only
* available in glibc >= 2.25; other platforms (musl, OpenBSD, MinGW,
* etc.) lack the symbol and produce a link error. Clang lowers the
* builtin to an llvm.roundeven.* intrinsic which is always emitted
* inline (no libm dependency), so the GCC guard is not needed there. */
#if \
((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundeven)) || \
HEDLEY_GCC_VERSION_CHECK(10,0,0)
((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && \
HEDLEY_HAS_BUILTIN(__builtin_roundeven) && \
(!HEDLEY_GCC_VERSION_CHECK(10,0,0) || \
(defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25)))))
#define simde_math_roundeven(v) __builtin_roundeven(v)
#elif defined(simde_math_round) && defined(simde_math_fabs)
static HEDLEY_INLINE
Expand All @@ -1286,9 +1294,14 @@ simde_math_fpclass(double v, const int imm8) {
#endif

#if !defined(simde_math_roundevenf)
/* Same rationale as simde_math_roundeven above; applies to the float
* variant. GCC 10+ requires glibc >= 2.25 for roundevenf(); Clang
* is always safe via llvm.roundeven.f32 inline expansion. */
#if \
((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundevenf)) || \
HEDLEY_GCC_VERSION_CHECK(10,0,0)
((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && \
HEDLEY_HAS_BUILTIN(__builtin_roundevenf) && \
(!HEDLEY_GCC_VERSION_CHECK(10,0,0) || \
(defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25)))))
#define simde_math_roundevenf(v) __builtin_roundevenf(v)
#elif defined(simde_math_roundf) && defined(simde_math_fabsf)
static HEDLEY_INLINE
Expand Down
Loading