Comment by gameswithgo
8 years ago
In an LLVM context it also means you don't get runtime feature detection. You would need to build N dlls and then write code to load the proper one at runtime based on feature detection.
JITs could solve that problem, but few JITs currently do very much auto vectorization, because they don't have time.
> In an LLVM context it also means you don't get runtime feature detection. You would need to build N dlls and then write code to load the proper one at runtime based on feature detection.
Does LLVM not support GCC-style function multiversioning?
LLVM does (quite recently!), but Rust currently does not. I think it's likely that Rust should add it, but a large part of my post was exploring how far we could go with Rust as of today.
Edit adding citation: http://lists.llvm.org/pipermail/llvm-announce/2018-September...
Does GCC use that when auto-vectorizing? It's been a while, but in the past when I built binaries via gcc with autogenerated SSE/AVX I don't think they fell back to the C code for CPUs that lacked those SIMD instructions. They just crashed.
You have to tell gcc it should also build a generic version. Then, it should work.
Intel has made quite a few contributions to Hotspot, including AVX support.
ART started supporting SIMD on Oreo, and it was further expanded on Pie. Naturally very few devices have gotten those improvements thanks the state of Android's updates.
So on Android's case Renderscript is still the best way for a JIT like approach for SIMD.
As far as I know the JVM will only auto-vectorize integers. Is there a way to tag a function such that you want floats vectorized too now?
ART is a good point, compile on install lets you do this.
You can get the information here. It also refers to floating point calculations.
http://cr.openjdk.java.net/~vlivanov/talks/2017_Vectorizatio...
https://software.intel.com/sites/default/files/managed/19/ae...
Also the Vector API development is ongoing and there is a talk at this week's Oracle ONE about the current state.
ART no longer compiles on install since Android 7, that behaviour is specific to Android 5 and 6 versions.
Since 7 it is a multistage runtime with hand written in Assembly interpreter, JIT + PGO, AOT + PGO on idle device. And as of 9, PGO data gets uploaded into the store and shared across devices on installation.