[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#64188] [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-archit
From: |
Efraim Flashner |
Subject: |
[bug#64188] [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-architecture-level mapping. |
Date: |
Mon, 26 Jun 2023 15:38:41 +0300 |
* guix/cpu.scm (gcc-architecture->micro-architecture-level): New
variable.
---
guix/cpu.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/guix/cpu.scm b/guix/cpu.scm
index 30cd860a19..29ad883584 100644
--- a/guix/cpu.scm
+++ b/guix/cpu.scm
@@ -32,7 +32,8 @@ (define-module (guix cpu)
cpu-model
cpu-flags
- cpu->gcc-architecture))
+ cpu->gcc-architecture
+ gcc-architecture->micro-architecture-level))
;;; Commentary:
;;;
@@ -283,3 +284,24 @@ (define (cpu->micro-architecture-level cpu)
(architecture
;; TODO: More architectures
architecture)))
+
+(define (gcc-architecture->micro-architecture-level gcc-architecture)
+ "Return a matching psABI micro-architecture, allowing optimizations for
x86_64
+CPUs for compilers which don't allow for more focused optimizing."
+ ;; Matching gcc-architectures isn't an easy task, with the rule-of-thumb
being
+ ;; 'Haswell and higher' qualify for x86_64-v3.
+ ;;
https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex
+ (match gcc-architecture
+ ((or "grandridge" "graniterapids" "sierraforest" "tigerlake"
+ "sapphirerapids" "cooperlake" "icelake-server" "icelake-client"
+ "cannonlake" "knm" "knl" "skylake-avx512" "alderlake" "skylake"
+ "broadwell" "haswell"
+ "znver4" "znver3" "znver2" "znver1" "bdver4")
+ "x86_64-v3")
+ ((or "sandybridge" "tremont" "goldmont-plus" "goldmont" "silvermont"
+ "nehalem" "bonnell" "core2"
+ "btver2" "athalon" "k8-sse3" "k8" "bdver3" "bdver2" "bdver1" "btver1"
+ "amdfam10"
+ "lujiazui" "x86-64")
+ "x86_64-v1")
+ (_ gcc-architecture)))
--
Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
- [bug#64188] [PATCH 4/8] guix: cpu: Refactor cpu->gcc-architecture., (continued)
- [bug#64188] [PATCH 4/8] guix: cpu: Refactor cpu->gcc-architecture., Efraim Flashner, 2023/06/20
- [bug#64188] [PATCH 8/8] transformations: Allow autotuning for go packages., Efraim Flashner, 2023/06/20
- [bug#64188] [PATCH 0/8] More package tuning, Ludovic Courtès, 2023/06/25
- [bug#64188] [PATCH v2 0/7] More package tuning, Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 6/7] gnu: go: Add CPU tuning targets., Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 1/7] gnu: %gcc-11-x86_64-micro-architectures: Add psabi entries., Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 4/7] guix: cpu: Refactor cpu->gcc-architecture., Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 2/7] guix: cpu: Add generalized CPU matching., Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 7/7] transformations: Allow tuning go packages., Efraim Flashner, 2023/06/26
- [bug#64188] [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-architecture-level mapping.,
Efraim Flashner <=
- [bug#64188] [PATCH v2 3/7] guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture., Efraim Flashner, 2023/06/26