func f(i int) bool {
return i%16 == 0
}
Since the modulo is signed, we have to do adjustments in case i is negative. We do
adj := i>>63 & 15
div := (i + adj) >> 4
mod := i - div*16
return mod == 0
Since we're comparing against 0, the adjustment in the first line is unnecessary. Zeroness is unaffected by the adjustment.
Might be as simple as converting (Eq (Mod64 x y) (Const64 [0])) to (Eq (Mod64u x y) (Const64 [0])) (and #uses of Mod64 is 1?)
Since the modulo is signed, we have to do adjustments in case
iis negative. We doSince we're comparing against 0, the adjustment in the first line is unnecessary. Zeroness is unaffected by the adjustment.
Might be as simple as converting
(Eq (Mod64 x y) (Const64 [0]))to(Eq (Mod64u x y) (Const64 [0]))(and #uses of Mod64 is 1?)