Skip to content

Commit 22ee137

Browse files
committed
arm: Include an explicit asimd flag
Include an explicit "asimd" flag, as needed by NumPy. On AArch64, it is determined by (obviously) HWCAP_ASIMD. On 32-bit ARM, there does not seem to be an explicit hwcap for it -- NumPy uses a combination of NEON + ARMv8 to detect it. Signed-off-by: Michał Górny <mgorny@gentoo.org>
1 parent d53cc92 commit 22ee137

10 files changed

+17
-9
lines changed

src/arm.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct subarch_info subarches[] = {
7575
* - CHECK_AARCH64_HWCAP and CHECK_HWCAP2 refer to appropriate values
7676
* in 64-bit AArch64 AT_HWCAP,
7777
* - CHECK_SUBARCH refers to the subarch determined via 'uname -m'.
78+
* - CHECK_ARMV8_HWCAP is like CHECK_HWCAP, but only on 32-bit ARMv8+.
7879
*/
7980
enum check_type
8081
{
@@ -85,6 +86,7 @@ enum check_type
8586
CHECK_AARCH64_HWCAP,
8687
CHECK_AARCH64_HWCAP2,
8788
CHECK_SUBARCH,
89+
CHECK_ARMV8_HWCAP,
8890

8991
CHECK_MAX
9092
};
@@ -108,6 +110,7 @@ struct flag_info flags[] = {
108110
{ "vfpv3", CHECK_HWCAP, (1 << 13) },
109111
{ "vfpv4", CHECK_HWCAP, (1 << 16) },
110112
{ "vfp-d32", CHECK_HWCAP, (1 << 19) },
113+
{ "asimd", CHECK_ARMV8_HWCAP, (1 << 12) }, /* HWCAP_NEON + armv8 */
111114
{ "asimddp", CHECK_HWCAP, (1 << 24) },
112115
{ "asimdfhm", CHECK_HWCAP, (1 << 25) },
113116
{ "asimdhp", CHECK_HWCAP, (1 << 23) },
@@ -133,6 +136,7 @@ struct flag_info flags[] = {
133136
{ "sha2", CHECK_AARCH64_HWCAP, (1 << 6) },
134137
{ "crc32", CHECK_AARCH64_HWCAP, (1 << 7) },
135138
{ "sm4", CHECK_AARCH64_HWCAP, (1 << 19) },
139+
{ "asimd", CHECK_AARCH64_HWCAP, (1 << 1) }, /* same as neon */
136140
{ "asimddp", CHECK_AARCH64_HWCAP, (1 << 20) },
137141
{ "asimdfhm", CHECK_AARCH64_HWCAP, (1 << 23) },
138142
{ "asimdhp", CHECK_AARCH64_HWCAP, (1 << 10) },
@@ -224,6 +228,10 @@ int print_flags()
224228
case CHECK_SUBARCH:
225229
reg = &subarch;
226230
break;
231+
case CHECK_ARMV8_HWCAP:
232+
if (subarch == SUBARCH_V8)
233+
reg = &hwcap;
234+
break;
227235
case CHECK_SENTINEL:
228236
assert(0 && "CHECK_SENTINEL reached");
229237
case CHECK_MAX:

tests/arm/aarch64-aws-a1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:00000000000008ff
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/aarch64-cavium-thunderx.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:00000000000001ff
33
hwcap2:0000000000000000
44
machine:aarch64
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:00000000000019ff
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/aarch64-dragonboard.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:0000000000000087
33
hwcap2:0000000000000000
44
machine:aarch64
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:0000000000000007
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/aarch64-neoverse-n1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimddp asimdhp v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimd asimddp asimdhp v4 v5 v6 v7 v8 thumb2
22
hwcap:0000000010119fff
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/aarch64-odroid-n2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:00000000000000ff
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/aarch64-raspberry-4.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 vfp-d32 crc32 asimd v4 v5 v6 v7 v8 thumb2
22
hwcap:0000000000000887
33
hwcap2:0000000000000000
44
machine:aarch64

tests/arm/armv8l-neoverse-n1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
1+
expected:edsp neon neon-fp16 thumb vfp vfpv3 vfpv4 asimd aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
22
hwcap:000000000037b0d6
33
hwcap2:000000000000001f
44
machine:armv8l

0 commit comments

Comments
 (0)