From ba2386965944c5780376c5dc2a86e5cadae742b0 Mon Sep 17 00:00:00 2001
From: Martin Larralde <martin.larralde@embl.de>
Date: Sun, 16 Jun 2024 19:46:19 +0200
Subject: [PATCH] Use aligned loads in AVX2 implementation of `Score`

---
 lightmotif/src/pli/platform/avx2.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lightmotif/src/pli/platform/avx2.rs b/lightmotif/src/pli/platform/avx2.rs
index 01e4cee..c7bff4b 100644
--- a/lightmotif/src/pli/platform/avx2.rs
+++ b/lightmotif/src/pli/platform/avx2.rs
@@ -153,7 +153,8 @@ unsafe fn score_avx2_permute<A>(
             let x4 = _mm256_shuffle_epi8(x, m4);
             // load row for current weight matrix position
             // debug_assert_eq!(pssmptr as usize & 0x1f, 0);
-            let t = _mm256_loadu_ps(pssmptr);
+            debug_assert_eq!(pssmptr as usize & 0x1f, 0);
+            let t = _mm256_load_ps(pssmptr);
             // index A/T/G/C/N lookup table with the bases
             let b1 = _mm256_permutevar8x32_ps(t, x1);
             let b2 = _mm256_permutevar8x32_ps(t, x2);
-- 
GitLab