Some more extra casts to avoid alignment warnings with Clang and -Wcast-align on...
[BearSSL] / src / symcipher / aes_x86ni_cbcdec.c
index 6f75348..c97ce48 100644 (file)
@@ -27,6 +27,9 @@
 #if BR_AES_X86NI
 
 #if BR_AES_X86NI_GCC
+#if BR_AES_X86NI_GCC_OLD
+#pragma GCC target("sse2,sse4.1,aes,pclmul")
+#endif
 #include <wmmintrin.h>
 #endif
 
@@ -75,14 +78,16 @@ br_aes_x86ni_cbcdec_run(const br_aes_x86ni_cbcdec_keys *ctx,
                                if (len >= 48) {
                                        x2 = _mm_loadu_si128(
                                                (void *)(buf + 32));
+                                       x3 = x2;
                                } else {
                                        x2 = x0;
+                                       x3 = x1;
                                }
                        } else {
                                x1 = x0;
                                x2 = x0;
+                               x3 = x0;
                        }
-                       x3 = x0;
                }
                e0 = x0;
                e1 = x1;