Skip to content

Commit

Permalink
cpusupport: ARM-SHA256: compile-time detection
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva committed Feb 20, 2021
1 parent 5b2f08a commit 9757296
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libcperciva/cpusupport/Build/cpusupport-ARM-SHA256.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifdef __ARM_NEON
#include <arm_neon.h>
#endif

int
main(void)
{
uint32x4_t w0 = {0};
uint32x4_t w4 = {0};
uint32x4_t output;

output = vsha256su0q_u32(w0, w4);
(void)output; /* UNUSED */

return (0);
}
3 changes: 3 additions & 0 deletions libcperciva/cpusupport/Build/cpusupport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ feature ARM CRC32_64 "-march=armv8.1-a" \
"-march=armv8.1-a+crc" \
"-march=armv8.1-a+crc -Wno-cast-align" \
"-march=armv8.1-a -D__ARM_ACLE=200"
feature ARM SHA256 "-march=armv8.1-a+crypto" \
"-march=armv8.1-a+crypto -Wno-cast-align" \
"-march=armv8.1-a+crypto -D__ARM_ACLE=200"

0 comments on commit 9757296

Please sign in to comment.