diff --git a/src/singeli/src/replicate.singeli b/src/singeli/src/replicate.singeli index 82c981ea..98a9f428 100644 --- a/src/singeli/src/replicate.singeli +++ b/src/singeli/src/replicate.singeli @@ -144,7 +144,7 @@ def rep_const_shuffle{V, wv, onreps, xv:*V, rv:*V, n:u64} = { # onreps{inputVect }} setlabel{end} q := nr & (step-1) - if (q) homMaskStoreF{rv+e, maskOf{V, q}, s} + if (q!=0) homMaskStoreF{rv+e, maskOf{V, q}, s} } } @@ -219,7 +219,7 @@ fn rep_const_shuffle_partial4(wv:u64, ellw:u64, x:*i8, r:*i8, n:u64) : void = { setlabel{end} q := (re+step) - r - if (q) homMaskStoreF{*V~~r, maskOf{V, q}, s} + if (q!=0) homMaskStoreF{*V~~r, maskOf{V, q}, s} } diff --git a/src/singeli/src/scan.singeli b/src/singeli/src/scan.singeli index 9deac4cd..fed3f288 100644 --- a/src/singeli/src/scan.singeli +++ b/src/singeli/src/scan.singeli @@ -21,7 +21,7 @@ def scan_loop{T, init, x:*T, r:*T, len:u64, scan, scan_last} = { e:= len/step @for (xv, rv over e) rv = scan{xv,p} q:= len & (step-1) - if (q) homMaskStoreF{rv+e, maskOf{V, q}, scan_last{load{xv,e}, p}} + if (q!=0) homMaskStoreF{rv+e, maskOf{V, q}, scan_last{load{xv,e}, p}} } def scan_post{T, init, x:*T, r:*T, len:u64, op, pre} = { def last{v, p} = op{pre{v}, p} @@ -97,7 +97,7 @@ fn clmul_scan_ne_any{& hasarch{'PCLMUL'}}(x:*void, r:*void, init:u64, words:u64, @for (rv, xv over e) { rv = apply{zipLo, (@collect (j to 2) xor64{xv, j, c})} } - if (words & 1) { + if ((words & 1) == 1) { storeLow{rv+e, 64, clmul{loadLow{xv+e, 64}, m, 0} ^ c} } }