add correct floating point `min` and `max` methods.

The `std::cmp` functions are not correct for floating point types.

`min(NaN, 2.0)` and `min(2.0, NaN)` return different values, because
these functions assume a total order. Floating point types need special
`min`, `max` and `clamp` functions.
consistently use LLVM floating point intrinsics
auto merge of #12700 : thestinger/rust/float, r=cmr