mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
refactor ALIGN16 macro to types.h
This commit is contained in:
@@ -46,23 +46,8 @@
|
||||
#include <emmintrin.h>
|
||||
#include <smmintrin.h>
|
||||
|
||||
#if !defined (ALIGN16)
|
||||
#if defined (__GNUC__)
|
||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN16 __declspec (align (16))
|
||||
#else
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* WOLFSSL_AESNI */
|
||||
|
||||
#if !defined (ALIGN16)
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif /* HAVE_FIPS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -54,22 +54,6 @@ enum {
|
||||
|
||||
#ifndef WOLFSSL_TI_HASH
|
||||
|
||||
#ifdef WOLFSSL_ARMASM /* slight performance increase with aligned memory */
|
||||
#if !defined (ALIGN16)
|
||||
#if defined (__GNUC__)
|
||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN16 __declspec (align (16))
|
||||
#else
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif
|
||||
#else /* not using ARM ASM*/
|
||||
#define ALIGN16
|
||||
#endif /* WOLFSSL_ARMASM */
|
||||
|
||||
/* Sha256 digest */
|
||||
typedef struct Sha256 {
|
||||
word32 buffLen; /* in bytes */
|
||||
|
@@ -386,6 +386,26 @@
|
||||
#define INVALID_DEVID -2
|
||||
|
||||
|
||||
/* AESNI requires alignment and ARMASM gains some performance from it */
|
||||
#if defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM)
|
||||
#if !defined (ALIGN16)
|
||||
#if defined (__GNUC__)
|
||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN16 __declspec (align (16))
|
||||
#else
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifndef ALIGN16
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif /* WOLFSSL_AESNI or WOLFSSL_ARMASM */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user