Skip to content

Add github workflows for AoR #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
20 changes: 20 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
string:
- changed-files:
- any-glob-to-any-file: string/**

networking:
- changed-files:
- any-glob-to-any-file: networking/**

math:
- changed-files:
- any-glob-to-any-file: math/**

fp:
- changed-files:
- any-glob-to-any-file: fp/**

build-system:
- changed-files:
- any-glob-to-any-file: ['Makefile', 'config.mk.dist', '**/*.mk']

15 changes: 15 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: New contributors

on: [pull_request_target]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: "Thank you for your contribution to Arm's optimized routines. Contribution to this repository does require a signed contributor's license agreement. See contributor-agreement.pdf for details"
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: build and run

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
linux-aarch64-native:
runs-on: ah-ubuntu_24_04-c7g_4x-50
strategy:
matrix:
compiler: ["gcc", "clang-20"]

steps:
- uses: actions/checkout@v4
- name: inspect hardware
run: cat /proc/cpuinfo
- name: install dependencies
run: sudo apt-get install libmpfr-dev libmpc-dev qemu-user-static wget
- name: install clang
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20
- name: configure
run: cp config.mk.dist config.mk
- name: check qemu version
run: qemu-aarch64-static --version
- name: make
run: CC="${{ matrix.compiler }}" make -j
- name: make check
run: CC="${{ matrix.compiler }}" V=1 VERBOSE=1 EMULATOR="qemu-aarch64-static" make check -j

linux-x86-64-cross:
runs-on: ubuntu-24.04
strategy:
matrix:
compiler: ["aarch64-linux-gnu-gcc"]

steps:
- uses: actions/checkout@v4
- name: inspect hardware
run: cat /proc/cpuinfo
- name: install dependencies
run: sudo apt-get install libmpfr-dev libmpc-dev gcc-aarch64-linux-gnu qemu-user-static
- name: configure
run: cp config.mk.dist config.mk
- name: make
run: CC="${{ matrix.compiler }}" make -j
- name: make check
run: CC="${{ matrix.compiler }}" EMULATOR="qemu-aarch64-static" make check -j

darwin-aarch64-native:
runs-on: macos-15
strategy:
matrix:
compiler: ["clang"]

steps:
- uses: actions/checkout@v4
- name: install dependencies
run: brew install mpfr libmpc gmp && brew link gmp mpfr
- name: configure
run: cp config.mk.dist config.mk
- name: make
run: CC="${{ matrix.compiler }}" WANT_SVE_TESTS=0 USE_GLIBC_ABI=0 WANT_EXP10_TESTS=0 USE_MPFR=1 make all -j
- name: make check
run: CC="${{ matrix.compiler }}" WANT_SVE_TESTS=0 USE_GLIBC_ABI=0 WANT_EXP10_TESTS=0 USE_MPFR=1 make check -j
5 changes: 5 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* @TamarChristinaArm
fp/* @statham-arm
math/* @blapie @joeramsay
networking/* @WonderfulVoid
string/* @Wilco1
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Arm Optimized Routines
----------------------

![master branch](https://github.com/ARM-software/optimized-routines/actions/workflows/tests/badge.svg)

This repository contains implementations of library functions
provided by Arm. The outbound license is available under a dual
license, at the user’s election, as reflected in the LICENSE file.
Expand Down
17 changes: 9 additions & 8 deletions config.mk.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ ARCH = aarch64
#CROSS_COMPILE = aarch64-none-linux-gnu-

# Compiler for the target
CC = $(CROSS_COMPILE)gcc
CC ?= $(CROSS_COMPILE)gcc
CFLAGS = -std=c99 -pipe -O3
CFLAGS += -Wall -Wno-missing-braces
CFLAGS += -Werror=implicit-function-declaration

# Used for test case generator that is executed on the host
HOST_CC = gcc
HOST_CC ?= gcc
HOST_CFLAGS = -std=c99 -O2
HOST_CFLAGS += -Wall -Wno-unused-function

Expand Down Expand Up @@ -55,6 +55,7 @@ endif
#CFLAGS += -march=armv8.5-a+memtag -DWANT_MTE_TEST=1

# Use with cross testing.
EMULATOR ?= qemu-aarch64-static
#EMULATOR = qemu-aarch64-static
#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --

Expand All @@ -81,7 +82,7 @@ endif
# Use if mpfr is available on the target for ulp error checking. If
# enabling this, it is advised to disable fenv checks by uncommenting
# the two lines at the bottom of this block.
USE_MPFR=0
USE_MPFR?=0
math-cflags += -DUSE_MPFR=$(USE_MPFR)
ifeq ($(USE_MPFR), 1)
math-ldlibs += $(mpfr-libs) $(gmp-libs)
Expand All @@ -106,18 +107,18 @@ math-cflags += -DWANT_ERRNO=$(WANT_ERRNO)

# Disable/enable SVE vector math tests/tools.
ifeq ($(ARCH),aarch64)
WANT_SVE_TESTS = 1
WANT_SVE_TESTS ?= 1
else
WANT_SVE_TESTS = 0
WANT_SVE_TESTS ?= 0
endif
math-cflags += -DWANT_SVE_TESTS=$(WANT_SVE_TESTS)

# If set to 1, set fenv in vector math routines.
WANT_SIMD_EXCEPT = 0
WANT_SIMD_EXCEPT ?= 0
math-cflags += -DWANT_SIMD_EXCEPT=$(WANT_SIMD_EXCEPT)

# If set to 1, enable tests for exp10.
WANT_EXP10_TESTS = 1
WANT_EXP10_TESTS ?= 1
math-cflags += -DWANT_EXP10_TESTS=$(WANT_EXP10_TESTS)

# If set to 1, enable tests for sinpi and cospi. These functions are
Expand All @@ -141,7 +142,7 @@ networking-cflags += -O2 -fno-tree-vectorize -funroll-loops
# Provide *_finite symbols and some of the glibc hidden symbols
# so libmathlib can be used with binaries compiled against glibc
# to interpose math functions with both static and dynamic linking
USE_GLIBC_ABI = 1
USE_GLIBC_ABI ?= 1
math-cflags += -DUSE_GLIBC_ABI=$(USE_GLIBC_ABI)

# Enable experimental math routines - non-C23 vector math and low-accuracy scalar
Expand Down
61 changes: 37 additions & 24 deletions string/aarch64/asmdefs.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
/*
* Macros for asm code. AArch64 version.
*
* Copyright (c) 2019-2023, Arm Limited.
* Copyright (c) 2019-2025, Arm Limited.
* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
*/

#ifndef _ASMDEFS_H
#define _ASMDEFS_H

/* Set the line separator for the assembler. */
#if defined (__APPLE__)
# define SEP %%
#else
# define SEP ;
#endif

/* Branch Target Identitication support. */
#define BTI_C hint 34
#define BTI_J hint 36
/* Return address signing support (pac-ret). */
#define PACIASP hint 25; .cfi_window_save
#define AUTIASP hint 29; .cfi_window_save
#define PACIASP hint 25 SEP .cfi_window_save
#define AUTIASP hint 29 SEP .cfi_window_save

/* GNU_PROPERTY_AARCH64_* macros from elf.h. */
#define FEATURE_1_AND 0xc0000000
Expand All @@ -22,16 +29,16 @@

/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
#define GNU_PROPERTY(type, value) \
.section .note.gnu.property, "a"; \
.p2align 3; \
.word 4; \
.word 16; \
.word 5; \
.asciz "GNU"; \
.word type; \
.word 4; \
.word value; \
.word 0; \
.section .note.gnu.property, "a" SEP \
.p2align 3 SEP \
.word 4 SEP \
.word 16 SEP \
.word 5 SEP \
.asciz "GNU" SEP \
.word type SEP \
.word 4 SEP \
.word value SEP \
.word 0 SEP \
.text

/* If set then the GNU Property Note section will be added to
Expand All @@ -46,23 +53,29 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)
#endif

#define ENTRY_ALIGN(name, alignment) \
.global name; \
.type name,%function; \
.align alignment; \
name: \
.cfi_startproc; \
BTI_C;
.align alignment SEP \
ENTRY_ALIAS(name) SEP \
.cfi_startproc SEP \
BTI_C

#define ENTRY(name) ENTRY_ALIGN(name, 6)

#define ENTRY_ALIAS(name) \
.global name; \
.type name,%function; \
#if defined (__APPLE__)
# define ENTRY_ALIAS(name) \
.global name SEP \
name:

#define END(name) \
# define END(name) .cfi_endproc
#else
# define ENTRY_ALIAS(name) \
.global name; \
.type name,%function; \
name:

# define END(name) \
.cfi_endproc; \
.size name, .-name;
.size name, .-name
#endif

#define L(l) .L ## l

Expand Down
2 changes: 2 additions & 0 deletions string/test/memrchr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ static const struct fun
int test_mte;
} funtab[] = {
// clang-format off
#if !defined (__APPLE__)
F(memrchr, 0)
#endif
#if __aarch64__
F(__memrchr_aarch64, 1)
#endif
Expand Down
2 changes: 2 additions & 0 deletions string/test/strchrnul.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ static const struct fun
int test_mte;
} funtab[] = {
// clang-format off
#if !defined (__APPLE__)
F(strchrnul, 0)
#endif
#if __aarch64__
F(__strchrnul_aarch64, 0)
F(__strchrnul_aarch64_mte, 1)
Expand Down
Loading