Skip to content
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

New ARM flags #23

Merged
merged 4 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ struct subarch_info subarches[] = {
*
* - CHECK_HWCAP and CHECK_HWCAP2 refer to appropriate values in 32-bit
* ARM AT_HWCAP*,
* - CHECK_AARCH64_HWCAP refer to appropriate values in 64-bit AArch64
* AT_HWCAP,
* - CHECK_AARCH64_HWCAP and CHECK_HWCAP2 refer to appropriate values
* in 64-bit AArch64 AT_HWCAP,
* - CHECK_SUBARCH refers to the subarch determined via 'uname -m'.
*/
enum check_type
Expand All @@ -83,6 +83,7 @@ enum check_type
CHECK_HWCAP,
CHECK_HWCAP2,
CHECK_AARCH64_HWCAP,
CHECK_AARCH64_HWCAP2,
CHECK_SUBARCH,

CHECK_MAX
Expand All @@ -106,6 +107,8 @@ struct flag_info flags[] = {
{ "vfpv3", CHECK_HWCAP, (1 << 13) },
{ "vfpv4", CHECK_HWCAP, (1 << 16) },
{ "vfp-d32", CHECK_HWCAP, (1 << 19) },
{ "asimddp", CHECK_HWCAP, (1 << 24) },
{ "i8mm", CHECK_HWCAP, (1 << 27) },
{ "aes", CHECK_HWCAP2, (1 << 0) },
{ "sha1", CHECK_HWCAP2, (1 << 2) },
{ "sha2", CHECK_HWCAP2, (1 << 3) },
Expand All @@ -125,6 +128,10 @@ struct flag_info flags[] = {
{ "sha1", CHECK_AARCH64_HWCAP, (1 << 5) },
{ "sha2", CHECK_AARCH64_HWCAP, (1 << 6) },
{ "crc32", CHECK_AARCH64_HWCAP, (1 << 7) },
{ "sm4", CHECK_AARCH64_HWCAP, (1 << 19) },
{ "asimddp", CHECK_AARCH64_HWCAP, (1 << 20) },
{ "sve", CHECK_AARCH64_HWCAP, (1 << 22) },
{ "i8mm", CHECK_AARCH64_HWCAP2, (1 << 13) },

/* subarches */
{ "v4", CHECK_SUBARCH, SUBARCH_V4 },
Expand Down Expand Up @@ -203,6 +210,10 @@ int print_flags()
if (subarch >= SUBARCH_AARCH64)
reg = &hwcap;
break;
case CHECK_AARCH64_HWCAP2:
if (subarch >= SUBARCH_AARCH64)
reg = &hwcap2;
break;
case CHECK_SUBARCH:
reg = &subarch;
break;
Expand Down
2 changes: 1 addition & 1 deletion tests/arm/aarch64-neoverse-n1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expected:edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2
expected:edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 asimddp v4 v5 v6 v7 v8 thumb2
hwcap:0000000010119fff
hwcap2:0000000000000000
machine:aarch64
Loading