use maskedLoop in dyarith

This commit is contained in:
dzaima 2022-04-21 18:33:36 +03:00
parent 113f72e86d
commit 4c03520a07

View File

@ -79,17 +79,11 @@ def arithChk3{F, M, w:T, x:T, i} = {
def arithChk3{F, M, w:T, x:T, i & f64==rootty{T}} = F{w,x}
def arithAny{VT, F, W, X, r, len} = {
def bam = vcount{VT}
def vv = len/bam
@forv{VT} (r over i from 0 to vv) r = arithChk3{F, {x}=>x, W{i}, X{i}, i*bam}
left:= len&(bam-1)
if (left!=0) {
m:= maskOf{VT, left}
def mask{x:X} = x&cast_v{X,m}
def mask{x==0} = 1
rv:= arithChk3{F, maskAfter{left}, W{vv}, X{vv}, vv*bam}
maskstoreF{cast_p{VT,r}, m, vv, rv}
}
def bulk = vcount{VT}
maskedLoop{bulk, len, {i, M} => {
rv:= arithChk3{F, M, W{i}, X{i}, i*bulk}
storeBatch{r, i, rv, M}
}}
len
}