From fcd5f6df72efc681fd6558e3b27a690b20d760bb Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 22 Jul 2015 06:14:37 -0400 Subject: [PATCH] Cleared "invalid operand size" under Clang's integrated assembler. After more testing, this might be applied to other assemblers because Clang is probably correct in this instance --- gcm.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcm.cpp b/gcm.cpp index 5ed43c47..cef52bc6 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -673,7 +673,11 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) AS2( pxor xmm5, xmm2 ) AS2( psrldq xmm0, 15 ) +#if defined(CRYPTOPP_USING_CLANG_INTEGRATED_ASSEMBLER) + AS2( movq WORD_REG(di), xmm0 ) +#else AS2( movd WORD_REG(di), xmm0 ) +#endif AS2( movzx eax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) AS2( shl eax, 8 ) @@ -682,12 +686,21 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) AS2( pxor xmm4, xmm5 ) AS2( psrldq xmm1, 15 ) + +#if defined(CRYPTOPP_USING_CLANG_INTEGRATED_ASSEMBLER) + AS2( movq WORD_REG(di), xmm1 ) +#else AS2( movd WORD_REG(di), xmm1 ) +#endif AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) AS2( shl eax, 8 ) AS2( psrldq xmm0, 15 ) +#if defined(CRYPTOPP_USING_CLANG_INTEGRATED_ASSEMBLER) + AS2( movq WORD_REG(di), xmm0 ) +#else AS2( movd WORD_REG(di), xmm0 ) +#endif AS2( xor ax, WORD PTR [RED_TABLE + WORD_REG(di)*2] ) AS2( movd xmm0, eax )