summaryrefslogtreecommitdiff
path: root/guix/cpu.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/cpu.scm')
-rw-r--r--guix/cpu.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/guix/cpu.scm b/guix/cpu.scm
index e80b74f161..840215cff0 100644
--- a/guix/cpu.scm
+++ b/guix/cpu.scm
@@ -113,7 +113,7 @@
"Return the architecture name, suitable for GCC's '-march' flag, that
corresponds to CPU, a record as returned by 'current-cpu'."
(match (cpu-architecture cpu)
- ("x86_64"
+ ((or "x86_64" "i686")
;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.cc.
(letrec-syntax ((if-flags (syntax-rules (=>)
((_)
@@ -200,7 +200,9 @@ corresponds to CPU, a record as returned by 'current-cpu'."
;; TODO: Recognize CENTAUR/CYRIX/NSC?
- "x86_64")))
+ (match (cpu-architecture cpu)
+ ("x86_64" "x86-64")
+ (_ "generic")))))
("aarch64"
;; Transcribed from GCC's list of aarch64 processors in aarch64-cores.def
;; What to do with big.LITTLE cores?
@@ -290,12 +292,12 @@ correspond roughly to CPU, a record as returned by 'current-cpu'."
;; v2: CMPXCHG16B, LAHF, SAHF, POPCNT, SSE3, SSE4.1, SSE4.2, SSSE3
("avx512f" "avx512bw" "abx512cd" "abx512dq" "avx512vl"
"avx" "avx2" "bmi1" "bmi2" "f16c" "fma" "movbe"
- "popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86_64-v4")
+ "popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86-64-v4")
("avx" "avx2" "bmi1" "bmi2" "f16c" "fma" "movbe"
- "popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86_64-v3")
- ("popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86_64-v2")
- (_ => "x86_64-v1")))
- "x86_64-v1"))
+ "popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86-64-v3")
+ ("popcnt" "sse3" "sse4_1" "sse4_2" "ssse3" => "x86-64-v2")
+ (_ => "x86-64")))
+ "x86-64"))
(architecture
;; TODO: More architectures
architecture)))
@@ -304,22 +306,22 @@ correspond roughly to CPU, a record as returned by 'current-cpu'."
"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
- ;; AVX512F+ for x86_64-v4, AVX+ for x86_64-v3.
+ ;; AVX512F+ for x86-64-v4, AVX+ 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 "graniterapids-d" "graniterapids" "tigerlake" "sapphirerapids"
"cooperlake" "icelake-server" "icelake-client" "cannonlake" "knm"
"knl" "skylake-avx512"
"znver4")
- "x86_64-v4")
+ "x86-64-v4")
((or "pantherlake" "clearwaterforest" "arrowlake-s" "sierraforest"
"alderlake" "skylake" "broadwell" "haswell"
"znver3" "znver2" "znver1" "bdver4")
- "x86_64-v3")
+ "x86-64-v3")
((or "sandybridge" "tremont" "goldmont-plus" "goldmont" "silvermont"
"nehalem" "bonnell" "core2"
"btver2" "athalon" "k8-sse3" "k8" "bdver3" "bdver2" "bdver1" "btver1"
"amdfam10"
"lujiazui" "yongfeng" "x86-64")
- "x86_64-v1")
+ "x86-64")
(_ gcc-architecture)))