move &~ to base.singeli

This commit is contained in:
dzaima 2023-04-02 16:33:24 +03:00
parent d02a0e43d8
commit 7d1fcf2c3a
4 changed files with 5 additions and 5 deletions

View File

@ -167,6 +167,8 @@ def widen{...x} = assert{'widen not supported', show{...x}}
def narrow{...x} = assert{'narrow not supported', show{...x}}
def unord{...x} = assert{'unord not supported', show{...x}}
def andnot{a, b & anyNum{a} & anyNum{b}} = a & ~b
oper &~ andnot infix none 35
def widen{T, x:X & T==X} = x
def narrow{T, x:X & T==eltype{X}} = x
def undefPromote{T, x:X & T==X} = T~~x

View File

@ -20,7 +20,7 @@ def cmp_err{x} = { emit{void, 'cmp_err'}; return{}; }
fn cmpIX(dst:*u64, len:Size, x:u64, v:u1) : void = {
nan:u1 = q_f64{x}
if (~(nan | q_chr{x})) cmp_err{x}
fillbits{dst, len, v & ~nan, x}
fillbits{dst, len, v&~nan, x}
}
def eqne{op} = match{op,__eq}|match{op,__ne}

View File

@ -7,8 +7,6 @@ include './mask'
include './bitops'
include 'util/tup'
oper &~ andnot infix none 35
# def:T - masked original content
# b:B - pointer to data to index; if width{B}<elwidth{T}, padding bytes are garbage read after wanted position
# idx - actual (unscaled) index list
@ -158,7 +156,7 @@ fn avx2_select_bool128(w0:*void, x0:*void, r0:*void, wl:u64, xl:u64) : u1 = {
b := VI~~make{[32]u8, 1 << (iota{32} & 7)}
maskedLoop{32, wl, {i, M} => {
cw:= wrapChk{load{w, i}, VI,xlf, M}
byte:= sel{[16]i8, x, VI~~(([8]u32~~andnot{cw, low})>>3)}
byte:= sel{[16]i8, x, VI~~(([8]u32~~(cw&~low))>>3)}
mask:= sel{[16]i8, b, cw & low}
store{r, i, homMask{(mask & byte) == mask}}
}}

View File

@ -201,7 +201,7 @@ def shuf{L, x:T, n & w128{T} & lvec{L,4,32} & knum{n}} = T ~~ emit{[4]i32, '_mm_
def shuf16Lo{x:T, n} = T~~emit{[8]i16, '_mm_shufflelo_epi16', x, n}
def shuf16Hi{x:T, n} = T~~emit{[8]i16, '_mm_shufflehi_epi16', x, n}
def homBlend{f:T, t:T, m:M & w128{T} & w128i{M,elwidth{T}}} = T ~~ ((M~~t & m) | (M~~f & ~m))
def homBlend{f:T, t:T, m:M & w128{T} & w128i{M,elwidth{T}}} = T ~~ ((M~~t & m) | (M~~f &~ m))
def homMaskStoreF{p:P, m:M, v:T & w128i{M} & w128{T,elwidth{M}} & eltype{P}==T} = store{p, 0, homBlend{load{p}, v, m}}
def widen{T, x:X & w128i{T} & w128i{X} & w128s{T}==w128s{X} & elwidth{T}>elwidth{X}} = {