From b244d7ecf565dbd91ae71250877769124a4652f9 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 12 Nov 2022 23:43:45 +0200 Subject: [PATCH] =?UTF-8?q?disallow=20bitwise=20hashing=20for=20=C2=AF0;?= =?UTF-8?q?=20prepare=20for=20mm=5Falloc=20taking=20u64=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/selfsearch.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/builtins/selfsearch.c b/src/builtins/selfsearch.c index cde95793..bc5aa5ef 100644 --- a/src/builtins/selfsearch.c +++ b/src/builtins/selfsearch.c @@ -28,11 +28,12 @@ static bool canCompare64_norm(B x, usz n) { u8 e = TI(x,elType); if (e == el_B) return 0; if (e == el_f64) { - f64* p = f64any_ptr(x); + f64* pf = f64any_ptr(x); + u64* pu = (u64*)pf; for (usz i = 0; i < n; i++) { - f64 v = p[i]; - if (v!=v) return 0; - if (v==0) p[i]=0; + f64 f = pf[i]; + if (f!=f) return 0; + if (pu[i] == m_f64(-0.0).u) return 0; } } return 1; @@ -156,7 +157,7 @@ static NOINLINE void memset64(u64* p, u64 v, usz l) { for (usz i=0; i(usz)I32_MAX+1) thrM("⊒: Argument length >2⋆31 not supported"); @@ -326,7 +327,7 @@ B count_c1(B t, B x) { B indexOf_c1(B t, B x) { if (isAtm(x) || RNK(x)==0) thrM("⊐: 𝕩 cannot have rank 0"); - usz n = *SH(x); + u64 n = *SH(x); if (n<=1) { decG(x); return n ? taga(arr_shVec(allZeroes(1))) : emptyIVec(); } if (n>(usz)I32_MAX+1) thrM("⊐: Argument length >2⋆31 not supported");