Simon Jakobi pushed to branch wip/sjakobi/T25450-print-cpu at Glasgow Haskell Compiler / GHC
Commits:
-
60110d3f
by Simon Jakobi at 2026-05-29T11:59:06+02:00
1 changed file:
Changes:
| ... | ... | @@ -3,12 +3,16 @@ synopsis: Add --print-enabled-cpu-features flag |
| 3 | 3 | issues: #25450
|
| 4 | 4 | mrs: !16117
|
| 5 | 5 | |
| 6 | -description: {
|
|
| 6 | +description:
|
|
| 7 | 7 | GHC now supports a new mode flag ``--print-enabled-cpu-features``, which
|
| 8 | 8 | prints a JSON object describing the CPU features currently enabled for code
|
| 9 | 9 | generation, together with a minimal set of ``-m...`` flags that would
|
| 10 | 10 | reproduce the non-default effective feature set for the current target.
|
| 11 | - Dynamic options such as ``-mavx2`` and ``-mbmi2`` are respected.
|
|
| 11 | + Dynamic options such as ``-mavx2`` and ``-mbmi2`` are respected. ::
|
|
| 12 | + |
|
| 13 | + $ ghc -mavx2 --print-enabled-cpu-features
|
|
| 14 | + {"tag":"enabled-cpu-features","version":1,"target":"x86_64-linux-gnu",
|
|
| 15 | + "features":["SSE2","SSE3","SSSE3","SSE4.1","SSE4.2","AVX","AVX2"],
|
|
| 16 | + "as_m_flags":["-mavx2"]}
|
|
| 12 | 17 | |
| 13 | 18 | This is a first step toward implementing ``-march=native``. |
| 14 | -} |