On 4/23/13 8:50 AM, Erik S wrote:
Patrick,
I would agree with you if it weren't for the cases where F-division
performs *better*. Division by a constant power-of-two is pretty common,
and is much faster in F-division.

I don't think correctness should be sacrificed for a slight performance
improvement in one case on one supported architecture. I've had real
bugs in my C code caused by incorrectly casting (or forgetting to cast)
to unsigned before a % operation. T-division causes *real* bugs.

I'm willing to spend some time implementing F-division, if I can get
some buy-in that the patch would be accepted.

Keep in mind that you will also need to implement an LLVM intrinsic, port all of the LLVM optimizations that apply to division to it, and make sure that they don't regress LLVM benchmarks. (You may want to add it to clang first actually.)

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to