diff --git a/src/singeli/src/base.singeli b/src/singeli/src/base.singeli index 5f6bee78..e7ca7bda 100644 --- a/src/singeli/src/base.singeli +++ b/src/singeli/src/base.singeli @@ -177,7 +177,7 @@ def { all_bit,any_bit,blend_bit, all_hom,any_hom,blend_hom,hom_to_int,homMaskStore,homMaskStoreF, all_top,any_top,blend_top,top_to_int,topMaskStore,topMaskStoreF, - loadBatchBit,loadLow,make,maskStore,maskToHom,mulw,mulh,narrow,narrowTrunc,narrowPair, + loadBatchBit,loadLow,make,maskStore,maskToHom,mulwSplit,mulh,narrow,narrowTrunc,narrowPair, packQ,pair,pdep,pext,popcRand,rbit,rev,sel,shl,shr,shufInd,storeLow, unord,unzip,vfold,vec_select,vec_shuffle,widen,widenUpper,multishift, } diff --git a/src/singeli/src/dyarith.singeli b/src/singeli/src/dyarith.singeli index f03bface..fd6f64dc 100644 --- a/src/singeli/src/dyarith.singeli +++ b/src/singeli/src/dyarith.singeli @@ -67,7 +67,7 @@ def arithChk2{F=(__mul), M, w:T=[_](i32), x:T if hasarch{'X86_64'}} = { } def arithChk2{F=(__mul), M, w:T=[_]E, x:T if hasarch{'AARCH64'}} = { - def {rl, rh} = pack{...mulw{w, x}} + def {rl, rh} = pack{...mulwSplit{w, x}} tup{rl, tup{'any_hom', M{rh != (rl >> (width{E}-1))}}} } diff --git a/src/singeli/src/neon.singeli b/src/singeli/src/neon.singeli index 59464f0d..10da2ebb 100644 --- a/src/singeli/src/neon.singeli +++ b/src/singeli/src/neon.singeli @@ -20,11 +20,11 @@ def __gt{a:T, 0 if nvecs{T} or nvecf{T}} = emit{ty_u{T}, ntyp{'vcgtz', T}, a} def __ge{a:T, 0 if nvecs{T} or nvecf{T}} = emit{ty_u{T}, ntyp{'vcgez', T}, a} def __eq{a:T, 0 if nveci{T} or nvecf{T}} = emit{ty_u{T}, ntyp{'vceqz', T}, a} -def addwLo{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vaddl', T}, a, b} -def subwLo{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vsubl', T}, a, b} -def mulwLo{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vmull', T}, a, b} -def mulwHi{a:T,b:T if w128i{T}} = emit{el_m{T}, ntyp0{'vmull_high', T}, a, b} -def mulw {a:T,b:T if w128{T}} = tup{mulwLo{half{a,0}, half{b,0}}, mulwHi{a,b}} +def addw{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vaddl', T}, a, b} +def subw{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vsubl', T}, a, b} +def mulw{a:T,b:T if w64i{T}} = emit{el_d{T}, ntyp{'vmull', T}, a, b} +def mulwUpper{a:T,b:T if w128i{T}} = emit{el_m{T}, ntyp0{'vmull_high', T}, a, b} +def mulwSplit{a:T,b:T if w128{T}} = tup{mulw{half{a,0}, half{b,0}}, mulwUpper{a,b}} def shrn{a:T, s if w128i{T} and elwidth{T}>8} = { def H=el_h{T}; emit{H, ntyp0{'vshrn_n', T}, a, s} } # a>>s, narrowed def shrm{a:T, s, d:T if nvecu{T}} = emit{T, ntyp{'vsri', '_n', T}, d, a, s} # (a>>s) | (d & (mask of new zeroes))