Skip to content
Open
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
4 changes: 4 additions & 0 deletions .github/toolchains/gcc-loongarch64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_PROCESSOR loongarch64)
set(triple loongarch64-linux-gnu)

include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake)
65 changes: 65 additions & 0 deletions .github/workflows/cross-loongarch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: LoongArch64 cross-compilation build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
name: 'LoongArch64 ${{ matrix.simd.name }}'
strategy:
fail-fast: false
matrix:
simd:
- { name: 'LSX', flags: '-mlsx' }
- { name: 'LASX', flags: '-mlasx' }
steps:
- name: Setup compiler
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq --no-install-suggests --no-install-recommends install \
gcc-14-loongarch64-linux-gnu \
g++-14-loongarch64-linux-gnu
sudo update-alternatives --install /usr/bin/loongarch64-linux-gnu-gcc \
loongarch64-linux-gnu-gcc /usr/bin/loongarch64-linux-gnu-gcc-14 20
sudo update-alternatives --install /usr/bin/loongarch64-linux-gnu-g++ \
loongarch64-linux-gnu-g++ /usr/bin/loongarch64-linux-gnu-g++-14 20
loongarch64-linux-gnu-g++ --version
- name: Setup QEMU
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq --no-install-suggests --no-install-recommends install qemu-user-static
qemu-loongarch64-static --version
- name: Setup Ninja
run: |
sudo apt-get -y -qq install ninja-build
- name: Checkout xsimd
uses: actions/checkout@v6
- name: Setup
run: >-
cmake -S . -B _build
-GNinja
-DBUILD_TESTS=ON
-DDOWNLOAD_DOCTEST=ON
-DCMAKE_BUILD_TYPE=Release
-DTARGET_ARCH=generic
-DCMAKE_C_FLAGS="${{ matrix.simd.flags }}"
-DCMAKE_CXX_FLAGS="${{ matrix.simd.flags }}"
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/gcc-loongarch64-linux-gnu.cmake
- name: Build
run: cmake --build _build
- name: Set CPU feature test expectations
run: |
echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_NEON64=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_SVE=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_RVV=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_LSX=1" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_LASX=1" >> "$GITHUB_ENV"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect two different runs with different qemu invocation and different feature tests, one for LSX and one for LASX?

echo "XSIMD_TEST_CPU_ASSUME_VSX=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_VXE=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_MANUFACTURER=unknown" >> "$GITHUB_ENV"
- name: Testing xsimd
timeout-minutes: 15
run: qemu-loongarch64-static -L /usr/loongarch64-linux-gnu ./test/test_xsimd
working-directory: ${{ github.workspace }}/_build
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ARM | NEON, NEON64, SVE128/256/512 (fixed vector size)
WebAssembly | WASM
powerpc64 | VSX
RISC-V | RISC-V128/256/512 (fixed vector size)
LoongArch64 | LSX, LASX
IBM Z (s390x)| VXE (IBM z14)

## Installation
Expand Down
1 change: 1 addition & 0 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ INPUT = ../include/xsimd/types/xsimd_api.hpp \
../include/xsimd/types/xsimd_neon64_register.hpp \
../include/xsimd/types/xsimd_neon_register.hpp \
../include/xsimd/types/xsimd_rvv_register.hpp \
../include/xsimd/types/xsimd_lsx_register.hpp \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be an lsx register file and an lasx register file

../include/xsimd/types/xsimd_sse2_register.hpp \
../include/xsimd/types/xsimd_sse3_register.hpp \
../include/xsimd/types/xsimd_sse4_1_register.hpp \
Expand Down
4 changes: 4 additions & 0 deletions include/xsimd/arch/xsimd_isa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@
#include "./xsimd_rvv.hpp"
#endif

#if XSIMD_WITH_LSX || XSIMD_WITH_LASX
#include "./xsimd_lsx.hpp"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and a split between the different implementation here. the idea is that lsx support could be on even when lasx is not supported

#endif

#if XSIMD_WITH_WASM
#include "./xsimd_wasm.hpp"
#endif
Expand Down
Loading