diff --git a/src/builtins/md1.c b/src/builtins/md1.c index 8b84e15d..f881efda 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -242,7 +242,7 @@ B fold_c1(Md1D* d, B x) { B f = d->f; if (xe==el_i32) { i32* xp = i32any_ptr(x); i32 c=I32_MIN; for (usz i=0; ic) c=xp[i]; dec(x); return m_i32(c); } } if (rtid==11) { // ∨ - if (xe==el_bit) { u64* xp = bitarr_ptr(x); bool r=0; for (usz i=0; i>6); i++) if (xp[i]){r=1;break;} r|= !!bitp_l0(xp,ia);dec(x); return m_i32(r); } if (xe==el_i8 ) { i8* xp = i8any_ptr (x); bool r=0; for (usz i=0; i>6] >> (n&63)) & 1; } +static inline u64 bitp_l0(u64* arr, u64 ia) { // last u64 of the array, with the tail set to 0s + return ia&63? arr[ia>>6]&((1ULL<<(ia&63))-1) : 0; +} static inline u64 bitx(B x) { // repeats the boolean across all 64 bits return o2bu(x)? ~(u64)0 : 0; }