fix /⁼1e4⥊1‿2 on NEON

This commit is contained in:
dzaima 2024-11-14 22:45:02 +02:00
parent cbac419b4a
commit b72fe465a2
2 changed files with 3 additions and 2 deletions

View File

@ -3,7 +3,7 @@ include './vecfold'
if_inline (hasarch{'SSE2'}) {
fn sum_vec{T}(v:T) = vfold{+, fold{+, mzip128{v, T**0}}}
def fold_addw{v:T=[_](i8)} = sum_vec{T}(v)
def fold_addw{v:T=[_](u8)} = sum_vec{T}(v)
}
def inc{ptr, ind, v} = store{ptr, ind, v + load{ptr, ind}}
@ -49,7 +49,7 @@ fn count{T}(tab:*usz, x:*T, n:u64, min_allowed:T) : T = {
e := each{{j}=>V**j, j}
@for (xv over b) each{{c,e} => c -= xv == e, c, e}
def add_sum{c, j} = {
s := promote{usz, fold_addw{V~~c}}
s := promote{usz, fold_addw{c}}
total -= s; inc{tab, j, s}
}
each{add_sum, c, j}

View File

@ -129,6 +129,7 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe
!"Sum too big" % %USE evar /_evar 1e2262
!"Integer out of range: 1e20" % %USE evar /_evar 1e20(100) 20010
! (//)81525329010115516558459489491213121328135013671391140714691486155915661576158215921599160916161626163540864093411441224141414941694177
/1e412 %% 050005000
# 𝕨⊏𝕩
•internal.ElType¨ {(1002)𝕨𝕩}˜ 0, 1, 2, 127, 128, 32767, 32768, ¯32767, ¯32768, ¯32769, ¯1+231, 231, @, @+1, @+255, @+256, @+1114111, {}, 12 %% (8-(=˜<5)×8-˜) 0011223223345556788