Add examples for GEN-SIGNED-DIV-BY-CONST-EXPR average and worst case.

Also replace the examples in GEN-UNSIGNED-DIV-BY-CONSTANT-EXPR with tests.
This way, we'll notice if we forgot to update the examples after a change
in the generator code.
Optimize the division-to-shift transforms

Before this, the transform used generic arithmetic and was slower
than the division to multiply transform.
For floor, rewrite the parts that could cause overflow on signed or
unsigned words.
For ceiling, put the correction after the shift so that it
doesn't overflow.
Remove one of the CHOOSE-MULTIPLIER functions.

Calculate its results by scaling the direct multiplication
values instead.
Implement ceilinged/floored division to multiply transformation.

A multiplier and shift value is chosen so that ceiling(x/y) can be
converted to floor(m*x/2^s)+1, or (1+ (ASH (* M X) -S)).
This doesn't work when x = 0, so that is handled separately.
Floor(x/y) is simply transformed into floor(m*x/2^s), or (ASH (* M X) -S).
There's no need to explicitly check for 0.
In both signed floor and ceiling, the multipliers that work for positive
dividends aren't correct for negative ones and vice versa, so the
transformed expression first checks the sign of the dividend and then
uses the appropriate multiplier.

Calculate the remainder for unsigned ceiling in two steps so that inline
arithmetic is used (X - (Q-1)*Y - Y instead of (X - Q*Y)).
To do this, we need the value of the quotient before it is increased by one,
so the generator doesn't wrap the (1+ ...) around the expression (we do that
manually later in the ceiling transform). The check for X = 0 is also done
outside the generator.
For signed ceiling, calculate the remainder normally or as in the unsigned
case, depending on the sign of the result.
The floored division's remainder is calculated similarly.
The build fails for some reason when the floor transform is used in
target-char.lisp, so the floor transform gives up during compilation.
Omit the signed truncate transform if the unsigned one can be used.

This way, positive fixnums will go to the unsigned truncate transform.
Add new functions: SB!KERNEL:%(SIGNED)-MULTIPLY-HIGH-AND-SHIFT.

These perform a multiply-high and a shift on signed and unsigned words.
They give a little performance boost for fixnums over calling mulhi and
shift separately.
VOPs are implemented for x86, x86-64, PPC and ARM. The PPC and ARM
code hasn't been tested yet.
Replace the multiply-high and shift calls with these functions in the
constant division transforms.
Add transform for unsigned truncated division by fractions.

Modify CHOOSE-MULTIPLIER so that it can be used for multiplying
by fractions, and add a code generator that creates a simpler expression
for truncated multiplication of X by the constant rational A/Y.
The multiplier can get very large, so the generator tries to perform
the operations in multiple smaller steps whenever possible. For details,
see the comments in the generator or Paul Khuong's "Fast Truncated
Multiply-Divide by Positive Constants".
Add comparison-based quotient calculation to the unsigned division generator.
Add transform for signed integer-rational truncated division.

Add new function: SB!KERNEL:%SIGNED-MULTIPLY-AND-ADD-HIGH. It multiplies
two args, adds a third arg to the product, and returns the high bits of the
sum. It is implemented with VOPs on x86(-64), ARM and PPC.
Use it to carry out the 2N-bit multiply-shift similarly as in the unsigned
case.
Also make the examples easier to read by using macros.
Extend the ceiling and floor generators for rational numbers.

Extend CHOOSE-CEILING/FLOOR-MULTIPLIER so that they be used to replace
ceilinged/floored multiplication by A/Y, and rewrite the ceiling/floor
generators to work with rational divisors too.
Instead of using (if t ...) or (if nil ...) when the dividend can only
be negative or positive, don't do any condition checking at all.
This doesn't cause any performance changes, since the comparison
would have been removed during compilation anyway, but it shortens
the code a little and makes the examples more human-readable.

Also add a new function: GEN-MULTIPLY-SHIFT-EXPR. Use calls to this
function in the div-by-mul code generators instead of duplicating code.
Add transform for a trivial case of integer-rational division.

This converts division by 1/Y to multiplication. It is handled
separately because the remainder is always 0, so it doesn't have
to be calculated.
Add a section on div-by-mul in the internals manual.

Also update the chapter numbers in some of the comments.