I'm wondering about making better use of available CPU features I'm working on. While I currently use
target-cpu=native in my development environment and in my staging environment (different kinds of macOS machines), I deploy into GCP on N2D instances (2nd-gen AMD Zen).
As I understand it, there's no good way to build docker images that abstract over this difference, so I'm wondering what the best way forward is. I found Using RUSTFLAGS - Rust SIMD Performance Guide which was quite helpful; it contains the text "The compiler will translate this into a list of target features.".
Is there some way of inspecting what features the compiler will enable for a given target CPU, so that I could define a list of "least common denominator" features available on both, say, znver2 and skylake? And does anyone have a sense of how impactful optimizations the compiler can make beyond the availability of features (for example, it looks like LLVM has a cost model for different processors)?