Skip to content

Commit

Permalink
Add A32 support in CI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Cuda-Chen committed Nov 27, 2023
1 parent 0d6e9b3 commit ef2f8f0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?=
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef2f8f0

Please sign in to comment.