make scalar genmask branch-free for all cases