News for hackers. Stuff that matters.
Re:Prefix Sum with SIMD by udbhavs on Saturday February 12, 2022 @06:17AM (#30311894)
The whole book looks very full of interesting low level techniques. Do high level JIT compilers like the V8 or JVM apply vectorisation or any of the other optimisations mentioned there, or is that level of fine-tuned performance only possible if you code them manually in C++?
Re:Prefix Sum with SIMD by tralarpa on Saturday February 12, 2022 @02:04PM (#30315309)
People claim that the JVM is able to auto-vectorize simple loops: https://stackoverflow.com/questions/59725341/java-auto-vecto...

That said, I tried the matrix-multiplication example from section 1.2 on different computers and with different jdk version, but I didn't manage to convince the JVM JIT to emit SIMD instructions. No idea whether the loop is too complex for the JIT or whether there is some secret JVM option that I'm not aware of.

Re:Prefix Sum with SIMD by sereja on Saturday February 12, 2022 @06:35PM (#30317474)
It is not technically legal to use SIMD on most floating-point loops, including the inner product in matrix multiplication, because rounding errors are not commutative. C compilers don't vectorize such loops either unless you pass the -ffast-math flag. I'm sure the JIT compiler of JVM has a similar option.

(read the article I linked below, it's all explained there)

Re:Prefix Sum with SIMD by sereja on Saturday February 12, 2022 @07:48AM (#30312366)
Author here. I wrote a separate section trying to answer this question: https://en.algorithmica.org/hpc/complexity/languages/

tl;dr: to some extent, but mostly no

Re:Prefix Sum with SIMD by marcos100 on Saturday February 12, 2022 @08:55AM (#30312827)
Hey author. This looks like a very approachable book given the subject.

Still on chapter 2, but really enjoying it. Instant buy for me.

Thanks for your effort.

Re:Prefix Sum with SIMD by saagarjha on Saturday February 12, 2022 @12:00PM (#30314237)
Most JITs have basic autovectorization support, but it's generally not that good.
Re:Prefix Sum with SIMD by khoobid_shoma on Saturday February 12, 2022 @09:11AM (#30312949)
I think topics are nicely explained in C and assembly but not C++.