avoid UB __shl{neative,x}

This commit is contained in:
dzaima 2025-05-24 05:35:21 +03:00
parent 7aaa240ab1
commit fd58b87e61
2 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,8 @@ def sum_accumulator{DE==i64, unr, VT=[k]SE==i32 if hasarch{'X86_64'}} = { # TODO
def {accl, _, accl_tup, accl_vec} = acc_impl{mask_ident{+,0}, +, unr, VT, SE, 0}
def {acch, _, acch_tup, acch_vec} = acc_impl{mask_ident{+,0}, +, unr, VT, SE, 0}
def __shl{a:T, b if issigned{T}} = T ~~ (ty_u{a} << b)
extend perv2{__shr}
def me{'acc', ...M, v} = match (v) {
{v:T if primtype{T} and M{0}==0} => acc += promote{DE, v}

View File

@ -533,6 +533,10 @@ b←1↓1∾a←"hello" ⋄ b ⌽⎊'e' ⥊⟜1⍟2 5 ⋄ a ≡○•Hash b %% 1
!"𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´33
!"𝕨𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 2+´33
!"𝔽´𝕩: Identity not found" % •internal.Keep´
%USE eqvar +´_eqvar 1e31e2 %% 1e5
%USE eqvar +´_eqvar 1e3100 %% 4950e1
%USE eqvar +´_eqvar 1e4-100 %% ¯4950e2
%USE eqvar +´_eqvar 1e4-1e9 %% ¯1e13
+´0 %% <0
×´0 %% <1
+´0 %% <<<0