From ca6d278c102a733d38c891ca60cf6c535d1502d4 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 16 Apr 2019 20:31:55 +0100 Subject: [PATCH] Make NEON AES build in 32-bit VS. I had another look just now at the mysterious AES intrinsics in VS2017's arm_neon.h that have the wrong number of operands, and this time I noticed that they're in one branch of an #ifdef whose other branch looks a lot more sensible. Enabled the #define that switches to the working branch. --- sshaes.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sshaes.c b/sshaes.c index d30ca916..1fce4d2f 100644 --- a/sshaes.c +++ b/sshaes.c @@ -52,15 +52,17 @@ # define USE_CLANG_ATTR_TARGET_AARCH64 # endif #elif defined _MSC_VER - /* Visual Studio supports the crypto extension when targeting - * AArch64, but as of VS2017, the AArch32 header doesn't quite - * manage it (declaring the aese/aesd intrinsics without a round - * key operand). */ # if defined _M_ARM64 # define HW_AES HW_AES_NEON -# if defined _M_ARM64 -# define USE_ARM64_NEON_H /* unusual header name in this case */ -# endif + /* 64-bit Visual Studio uses the header in place + * of the standard */ +# define USE_ARM64_NEON_H +# elif defined _M_ARM +# define HW_AES HW_AES_NEON + /* 32-bit Visual Studio uses the right header name, but requires + * this #define to enable a set of intrinsic definitions that + * do not omit one of the parameters for vaes[ed]q_u8 */ +# define _ARM_USE_NEW_NEON_INTRINSICS # endif #endif