From 6824b9a747850bee486a769459f7a0c35b6558a5 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 26 Jun 2024 06:09:30 +0300 Subject: [PATCH] fix another unaligned load --- src/singeli/src/fold.singeli | 2 +- test/cases/cells.bqn | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/singeli/src/fold.singeli b/src/singeli/src/fold.singeli index 3b68016f..f6019c71 100644 --- a/src/singeli/src/fold.singeli +++ b/src/singeli/src/fold.singeli @@ -260,7 +260,7 @@ fn xor_rows_bit(xp:*u64, rp:*u64, n:usz, l:usz, eq:u1) : void = { if (l <= 64) { bm:= u64~~2<<(l-1) - 1 k:= l/8 - @for (i to n) add_bit{i, popc{bm & load{*u64~~(*u8~~xp + k*i)}}} + @for (i to n) add_bit{i, popc{bm & loadu{*u64~~(*u8~~xp + k*i)}}} } else if (l < 128) xor_loop{1} else if (l%64==0) { @for (i to n) add_bit{i, popc{xor_words(0, xp+ll*i, ll)}} diff --git a/test/cases/cells.bqn b/test/cases/cells.bqn index 9fea925d..260e9c42 100644 --- a/test/cases/cells.bqn +++ b/test/cases/cells.bqn @@ -45,8 +45,7 @@ {2 𝕨 _testScanCells 𝕩} _basicArgs 3‿4 {2 𝕨 _testScanCells 𝕩} _basicArgs 3‿4 - - ⟨0, 0‿1, 1‿0, 1, 10, 10‿1, 1‿10, 100⟩ { + ⟨0, 0‿1, 1‿0, 2‿2, 1, 10, 10‿1, 1‿10, 30⟩ { 𝕨‿𝕩 ⥊¨↩ sh ← 𝕨∾𝕩 cr ← ≠𝕩 @@ -54,5 +53,5 @@ cr 𝕎 _testFoldCells 𝕩 cr 𝕎 _testScanCells 𝕩 }⌜ {0=×´sh? 𝕩; ∾⟨𝕩, ¬⌾⊑¨ 𝕩, ¬⌾(¯1⊑⥊)¨ 𝕩⟩} sh⊸⥊¨ 0‿1 - }⌜ ⟨0, 1, 2, 8, 8‿1, 4‿8, 4‿2, 59, 60, 63, 80, 81, 200, 640, 641⟩ + }⌜ ⟨0, 1, 2, 8, 32, 8‿1, 4‿8, 4‿2, 59, 60, 63, 80, 81, 200, 640, 641⟩ )