From 5a3882313def013cd067eba1ede6ef942d6ee2a7 Mon Sep 17 00:00:00 2001 From: Kevin Moran <39282665+Thernn88@users.noreply.github.com> Date: Thu, 1 Oct 2026 22:47:25 -0500 Subject: [PATCH] p7_omx_GrowTo_avx: count 8 floats per vector in the size checks The "already big enough" test and the "must widen" test in p7_omx_GrowTo_avx() and p7_omx_GrowTo_dpf_avx() compared the model length to allocQ4_avx * 4, the SSE vector width. An AVX stripe holds 8 floats, so the early return never fired for M > 8 and every call re-laid the row pointers. Results are unchanged. Co-Authored-By: Claude Opus 5.5 --- src/impl_avx/p7_omx_avx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/impl_avx/p7_omx_avx.c b/src/impl_avx/p7_omx_avx.c index cc0e00f2..d7beef68 100644 --- a/src/impl_avx/p7_omx_avx.c +++ b/src/impl_avx/p7_omx_avx.c @@ -144,7 +144,7 @@ p7_omx_GrowTo_avx(P7_OMX *ox, int allocM, int allocL, int allocXL) int i; int status; - if (ox->allocQ4_avx * 4 >= allocM && ox->validR > allocL && ox->allocXR >= allocXL + 1) + if (ox->allocQ4_avx * 8 >= allocM && ox->validR > allocL && ox->allocXR >= allocXL + 1) return eslOK; if (ncells > ox->ncells) { @@ -167,7 +167,7 @@ p7_omx_GrowTo_avx(P7_OMX *ox, int allocM, int allocL, int allocXL) reset_row_pointers = TRUE; } - if (allocM > ox->allocQ4_avx * 4) reset_row_pointers = TRUE; + if (allocM > ox->allocQ4_avx * 8) reset_row_pointers = TRUE; if (allocL >= ox->validR) reset_row_pointers = TRUE; if (reset_row_pointers) { @@ -291,7 +291,7 @@ p7_omx_GrowTo_dpf_avx(P7_OMX *ox, int allocM, int allocL, int allocXL) int i; int status; - if (ox->allocQ4_avx * 4 >= allocM && ox->validR > allocL && ox->allocXR >= allocXL + 1) + if (ox->allocQ4_avx * 8 >= allocM && ox->validR > allocL && ox->allocXR >= allocXL + 1) return eslOK; if (ncells > ox->ncells) { @@ -312,7 +312,7 @@ p7_omx_GrowTo_dpf_avx(P7_OMX *ox, int allocM, int allocL, int allocXL) reset_row_pointers = TRUE; } - if (allocM > ox->allocQ4_avx * 4) reset_row_pointers = TRUE; + if (allocM > ox->allocQ4_avx * 8) reset_row_pointers = TRUE; if (allocL >= ox->validR) reset_row_pointers = TRUE; if (reset_row_pointers) {