From 1d1f0da5637481d32f9240e9a1e91e8b386dbca2 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Wed, 4 Sep 2019 10:30:54 +0200
Subject: [PATCH] AES-NI: correct memory alignment

---
 pystencils/include/aesni_rand.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pystencils/include/aesni_rand.h b/pystencils/include/aesni_rand.h
index 723ea14d..9ab64b6a 100644
--- a/pystencils/include/aesni_rand.h
+++ b/pystencils/include/aesni_rand.h
@@ -95,8 +95,8 @@ QUALIFIERS void aesni_double2(uint32 ctr0, uint32 ctr1, uint32 ctr2, uint32 ctr3
 #endif
 
     // store result
-    double rr[2];
-    _mm_storeu_pd(rr, rs);
+    alignas(16) double rr[2];
+    _mm_store_pd(rr, rs);
     rnd1 = rr[0];
     rnd2 = rr[1];
 }
@@ -122,8 +122,8 @@ QUALIFIERS void aesni_float4(uint32 ctr0, uint32 ctr1, uint32 ctr2, uint32 ctr3,
 #endif
 
     // store result
-    float r[4];
-    _mm_storeu_ps(r, rs);
+    alignas(16) float r[4];
+    _mm_store_ps(r, rs);
     rnd1 = r[0];
     rnd2 = r[1];
     rnd3 = r[2];
-- 
GitLab