From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GC6kBqaImWRhTwAASxT56A (envelope-from ) for ; Mon, 26 Jun 2023 14:46:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OIR5BqaImWR8HwEA9RJhRA (envelope-from ) for ; Mon, 26 Jun 2023 14:46:30 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9B87E3CED0 for ; Mon, 26 Jun 2023 14:46:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDlWH-0008SR-18; Mon, 26 Jun 2023 08:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDlVr-0008K9-74 for guix-patches@gnu.org; Mon, 26 Jun 2023 08:40:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDlVm-0005x3-FR; Mon, 26 Jun 2023 08:40:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDlVk-0004Im-Hp; Mon, 26 Jun 2023 08:40:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64188] [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-architecture-level mapping. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: mail@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 12:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64188 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64188@debbugs.gnu.org Cc: Efraim Flashner , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 64188-submit@debbugs.gnu.org id=B64188.168778315416388 (code B ref 64188); Mon, 26 Jun 2023 12:40:04 +0000 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:14 +0000 Received: from localhost ([127.0.0.1]:44767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUv-0004GB-VA for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:14 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:46163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUt-0004F5-6J for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:11 -0400 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-313f2a24cb6so896793f8f.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783145; x=1690375145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=fDr2gQ4E0M+2kBmCgFw/Ozk3Cr9PTk5B2N5KSuSzAAs=; b=l5JvDbqlsAgTkrP4uH6jficHibHWMLKr4HwwKT5WMYfNnvj8y9dq0HjaekVyiNvTWq x0OXj0t+qTL6H2NQhrfNKbajtmEdbM6nsGhUQdZkBLJjTaPoSdhQ/H9xEQShiLpQawYd IfKYSO/Z7Hz+MvhRViZO4P83Jm7XLRnthqy1ZmoMKBTLcBquHzEm5Cgk8PVbrgmCUShd pG18karc4cAbMaoj4sI1lloMvU3neXGnAi1zv7i6/0m5KzipB+ZuRz5sgeL5kgCKZZDm etU93QsEvaao6coyTS94wonIOqHpIx39XiinhQf1T9vfrSE0JKJpKNQXEi1iGLSVoMwC HCTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783145; x=1690375145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fDr2gQ4E0M+2kBmCgFw/Ozk3Cr9PTk5B2N5KSuSzAAs=; b=KEIMbNX4TIe+NajDvoCQX63vqihlckL6fFQN0MmYVEqbSMnBqdz+zypC/htEDoA3kS kilt6RFA6/eTFQb4ulddtvMvuZKR5E0Npr/y3Fod1GY1TdNf5fypdZjIT8dhOddeFoQl go4r4mtvSurK0Gl41RRUJKk3anSOGJu+BubBwcoTbOSwmGMs17ESBGIAFd3Rpb0dg/Cf vjF5IoXVRLkVebrsGfU9wz0QJEyAGQc6HUCdKcQqduaQzzaHEpAh8Fg/r+09kZGyYu5H gQdwvaF5A5ryHwPbkmu3d2+kiADQ8sjtGZTXB5nRFyPqMohG+HkypQ4b/6cQgU02tugb +hZA== X-Gm-Message-State: AC+VfDz4GRbYpHSsOgzSt/Z2jmNC+VK9ySV6FNuGLVn75fgRreG/Z3tY N709nuYXEGvpLl4RwmSr9m4Um+KvokmwnA== X-Google-Smtp-Source: ACHHUZ5gEG+u4pjgU3HnQu+beeHC7W8GDrfwNiaO/ORnooU/bKTIRM2B4iKcYneMIzgRM9caQvuTCQ== X-Received: by 2002:a5d:42d1:0:b0:30f:c1c3:8173 with SMTP id t17-20020a5d42d1000000b0030fc1c38173mr25524873wrr.26.1687783145297; Mon, 26 Jun 2023 05:39:05 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id e15-20020adfe7cf000000b0030aed4223e0sm7233471wrn.105.2023.06.26.05.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:39:04 -0700 (PDT) From: Efraim Flashner Date: Mon, 26 Jun 2023 15:38:41 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687783589; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fDr2gQ4E0M+2kBmCgFw/Ozk3Cr9PTk5B2N5KSuSzAAs=; b=hX1+jLW3AM11oqheJE9Tkrxxab7inW6Ndl7Hf1KscEXfwdI1l56WjEdB/spOCS+jZmLyqq dg2JyQumltwOrO3qT0TzVxODyaSDmhlVHZc4/y7p1kwcHf6TXDDCLzjLO4XafSn1Rf/wUp BQnZjKlrt8kPHJBczJbrrUDswW6Wth8BhIhMhe469NOWOlox2l8QM6I/jEt56PpJ4rwLvv kLhg5JJEh7yZOX1dUJQ3mWvk0Qpg9W3WZmwVCO4gUQkOq/1AETIYp19FqfMJFMhi4SpP3e miTF3ZMTfC8upiq7A2iUQp+dwWXFjR/S6FPO/6BjeeAWO9NKjXLDX0T3cvnA6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=l5JvDbql; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687783589; a=rsa-sha256; cv=none; b=huqEXYmkcOiwxa03EUShsyYS1WPIwr6zh/8FI/GRlgQLR+cVaG8cxOR+1kNrmlZm3r+fIW soehlv/lkB0XMnvNeqjDC770ZmIp+cEa+Umh6Z7tHcRMo0Rsk+H+QLK4q6Ji/6wjd1WoDH gNP5ax/V/fl3bOQDxhMCSAxXfy36HVnSwyuCEFILq7cNPm9xG04/73aM4Da8nDP53H+i+Z SBhKYWCoT4RKNaXOJUWmM8RNkpXtqTQSQ7AYlRwUl6pO9IxLdUsTig8x935UCv4QYidYa9 +RXJ0a+hx1ci2ZsSStZsxXoQoOdL7CZdCLyBINQfJ6beRAvrOGQSKltsVBr2Ag== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=l5JvDbql; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9B87E3CED0 X-Spam-Score: 0.25 X-TUID: 5wHdvmEX4Sea * 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 רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted