From ca4dfb79275e0386394a6e71818e8d087855e70d Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Thu, 1 Feb 2024 17:47:36 +0100 Subject: [PATCH] Test SVE2 --- .github/workflows/unit.yml | 2 ++ test/simd.cpp | 19 ++++++++++++------- test/toolchain/gcc.aarch64.sve2.cmake | 13 +++++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 test/toolchain/gcc.aarch64.sve2.cmake diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 4570754..9759026 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -163,6 +163,8 @@ jobs: - { comp: gcc , arch: aarch64 , opts: -Wno-psabi, mode: Release } - { comp: gcc , arch: aarch64.sve , opts: -Wno-psabi, mode: Debug } - { comp: gcc , arch: aarch64.sve , opts: -Wno-psabi, mode: Release } + - { comp: gcc , arch: aarch64.sve2, opts: -Wno-psabi, mode: Debug } + - { comp: gcc , arch: aarch64.sve2, opts: -Wno-psabi, mode: Release } - { comp: gcc , arch: ppc64 , opts: -Wno-psabi, mode: Debug } - { comp: gcc , arch: ppc64 , opts: -Wno-psabi, mode: Release } steps: diff --git a/test/simd.cpp b/test/simd.cpp index b6866dd..8196ee0 100644 --- a/test/simd.cpp +++ b/test/simd.cpp @@ -50,14 +50,19 @@ int main() std::cout << "ARM SIMD status: " << std::boolalpha << (spy::simd_instruction_set == spy::arm_simd_ ) << std::endl; std::cout << "NEON status: " << std::boolalpha << (spy::simd_instruction_set >= spy::neon_ ) << std::endl; std::cout << "ASIMD status: " << std::boolalpha << (spy::simd_instruction_set >= spy::asimd_) << std::endl; - std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set >= spy::sve_); - if constexpr(spy::simd_instruction_set.has_fixed_cardinal()) - { - std::cout << " - fixed size: " << spy::simd_instruction_set.width << " bits" << std::endl; - } - else + + std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set == spy::sve_ ) << std::endl; + std::cout << "SVE status: " << std::boolalpha << (spy::simd_instruction_set == spy::sve2_) << std::endl; + if constexpr(spy::simd_instruction_set >= spy::sve_) { - std::cout << " - flexible size" << std::endl; + if constexpr(spy::simd_instruction_set.has_fixed_cardinal()) + { + std::cout << "SVE uses fixed size: " << spy::simd_instruction_set.width << " bits" << std::endl; + } + else + { + std::cout << "SVE uses flexible size" << std::endl; + } } } std::cout << std::endl; diff --git a/test/toolchain/gcc.aarch64.sve2.cmake b/test/toolchain/gcc.aarch64.sve2.cmake new file mode 100644 index 0000000..cc6be36 --- /dev/null +++ b/test/toolchain/gcc.aarch64.sve2.cmake @@ -0,0 +1,13 @@ +##================================================================================================== +## SPY - C++ Informations Broker +## Copyright : SPY Project Contributors +## SPDX-License-Identifier: BSL-1.0 +##================================================================================================== +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR arm) + +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-12 ) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-12 ) +set(CMAKE_CXX_FLAGS "-march=armv8-a+sve2 -msve-vector-bits=512" ) + +set(CMAKE_CROSSCOMPILING_CMD qemu-aarch64)