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
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,45 @@ jobs:
when: always
- run: ninja -C build -v test

portable-memfunctions:
resource_class: large
docker:
- image: debian:testing-slim
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
environment:
CFLAGS: -Wextra -Werror -march=native -DSIMDE_NO_STDLIB
CXXFLAGS: -Wextra -Werror -march=native -DSIMDE_NO_STDLIB
CC: gcc
CXX: g++
steps:
- run: apt-get update && apt-get install -y git ssh ninja-build pipx python3-setuptools python3-wheel gcovr gcc g++ ccache
- checkout
- restore_cache:
keys:
- ccache-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
- ccache-{{ .Environment.CIRCLE_JOB }}-master
- ccache-{{ .Environment.CIRCLE_JOB }}
- run: cat /proc/cpuinfo /proc/meminfo
- run:
command: |
ccache --set-config=max_size='500M'
ccache --set-config=compression=true
ccache -p
ccache -z
- run: pipx install meson==0.55.1
- run: |
export PATH=/usr/lib/ccache:${PATH}
CC="ccache gcc" CXX="ccache g++" /root/.local/bin/meson setup build
ninja -C build -v -j 5
- run: /usr/bin/ccache -s
- save_cache:
key: 'ccache-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ epoch }}'
paths: [ "/root/.cache/ccache" ]
when: always
- run: ninja -C build -v test

clang:
resource_class: large
docker:
Expand Down Expand Up @@ -197,6 +236,11 @@ workflows:
branches:
ignore:
- /^ci/(?!circleci).*$/
- portable-memfunctions:
filters:
branches:
ignore:
- /^ci/(?!circleci).*$/
- gcc:
filters:
branches:
Expand Down
20 changes: 10 additions & 10 deletions simde/simde-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,17 +680,17 @@ HEDLEY_DIAGNOSTIC_POP
#endif

/* Try to deal with environments without a standard library. */
#if !defined(simde_memcpy)
#if !defined(simde_memcpy) && !defined(SIMDE_NO_STDLIB)
#if HEDLEY_HAS_BUILTIN(__builtin_memcpy)
#define simde_memcpy(dest, src, n) __builtin_memcpy(dest, src, n)
#endif
#endif
#if !defined(simde_memset)
#if !defined(simde_memset) && !defined(SIMDE_NO_STDLIB)
#if HEDLEY_HAS_BUILTIN(__builtin_memset)
#define simde_memset(s, c, n) __builtin_memset(s, c, n)
#endif
#endif
#if !defined(simde_memcmp)
#if !defined(simde_memcmp) && !defined(SIMDE_NO_STDLIB)
#if HEDLEY_HAS_BUILTIN(__builtin_memcmp)
#define simde_memcmp(s1, s2, n) __builtin_memcmp(s1, s2, n)
#endif
Expand All @@ -707,7 +707,7 @@ HEDLEY_DIAGNOSTIC_POP
#endif
#endif

#if !defined(SIMDE_NO_STRING_H)
#if !defined(SIMDE_NO_STRING_H) && !defined(SIMDE_NO_STDLIB)
#include <string.h>
#if !defined(simde_memcpy)
#define simde_memcpy(dest, src, n) memcpy(dest, src, n)
Expand All @@ -730,7 +730,7 @@ HEDLEY_DIAGNOSTIC_POP
void
simde_memcpy_(void* dest, const void* src, size_t len) {
char* dest_ = HEDLEY_STATIC_CAST(char*, dest);
char* src_ = HEDLEY_STATIC_CAST(const char*, src);
const char* src_ = HEDLEY_STATIC_CAST(const char*, src);
for (size_t i = 0 ; i < len ; i++) {
dest_[i] = src_[i];
}
Expand All @@ -745,19 +745,19 @@ HEDLEY_DIAGNOSTIC_POP
char* s_ = HEDLEY_STATIC_CAST(char*, s);
char c_ = HEDLEY_STATIC_CAST(char, c);
for (size_t i = 0 ; i < len ; i++) {
s_[i] = c_[i];
s_[i] = c_;
}
}
#define simde_memset(s, c, n) simde_memset_(s, c, n)
#endif

#if !defined(simde_memcmp)
SIMDE_FUCTION_ATTRIBUTES
SIMDE_FUNCTION_ATTRIBUTES
int
simde_memcmp_(const void *s1, const void *s2, size_t n) {
unsigned char* s1_ = HEDLEY_STATIC_CAST(unsigned char*, s1);
unsigned char* s2_ = HEDLEY_STATIC_CAST(unsigned char*, s2);
for (size_t i = 0 ; i < len ; i++) {
const unsigned char* s1_ = HEDLEY_STATIC_CAST(const unsigned char*, s1);
const unsigned char* s2_ = HEDLEY_STATIC_CAST(const unsigned char*, s2);
for (size_t i = 0 ; i < n ; i++) {
if (s1_[i] != s2_[i]) {
return (int) (s1_[i] - s2_[i]);
}
Expand Down
Loading