use mutating assignment

This commit is contained in:
dzaima 2022-12-07 23:24:26 +02:00
parent 07d4567a52
commit ce45d487a3
4 changed files with 14 additions and 14 deletions

View File

@ -81,7 +81,7 @@ def for{vars,begin,end,block} = {
i:u64 = begin
while (i < end) {
exec{i, vars, block}
i = i+1
++i
}
}
def forNZ{vars,begin,end,block} = {
@ -89,7 +89,7 @@ def forNZ{vars,begin,end,block} = {
assert{i!=end}
while (i < end) {
exec{i, vars, block}
i = i+1
++i
}
}

View File

@ -19,8 +19,8 @@ def b_setBatch{sz, x:*u64, n:(Size), v} = {
am:u64 = 64/sz;
w:u64 = load{x,n/am}
sh:u64 = (n&(am-1)) * sz
w = w & ~(ones{u64,sz}<<sh)
w = w | (vc<<sh)
w&= ~(ones{u64,sz}<<sh)
w|= (vc<<sh)
store{x, n/am, w}
}
@ -29,16 +29,16 @@ def b_setBatch{sz, x:*u64, n:(Size), v & sz==4} = {
#w:u64 = cast_i{u64, load{x8,n/2}}
#sh:u64 = (n&1) * 4
#w = w & ~(15<<sh)
#w = w | (cast_i{u64,v}<<sh)
#w&= ~(15<<sh)
#w|= (cast_i{u64,v}<<sh)
w:u8 = load{x8,n/2}
if ((n&1)==1) {
w = w & ~(cast{u8,15}<<4)
w = w | (cast_i{u8,v}<<4)
w&= ~(cast{u8,15}<<4)
w|= (cast_i{u8,v}<<4)
} else {
w = w & ~(cast{u8,15})
w = w | (cast_i{u8,v}<<0)
w&= ~(cast{u8,15})
w|= (cast_i{u8,v}<<0)
}
store{x8, n/2, cast_i{u8,w}}

View File

@ -67,10 +67,10 @@ def any2bit{VT, unr, op, wS, wV, xS, xV, dst:*u64, len:(Size)} = {
assert{am>0}
while (ri < am) {
r:u64 = 0
@unroll (j to unr) r = r | (promote{u64, getmask{op{wV{xi+j}, xV{xi+j}}}} << (j*vcount{VT}))
@unroll (j to unr) r|= promote{u64, getmask{op{wV{xi+j}, xV{xi+j}}}} << (j*vcount{VT})
b_setBatch{bulk, dst, ri, r}
xi = xi+unr
ri = ri+1
xi+= unr
ri+= 1
}
}
aa2bit{VT, unr, op}(dst:*u64, wr:*void, xr:*void, len:Size) : void = {

View File

@ -93,7 +93,7 @@ def maskedLoopPositive{bulk, l:L, step} = {
i:L = 0
while(i < (l-1)/bulk) {
step{i, maskNone}
i = i + 1
++i
}
step{i, maskAfter{l - i*bulk}}
}