Convert logical operations and umul/smul