Skip to content

Commit

Permalink
lib/arm: don't use explicit armv8.2-a on gcc 13.2 and later
Browse files Browse the repository at this point in the history
Resolves #369
  • Loading branch information
ebiggers committed Apr 30, 2024
1 parent 63f91e1 commit 0e88d7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions lib/arm/adler32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,13 @@ adler32_arm_neon(u32 adler, const u8 *p, size_t len)
# ifdef __clang__
# define ATTRIBUTES _target_attribute("dotprod")
/*
* With gcc, arch=armv8.2-a is needed for dotprod intrinsics, unless the
* default target is armv8.3-a or later in which case it must be omitted.
* armv8.3-a or later can be detected by checking for __ARM_FEATURE_JCVT.
* With gcc 13.1 and earlier (before gcc commit 73d3bc348190 or 9aac37ab8a7b,
* "aarch64: Remove architecture dependencies from intrinsics"),
* arch=armv8.2-a is needed for the dotprod intrinsics, unless the default
* target is armv8.3-a or later in which case it must be omitted. armv8.3-a
* or later can be detected by checking for __ARM_FEATURE_JCVT.
*/
# elif defined(__ARM_FEATURE_JCVT)
# elif GCC_PREREQ(13, 2) || defined(__ARM_FEATURE_JCVT)
# define ATTRIBUTES _target_attribute("+dotprod")
# else
# define ATTRIBUTES _target_attribute("arch=armv8.2-a+dotprod")
Expand Down
10 changes: 6 additions & 4 deletions lib/arm/crc32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,13 @@ crc32_arm_pmullx4(u32 crc, const u8 *p, size_t len)
# ifdef __clang__
# define ATTRIBUTES _target_attribute("aes,crc,sha3")
/*
* With gcc, arch=armv8.2-a is needed for the sha3 intrinsics, unless the
* default target is armv8.3-a or later in which case it must be omitted.
* armv8.3-a or later can be detected by checking for __ARM_FEATURE_JCVT.
* With gcc 13.1 and earlier (before gcc commit 73d3bc348190 or 9aac37ab8a7b,
* "aarch64: Remove architecture dependencies from intrinsics"),
* arch=armv8.2-a is needed for the sha3 intrinsics, unless the default
* target is armv8.3-a or later in which case it must be omitted. armv8.3-a
* or later can be detected by checking for __ARM_FEATURE_JCVT.
*/
# elif defined(__ARM_FEATURE_JCVT)
# elif GCC_PREREQ(13, 2) || defined(__ARM_FEATURE_JCVT)
# define ATTRIBUTES _target_attribute("+crypto,+crc,+sha3")
# else
# define ATTRIBUTES _target_attribute("arch=armv8.2-a+crypto+crc+sha3")
Expand Down

0 comments on commit 0e88d7e

Please sign in to comment.