News for hackers. Stuff that matters.
Re:Comparing Parallel Rust and C++ by mratsim on Thursday November 07, 2019 @05:13AM (#21471917)
ffast-math is not needed when you unroll manually and write your own accumulators.

See my benchmarks [1] with fast-math in the middle and the generated assembly comparison at the bottom.

The base language is Nim but pure C code should generate the same assembly.

[1] https://github.com/numforge/laser/blob/e660eeeb723426e80a7b1....

Re:Comparing Parallel Rust and C++ by keldaris on Thursday November 07, 2019 @05:22AM (#21471956)
That's absolutely right (and thank you for the reference), but this benchmark starts off with fairly naive code where -ffast-math may still help considerably.
Re:Comparing Parallel Rust and C++ by mratsim on Thursday November 07, 2019 @05:29AM (#21471989)
If in-between the start and the end, I went up to 8 accumulators and in files in the same folder I have the same with SSE and AVX instructions.

I actually wanted to know exactly what ffast-math did, down to the codegen (so you have assembly at the bottom).