Skip to content

Commit

Permalink
Merge branch 'master' of github.com:simd-everywhere/simde into neon_s…
Browse files Browse the repository at this point in the history
…implify_high
  • Loading branch information
easyaspi314 committed May 31, 2023
2 parents 7c38a69 + 62b9f2a commit 45bec97
Show file tree
Hide file tree
Showing 66 changed files with 1,558 additions and 166 deletions.
170 changes: 145 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
x86:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
isax:
- -mavx512bw -mavx512vl -mavx512cd -mavx512dq -mavx512vbmi -mavx512ifma -mavx512vpopcntdq -mavx512bitalg -mavx512vnni -mvpclmulqdq
Expand All @@ -105,9 +106,16 @@ jobs:
- -mavx
- -mfma
- -mavx2
include:
- target: tgl
- isax: -mavx512bw -mavx512vl -mavx512cd -mavx512dq -mavx512vbmi -mavx512ifma -mavx512vpopcntdq -mavx512bitalg -mavx512vnni -mvpclmulqdq -mavx512fp16
target: spr
env:
CFLAGS: -Wall -Wextra -Werror ${{ matrix.isax }}
CXXFLAGS: -Wall -Wextra -Werror ${{ matrix.isax }}
CC: gcc-12
CXX: g++-12
INTEL_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -121,10 +129,13 @@ jobs:
key: ${{ github.job }}-${{ matrix.isax }}
- name: Install APT Dependencies
run: |
sudo apt-get install -y ninja-build ninja-build python3-pip parallel gcovr
sudo apt-get install -y ninja-build ninja-build python3-pip parallel gcovr g++-12 gcc-12
sudo python3 -m pip install meson==0.55.0
- name: add ccache to the build path
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- name: Configure
run: meson setup build -Db_coverage=true
run: meson setup build -Db_coverage=true || (cat build/meson-logs/meson-log.txt ; false)
- name: Build
run: ninja -C build -v
- name: Test
Expand Down Expand Up @@ -238,6 +249,7 @@ jobs:

gcc:
strategy:
fail-fast: false
matrix:
include:
# - version: 4.7
Expand Down Expand Up @@ -308,6 +320,9 @@ jobs:
sudo apt-get update
sudo apt-get -yq install gcovr python3-pip ninja-build parallel "${CC}" "${CXX}"
sudo python3 -m pip install meson==0.55.0
- name: add ccache to the build path
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- name: Configure
run: meson setup build
- name: Build
Expand All @@ -317,8 +332,21 @@ jobs:

gcc-qemu:
strategy:
fail-fast: false
matrix:
include:
- version: 12
cross: armel
arch_gnu_abi: eabi
arch_deb: armel
arch_gnu: arm
distro: ubuntu-22.04
- version: 12
cross: armv7
arch_gnu: arm
arch_gnu_abi: eabihf
arch_deb: armhf
distro: ubuntu-22.04
- version: 12
cross: aarch64
arch_gnu: aarch64
Expand Down Expand Up @@ -352,8 +380,8 @@ jobs:
sudo add-apt-repository ppa:savoury1/virtualisation
sudo apt-get update -y
sudo apt-get -yq install ninja-build parallel \
gcc-${{ matrix.version }}-${{ matrix.arch_gnu }}-linux-gnu \
g++-${{ matrix.version }}-${{ matrix.arch_gnu }}-linux-gnu binfmt-support \
gcc-${{ matrix.version }}-${{ matrix.arch_gnu }}-linux-gnu${{ matrix.arch_gnu_abi }} \
g++-${{ matrix.version }}-${{ matrix.arch_gnu }}-linux-gnu${{ matrix.arch_gnu_abi }} binfmt-support \
qemu-user-static python3-pip libc6-${{ matrix.arch_deb }}-cross libstdc++-${{ matrix.version }}-dev-${{ matrix.arch_deb }}-cross
sudo python3 -m pip install meson==0.55.0
- name: ccache
Expand All @@ -370,31 +398,84 @@ jobs:
- name: Test
run: meson test -C build --print-errorlogs --print-errorlogs $(meson test -C build --list | grep -v emul)

clang-qemu:
strategy:
matrix:
include:
- version: 15
cross: armv7
arch_deb: armhf
arch_gnu_abi: eabihf
arch_gnu: arm
distro: ubuntu-22.04
- version: 15
cross: aarch64
arch_gnu: aarch64
arch_deb: arm64
distro: ubuntu-22.04
- version: 15
cross: armel
arch_gnu_abi: eabi
arch_deb: armel
arch_gnu: arm
distro: ubuntu-22.04
# - version: 15
# cross: armel
# arch_gnu_abi: eabi
# arch_deb: armel
# arch_gnu: arm
# distro: ubuntu-22.04
# - version: 15
# cross: riscv64
# arch_gnu: riscv64
# arch_deb: riscv64
# distro: ubuntu-22.04
# - version: 15
# cross: s390x
# arch_gnu: s390x
# arch_deb: s390x
# distro: ubuntu-22.04
- version: 15
cross: ppc64el
arch_deb: ppc64el
arch_gnu: powerpc64le
distro: ubuntu-22.04
runs-on: ${{ matrix.distro }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: sudo apt-get update
- name: CPU Information
run: cat /proc/cpuinfo
- name: Install APT Dependencies
run: |
sudo add-apt-repository ppa:savoury1/virtualisation
sudo apt-get update -y
sudo apt-get -yq install ninja-build parallel \
binfmt-support clang-${{ matrix.version }} clang++-${{ matrix.version }} \
qemu-user-static python3-pip libc6-${{ matrix.arch_deb }}-cross libstdc++-12-dev-${{ matrix.arch_deb }}-cross \
binutils-${{ matrix.arch_gnu }}-linux-gnu${{ matrix.arch_gnu_abi }}
sudo python3 -m pip install meson==0.55.0
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.distro }}-${{ matrix.cross }}
- name: add ccache to the build path
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- name: Configure
run: meson setup --cross-file=docker/cross-files/${{ matrix.cross }}-clang-${{ matrix.version }}-ccache.cross build
- name: Build
run: ninja -C build -v
- name: Test
run: meson test -C build --print-errorlogs --print-errorlogs $(meson test -C build --list | grep -v emul)

clang:
strategy:
fail-fast: false
matrix:
include:
# - version: "3.5"
# distro: ubuntu-16.04
# arch_flags: -mavx2
# - version: "3.6"
# distro: ubuntu-16.04
# arch_flags: -mavx2
# - version: "3.7"
# distro: ubuntu-16.04
# arch_flags: -mavx2
# - version: "3.8"
# distro: ubuntu-16.04
# arch_flags: -mavx2
#- version: "3.9"
# distro: ubuntu-18.04
# arch_flags: -mavx2
# - version: "4.0"
# distro: ubuntu-18.04
# arch_flags: -mavx2
#- version: "5.0"
# distro: ubuntu-18.04
# arch_flags: -mavx2
# - version: "6.0"
# distro: ubuntu-20.04
# arch_flags: -march=native
Expand Down Expand Up @@ -458,6 +539,10 @@ jobs:
sudo apt-get update
sudo apt-get -yq install gcovr ninja-build python3-pip clang-${{ matrix.version }}
sudo python3 -m pip install meson==0.55.0
- name: add ccache to the build path
if: ${{ matrix.ccache == 'true' }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- name: Configure
run: meson setup build
- name: Build
Expand Down Expand Up @@ -559,3 +644,38 @@ jobs:
run: |
meson --backend=ninja build --cross-file test/arm64cl.txt
meson test -C build --print-errorlogs $(meson test -C build --list | grep -v emul)
linux-gcc-loongarch64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: CPU Information
run: cat /proc/cpuinfo
- name: Install APT Dependencies
run: |
sudo add-apt-repository ppa:savoury1/virtualisation
sudo apt-get install -y ninja-build ninja-build meson qemu-user-static
- name: Download and install loongarch64-toolchain
run: |
wget https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-7.3-cross-tools-gcc-glibc.tar.xz
tar -xf loongarch64-clfs-7.3-cross-tools-gcc-glibc.tar.xz -C /opt
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-loongarch64-gcc-13
- name: set env
run: |
echo "LD_LIBRARY_PATH=/opt/cross-tools/target/usr/lib64:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$GITHUB_WORKSPACE:/opt/cross-tools/bin:$PATH" >> $GITHUB_ENV
- name: Disable SVML tests
run: |
sed -i "/svml/d" test/x86/meson.build
rm test/x86/svml.c
echo "Due to the qemu versions 7.2 through 8.0 causing timeouts in four sets of test cases,"
echo "the SVML tests have been temporarily disabled."
- name: Configure
run: meson setup build --cross-file=docker/cross-files/loongarch64-gcc-13-ccache.cross
- name: Build
run: meson compile -C build -v
- name: Test
run: meson test -C build --print-errorlogs
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM debian:${RELEASE}-slim

ARG DEBIAN_FRONTEND=noninteractive
ARG QEMU_GIT=n
ARG ARCHS="arm64 armel armhf i386 mips64el ppc64el s390x"
ARG ARCHS="arm64 armel armhf i386 mips64el ppc64el s390x riscv64"

RUN \
apt-get update -y && \
Expand All @@ -26,7 +26,7 @@ RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -yq --no-install-recommends \
git build-essential \
git build-essential vim \
ccache cmake ninja-build \
'^clang-[0-9\.]+$' \
'^llvm-[0-9\.]+$' \
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN \
echo ${PACKAGES_TO_INSTALL} ; \
apt-get install -yq ${PACKAGES_TO_INSTALL}

ENV PATH="/usr/lib/ccache:$PATH:/root/.local/bin"
ENV PATH="/usr/lib/ccache:$PATH:/root/.local/bin:/root/.jsvu/bin"

# ICC
RUN \
Expand Down
112 changes: 112 additions & 0 deletions docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Dockerfile for SIMDe development

FROM ubuntu:focal

ARG DEBIAN_FRONTEND=noninteractive
ARG QEMU_GIT=n
ARG ARCHS="arm64"
#"arm64 armel armhf i386 mips64el ppc64el s390x riscv64"

COPY docker/bin /tmp/simde-bin
RUN \
for script in simde-reset-build.sh; do \
ln -s /usr/local/src/simde/docker/bin/"${script}" /usr/bin/"${script}"; \
done

# Common packages
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -yq --no-install-recommends \
git build-essential vim \
ccache cmake ninja-build \
'^clang-[0-9\.]+$' \
'^llvm-[0-9\.]+$' \
'^g(cc|\+\+)-[0-9\.]+$' \
gdb valgrind \
binfmt-support qemu-user-static \
creduce screen htop parallel nano rsync strace \
npm libsleef-dev \
pipx wget

# Meson on stable is too old, and we want to make sure we keep 0.55
# working for a while.
RUN pipx install meson==0.55.0

# GCC cross-compilers
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y apt-file && \
apt-file update
RUN \
PACKAGES_TO_INSTALL=""; \
for ARCH in ${ARCHS}; do \
PACKAGES_TO_INSTALL="${PACKAGES_TO_INSTALL} libc6-${ARCH}-cross libstdc++-[0-9]*-dev-${ARCH}-cross"; \
PACKAGES_TO_INSTALL="${PACKAGES_TO_INSTALL} $(apt-file search -x "/usr/bin/$(/tmp/simde-bin/arch2gcc.sh ${ARCH})-(ar|g(cc|\+\+)-[0-9\.]+)" | awk -F: '{ print $1}')"; \
done; \
echo ${PACKAGES_TO_INSTALL} ; \
apt-get install -yq ${PACKAGES_TO_INSTALL}

ENV PATH="/usr/lib/ccache:$PATH:/root/.local/bin:/root/.jsvu/bin"

# ICC
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -yq curl gpg && \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor > /usr/share/keyrings/oneapi-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/oneAPI.list && \
apt-get update && \
apt-get install -yq --no-install-recommends intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-dpcpp-cpp && \
for exe in icc icpc icx icpx; do \
printf '#!/bin/bash\nARGS="$@"\nsource /opt/intel/oneapi/compiler/latest/env/vars.sh >/dev/null\n%s ${ARGS}\n' "${exe}" > /usr/bin/"${exe}" && \
chmod 0755 /usr/bin/"${exe}" ; \
done

# # xlc -- Install fails.
# # Once IBM releases a version for Ubuntu Focal (20.04) I hope I can
# # get this working.
# RUN \
# curl -s 'https://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/ubuntu/public.gpg' | apt-key add - && \
# echo "deb [arch=ppc64el] https://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/ubuntu/ bionic main" > /etc/apt/sources.list.d/xlc.list && \
# apt-get update && \
# XLC_VERSION="$(apt-cache search '^xlc\.[0-9]+\.[0-9]+\.[0-9]+$' | awk '{ print substr($1, 5) }')" && \
# apt-get install "xlc.${XLC_VERSION}:ppc64el" "xlc-license-community.${XLC_VERSION}:ppc64el" && \
# /opt/ibm/xlC/${XLC_VERSION}/bin/xlc_configure <<< 1 >/dev/null

# Intel SDE
COPY test/download-sde.sh /tmp/simde-bin/download-sde.sh
RUN \
"/tmp/simde-bin/download-sde.sh" "/opt/intel/sde" && \
for executable in sde sde64; do \
ln -s "/opt/intel/sde/${executable}" "/usr/bin/${executable}"; \
done

# Emscripten
RUN \
git clone https://github.com/emscripten-core/emsdk.git /opt/emsdk && \
cd /opt/emsdk && ./emsdk install tot && ./emsdk activate tot && \
ln -s /opt/emsdk/upstream/bin/wasm-ld /usr/bin/wasm-ld && \
npm install jsvu -g && jsvu --os=linux64 --engines=v8 && ln -s "/root/.jsvu/v8" "/usr/bin/v8"

# Meson cross files
RUN \
mkdir -p "/usr/local/share/meson/cross" && ln -s /usr/local/src/simde/docker/cross-files /usr/local/share/meson/cross/simde

# Install QEMU git (necessary for MIPS)
RUN \
if [ ${QEMU_GIT} = "y" ]; then \
apt-get install -y pkg-config libglib2.0-dev libpixman-1-dev && \
git clone https://gitlab.com/qemu-project/qemu.git /usr/local/src/qemu && \
mkdir -p /usr/local/src/qemu/build && cd /usr/local/src/qemu/build && \
../configure --prefix=/opt/qemu && \
make -j$(nproc) && \
make install; \
rm -rf /usr/local/src/qemu; \
fi

RUN mkdir -p /opt/simde
WORKDIR /opt/simde
ENV CCACHE_DIR=/opt/simde/.ccache CCACHE_COMPRESS=1
Loading

0 comments on commit 45bec97

Please sign in to comment.