X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gosthash2012.h;h=8947ee6ab7e5404aff5da98b04d5637dfc770814;hb=7e6ed644cf97385a95544fcc889e2eb16bcc93ed;hp=5b1cd9f1f5c61677d31156447543f0fd49cd0c75;hpb=88a44b67c76ce938f124e22e6a882780a98731fb;p=openssl-gost%2Fengine.git diff --git a/gosthash2012.h b/gosthash2012.h index 5b1cd9f..8947ee6 100644 --- a/gosthash2012.h +++ b/gosthash2012.h @@ -12,6 +12,17 @@ #ifdef __SSE2__ # define __GOST3411_HAS_SSE2__ +# if !defined(__x86_64__) +/* + * x86-64 bit Linux and Windows ABIs provide malloc function that returns + * 16-byte alignment memory buffers required by SSE load/store instructions. + * Other platforms require special trick for proper gost2012_hash_ctx structure + * allocation. It will be easier to switch to unaligned loadu/storeu memory + * access instructions in this case. + */ +# define UNALIGNED_SIMD_ACCESS +# pragma message "Use unaligned SIMD memory access" +# endif #endif #ifdef __GOST3411_HAS_SSE2__