I know Java does this.
I know Java does this.
[1] - https://software.intel.com/sites/landingpage/IntrinsicsGuide...
A few examples I'm targeting for the next point release are matrix determinants, cross products, byte-aligned encoding (like https://github.com/AdamNiederer/base100/blob/master/src/lib....), and reductive operations like strcmp. AFAIK none of that can be autovectorized at all.
It's just pretty hard to create one. Same applies to automatic optimizations in the general case: what do you exactly know about what Java does beyond that it is capable of using SIMD instructions? Have you perhaps evaluated how and where it does so, or how the end result compares to more explicit manual use of stream operations?
edit: and for the record, the problem is not as easy as you seem to think it is, given how you described your astonishment.
Kinda-sorta yes, but not really. Auto-vectorization is a very brittle optimization that only works at the best of times and the slightest change in your code can cause it to fall out of the hot path. You have to be extra careful with aliasing and use the "restrict" keyword a lot.
If you really do care about performance, you still have to write your hot loops with explicit SIMD code.