Make the truncate to shift transform use inline arithmetic.

Before this, the transform used generic arithmetic and was slower
than the truncate to multiply transform.
TODO: A similar optimisation for the ceiling/floor to shift
transform.