On 17 August 2010 18:47, Graydon Hoare <[email protected]> wrote: >> If I'm on x86 and I know it and I want fast >> predictable SSE2 mode, I'll declare as f64. > > Unless you want it to turn into f128 when you get ported to SSE9 or whatever > :) Probably we'll wind up with a set of c9x-esque types-by-intention in a > system module somewhere: target.fast_float, target.wide_float, etc.
This questions IMO the need for a platform-specific float type. From my experience with numerical programming in C/C++ some years ago (and friends told me that this became even more important now) one really needs to be sure about precision guarantees and adherence to semantics. The speed is less important. One also needs a control over the size of floating point numbers when code creates a lot of them. This leads to using, say, f32 for storage and something like target.the_most_precise_float_that_at_least_64_bit for lengthy intermediate calculations. On the other hand I suppose for game development one probably wants something like target.the_fastest_float. So there is no common ground that can be covered with one platform-specific float type. This is rather different from integer types as they do not have precision and typically it does not matter if int ends at 2^31 or 2^63. So having int to denote the fastest platform integer type is very useful especially given the assumption that everybody makes that int is at least 32 bit. _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
