Skip to content

Consider adding hardware optimization levels  #25

@pedrocr

Description

@pedrocr

x86_64 has a bunch of possible features but these appear usually together in shipped CPUs. So for convenience consider adding something like this:

https://www.phoronix.com/scan.php?page=news_item&px=LLVM-Clang-12-Microarch-Levels

Where the levels are:

  • x86-64: CMOV, CMPXCHG8B, FPU, FXSR, MMX, FXSR, SCE, SSE, SSE2
  • x86-64-v2: (close to Nehalem) CMPXCHG16B, LAHF-SAHF, POPCNT, SSE3, SSE4.1, SSE4.2, SSSE3
  • x86-64-v3: (close to Haswell) AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE
  • x86-64-v4: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL

This would make picking a reasonable set of features much easier. Ideally this would also exist for ARM and other architectures and there would be a catch all annotation that would just compile to all levels that apply to the architecture. Something like #[multiversion-broad] that would just use all these reasonable levels in whatever architecture is being compiled for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions