From ef2f8f03fa463fb6a09990fc2fab89815ba50a4b Mon Sep 17 00:00:00 2001 From: Cuda-Chen Date: Fri, 17 Nov 2023 22:17:43 +0800 Subject: [PATCH] Add A32 support in CI Add A32 support in CI. Choose Cortex-A32 as test target because it only supports AArch32. Moreover, Cortex-A32 has Armv8-A Cryptographic Extension, which is an ideal target for testing Cryptographic Extension conversions. --- .github/workflows/github_actions.yml | 8 +++++++- Makefile | 26 ++++++++++++++++++-------- README.md | 13 ++++++++++++- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 798aaed3..f259025c 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -55,7 +55,12 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - arch_with_features: [{arch: armv7, feature: none}, {arch: aarch64, feature: none}, {arch: aarch64, feature: crypto+crc}] + arch_with_features: [ + {arch: armv7, feature: none, arch_cflags: none}, + {arch: aarch64, feature: none, arch_cflags: none}, + {arch: aarch64, feature: crypto+crc, arch_cflags: none}, + {arch: armv7, feature: none, arch_cflags: '-mcpu=cortex-a32 -mfpu=neon-fp-armv8'} + ] cxx_compiler: [g++-10, clang++-11] steps: - name: checkout code @@ -69,6 +74,7 @@ jobs: distro: ubuntu20.04 env: | CXX: ${{ matrix.cxx_compiler }} + ARCH_CFLAGS: ${{ matrix.arch_with_features.arch_cflags }} install: | apt-get update -q -y apt-get install -q -y "${{ matrix.cxx_compiler }}" make diff --git a/Makefile b/Makefile index f31dfab9..999a3a7b 100644 --- a/Makefile +++ b/Makefile @@ -29,14 +29,24 @@ EXEC_WRAPPER = qemu-$(processor) endif # Follow platform-specific configurations -ifeq ($(processor),$(filter $(processor),aarch64 arm64)) - ARCH_CFLAGS = -march=armv8-a+fp+simd -else ifeq ($(processor),$(filter $(processor),i386 x86_64)) - ARCH_CFLAGS = -maes -mpclmul -mssse3 -msse4.2 -else ifeq ($(processor),$(filter $(processor),arm armv7 armv7l)) - ARCH_CFLAGS = -mfpu=neon -else - $(error Unsupported architecture) +ARCH_CFLAGS ?= +ARCH_CFLAGS_IS_SET = +ifeq ($(ARCH_CFLAGS),) + ARCH_CFLAGS_IS_SET = true +endif +ifeq ($(ARCH_CFLAGS),none) + ARCH_CFLAGS_IS_SET = true +endif +ifdef ARCH_CFLAGS_IS_SET + ifeq ($(processor),$(filter $(processor),aarch64 arm64)) + override ARCH_CFLAGS := -march=armv8-a+fp+simd + else ifeq ($(processor),$(filter $(processor),i386 x86_64)) + override ARCH_CFLAGS := -maes -mpclmul -mssse3 -msse4.2 + else ifeq ($(processor),$(filter $(processor),arm armv7 armv7l)) + override ARCH_CFLAGS := -mfpu=neon + else + $(error Unsupported architecture) + endif endif FEATURE ?= diff --git a/README.md b/README.md index 83dfb075..e039950d 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,25 @@ $ make FEATURE=crypto+crc check You can specify GNU toolchain for cross compilation as well. [QEMU](https://www.qemu.org/) should be installed in advance. + +For ARMv8-A running in 64-bit mode type: ```shell $ make CROSS_COMPILE=aarch64-linux-gnu- check # ARMv8-A ``` -or + +For ARMv7-A type: ```shell $ make CROSS_COMPILE=arm-linux-gnueabihf- check # ARMv7-A ``` +For ARMv8-A running in 32-bit mode (A32 instruction set), type: +``` shell +$ make \ + CROSS_COMPILE=arm-linux-gnueabihf- \ + ARCH_CFLAGS="-mcpu=cortex-a32 -mfpu=neon-fp-armv8" \ + check +``` + Check the details via [Test Suite for SSE2NEON](tests/README.md). ## Adoptions