From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:48:56 2023 Received: (at submit) by debbugs.gnu.org; 20 Jun 2023 07:48:56 +0000 Received: from localhost ([127.0.0.1]:57930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW6h-0004yc-RD for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:48:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:48046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW6f-0004yU-RV for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:48:54 -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 1qBW6e-0002tB-JA for guix-patches@gnu.org; Tue, 20 Jun 2023 03:48:52 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBW6c-0005K9-5Q for guix-patches@gnu.org; Tue, 20 Jun 2023 03:48:52 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f90bff0f27so19795635e9.1 for ; Tue, 20 Jun 2023 00:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247328; x=1689839328; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=f7OldnQhFHSp9HzuB7I0ZCDG3go5IzFGreQmQYZzFnM=; b=oAX/ix9w272ZNb/UzYsrxl36GCm3HxyCclSlzkFg25ikEEb3Fa4MkVXBiJUw3nPo+j 8+QoCXbomFjwp/YcEuzTEkPRXV0v8a9KX5hXRtCZAskiES6fCoL3UWYRxCJ3nZYJe84F AehlRL3AIJzyEfbYygcFXJhcrT+6sBMdMacCvcDsU2O3A61DBOtS57o3TuJdTgBPCi88 rFDIU/i6ezzG6VXSpskSFKg07pyBpnXYnkGaB1vO2/M6VccYtKurlr1UBw+5SON/eSVi U9dFBQTtOn2uYjlhMvj9uWz4Rze7+i8Vr+auMDN1oAsoo8/zXlp9mV/RA2f/9LIc3Hak IxyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247328; x=1689839328; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f7OldnQhFHSp9HzuB7I0ZCDG3go5IzFGreQmQYZzFnM=; b=g9chzeZjaz/DPDvGrdRZVpFOzqmw9MMlczNpW6RbUk0RgZDa3wkzJNTbhTq0cU203F 5yDYZJ1m4oj9888Ii8MrFKZk/DZzr0rsxRHnku1vkdUHhwr/toXqlaJSbgWzDb1sVUMg /nekRjQRL4CtwwIDr7wh3tqsDt9m6hS/cv8ai/T9DH/9G7igCw/2EYgAvRszrRthUFVU mm+svoZzNyJBF9alBWnDO5Lg6h3IbBm3s6q2GxxlEakty0OrVAHFS8S4i0Av2OyWlNDR LwJpxDGxT65oT145fsD2K4x4FcXF+BrP9ZLt8zUAOGiUeMCBhXPc1gAGzoHITAavBLeP 1z7w== X-Gm-Message-State: AC+VfDw9YhoVGQay4asRV2Qz4FZMN9zE8RNTe5vzJKOFnBRYdDiAAg/W mT+cNze7qEyAeUWDMPTMfx+qAAnzAXUx/A== X-Google-Smtp-Source: ACHHUZ6tQb7GnuqaXT8QAQSptqTXBq0dk1H1wOnlgCFSeZub9qmyIuXJmE4eD2mHhuj7tGGnWLqhSw== X-Received: by 2002:a7b:c449:0:b0:3f4:a09f:1877 with SMTP id l9-20020a7bc449000000b003f4a09f1877mr7590457wmi.23.1687247327945; Tue, 20 Jun 2023 00:48:47 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id k4-20020a05600c0b4400b003f727764b10sm1674318wmr.4.2023.06.20.00.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:48:47 -0700 (PDT) From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH 0/8] More package tuning Date: Tue, 20 Jun 2023 10:48:46 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) with gcc-11, gcc gained support for using -march=x86_64-v{1,2,3,4}, which I'm calling 'generic options,' as opposed to the more targeted tuning we have with specific architectures. Unfortunately there doesn't seem to be a way to map our current architectures to these ones, making it harder to swap between them. The best I've found is that any architecture which can use the Haswell architecture optimizations can also use x86_64-v3. I suppose we could create a mapping so that, as a fallback, anything haswell or higher would use x86_64-v3, anything else would use x86_64-v1. This would help with --tune=native. For the second patch, 'Add inexact cpu matching,' I'm unsure about needing to check for the avx512f flag; I don't have any hardware to test with. Patches 3 and 4 I tested on my machine (with commenting out the AMD branch) and it successfully decided I should use x86_64-v3. go cpu tuning targets: I mostly used the chart¹ on the go website, and I also checked the source code for go-1.18. I put in arm{5,6,7} as arm and not armhf since armhf only works with armv7 and with go programs, since they're statically linked, they can just be copied to other machines. The 6th patch, adjusting the transformations to also do go packages, I tested with syncthing. with '--tune' it failed during the added phase, trying to tune for znver2, with '--tune=x86_64-v3' it worked without problems. Having written this out, I think our best bet would be to use a generalized >=haswell -> x86_64-v3, else x86_64-v1, and not worry about individual micro-architectures and specific chipsets. That would ensure '--tune=native' should just work with go packages. As far as tuning go packages, my understanding is that pretty much every non-trivial go package can benefit from tuning. EDIT: I added two more patches on-top of the initial 6 to implement gcc-architecture->generic-architecture and then use it. For patch 7, the other option I had instead of returning gcc-architecture on no-match would be to return "generic". ¹ https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support Efraim Flashner (8): gnu: %gcc-11-x86_64-micro-architectures: Add generic options. guix: cpu: Add inexact CPU matching. guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture. guix: cpu: Refactor cpu->gcc-architecture. gnu: go: Add CPU tuning targets. transformations: Allow tuning go packages. guix: cpu: Add gcc-architecture->generic-architecture mapping. transformations: Allow autotuning for go packages. gnu/packages/gcc.scm | 4 +- gnu/packages/golang.scm | 23 ++++++- guix/cpu.scm | 128 ++++++++++++++++++++++----------------- guix/transformations.scm | 43 +++++++++++-- 4 files changed, 135 insertions(+), 63 deletions(-) base-commit: d884fc9e2efecfba09af4694f5a13ad7fc6f704f -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:13 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:13 +0000 Received: from localhost ([127.0.0.1]:57946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8u-00053I-NC for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:12 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:56483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8s-00052z-NM for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:11 -0400 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-311099fac92so5119604f8f.0 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247465; x=1689839465; 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=W15okNRfKglCI26HtE3HaYTr+lHOJ+mzzo9xrD7Cwz4=; b=f/3neW87PYv9tjEFbvqu4cxov+S9cxkoYcuoYOItclwSR1BaXDrgPjuRa6Ujny4B8p ddsIQ3SnveSLQqYl3arfrnzxfQYJ7Kn6sIqklT/t4ZV1c69cL5PqZddPkmEM/HXNOjto Jk3jIYfht4aZyueVdCZl+ucfsP98kwlWNk+HzBoq7TyKrdFvzrU4LZ7BTxsMnEz98sqr HT9/QjymvCjHg9dC9KFrB6QFw9xwUvyJkDJ0bSm7SELtf6K1h2JbAKwtly/rgByC2psD 81vYCXIUM5Rh73jOMk+I11gzfAggtuWzUJZFLUWpfyazcRJwvZng4p8AZJky9SOBsOeE eiaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247465; x=1689839465; 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=W15okNRfKglCI26HtE3HaYTr+lHOJ+mzzo9xrD7Cwz4=; b=D3UXhRRkWtwk8EA/H/JAQd/lY/Pey+MeRwy+pU9l1ZbRNaHEkSTFAy1VDUPT9734xB xxpmB+N8EHD3TJ2Na7fSnUvp5Gc+aM2N1usHmrGj5W9CppXwNu4zbkz7Qb/zQ8TwKyIc kGVrVYDNslr82HGHewWTI7M5anoPlPbGRDLcD6orfMWKw4uM+CaCwvrobhA/Au4w2BOm sDYOQKXhKI8o5CgLvg/ZrsOzZIPe+ERnP+F988G8ab4i9uGvTq4JblMxAnH1NO93XRgq AmxXWCW4NQhjOyyz9UqiPPEKJ4uQRjBeuwtiBOgoQnknmGTYvB7wFU2Klx93yaWO/bPz qVBg== X-Gm-Message-State: AC+VfDwF3aru6wq/bCmZJPOj0jBh7h196y30PHYRFmX8b0NY/OQ3YLAx iE2YDaJxYzdDc0RpOagehTUHTg5CQjS0Fc5e X-Google-Smtp-Source: ACHHUZ6YrJx/x/164ovUtpQT/0jT5mXrncK3ELJeCbCjw6cDeiIQiK0TjOj5hT5jwcuNKLpIJFIUPQ== X-Received: by 2002:a5d:5960:0:b0:30e:19a8:4b0a with SMTP id e32-20020a5d5960000000b0030e19a84b0amr10889891wri.2.1687247464471; Tue, 20 Jun 2023 00:51:04 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id m15-20020a056000008f00b0030e5bd253aasm1352437wrx.39.2023.06.20.00.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:04 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 1/8] gnu: %gcc-11-x86_64-micro-architectures: Add generic options. Date: Tue, 20 Jun 2023 10:51:02 +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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * gnu/packages/gcc.scm (%gcc-11-x86_64-micro-architectures): Add entries for x86_64-v{1,2,3,4}. --- gnu/packages/gcc.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 1b444c2b02..f5736de993 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -614,7 +614,9 @@ (define %gcc-11-x86_64-micro-architectures (append %gcc-10-x86_64-micro-architectures '("sapphirerapids" "alterlake" "rocketlake" ;Intel - "btver1" "btver2"))) ;AMD + "btver1" "btver2" ;AMD + + "x86_64-v1" "x86_64-v2" "x86_64-v3" "x86_64-v4"))) ; Generic ;; Suitable '-march' values for GCC 12. (define %gcc-12-aarch64-micro-architectures -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:16 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:16 +0000 Received: from localhost ([127.0.0.1]:57949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8y-00053Z-0h for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:16 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:52732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8w-000535-7h for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:14 -0400 Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-30e3caa6aa7so4364724f8f.1 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247468; x=1689839468; 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=GvOp7dpftE/82t5oSPr/dcYhFChSum/lRb9TF6+vQPg=; b=CxfdHX97rzieiMXWSLZTg69dic0Z6Kr52ywrCTC9OzKgfGL1sG4z7n/xYEGmk4X9A8 pMyoYXRpctz4Cta95fXIYz74CMx9fAPSaKvd1DMNnLEQ5jIkPvivOJWDgY5R2dzHFSMx wmVfYWb1iBbZ7jhXFw29gCVeyM5H9npYpQAk09upZ5ADw5XfD6HSK4qZri/S2dkbkqR5 +zA+FWLNLVIPb1gx/4nWHnK9kbRWSSp+wzzluIt0XR2roaZnQHqdABup0RsfcyG6swwa f8iOgQKFojoQYOU1NwRgxGZGskSuBCaJBT5vZjIJJ7WeG7BwK1hKyVMsRvTb+18PRIV5 1cvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247468; x=1689839468; 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=GvOp7dpftE/82t5oSPr/dcYhFChSum/lRb9TF6+vQPg=; b=k3C7iD5CLWb73qk8ap6AXj7OPxAVMdBoCow48PEvajQ6T6jNVbm8aZi8OSFgPsz+ab VWL933kVGvG/LQnwGj+KkfEILHSlLc69p5FxmfJbrLCEHP9oLzZ1mM4HLcj6umt5pnLD KnIIVroyTyvTeEyYw/bP8k6RJ4mh06lFG1jhsrRvAS+CvDmUbh7w3dyvO0FOV8aCnHsP oi5aVFeuiTUHq6vUVfmpt9M/E5IaawZwZ3Uj+66ACV5TzxuKKOijmYnD0v08YJNKGkJH x0eBiDoULAq3j1ppAZQV/+ZlY7I74DSD3p6U65V7TcVknA/Xe2L9OkUBjEH4ar3OxVMS mFyQ== X-Gm-Message-State: AC+VfDwkPiFGy/HtSR+HuC+jS5X3Fwjxf8BIgSISBf5lgyqvpnzjPCj2 wDP2UzInIfLs5tjqeuUXf2kImYVJi4g9ITYC X-Google-Smtp-Source: ACHHUZ61+iLhFnmOjFejYMjKzL4IbtbO7Zu08eEoaCNFBm0NzY7vDysKXP898Zs7gxk0i3p2Uz+mPg== X-Received: by 2002:a05:6000:1370:b0:311:1a45:3606 with SMTP id q16-20020a056000137000b003111a453606mr9216934wrz.30.1687247468514; Tue, 20 Jun 2023 00:51:08 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id y14-20020a5d470e000000b0030647449730sm1356830wrq.74.2023.06.20.00.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:08 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 2/8] guix: cpu: Add inexact CPU matching. Date: Tue, 20 Jun 2023 10:51:03 +0300 Message-Id: <6ecddc871328fcb3b494f3e6c1aafc6ad1d20830.1687247150.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->generic-architecture): New variable. --- guix/cpu.scm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index 45e1abeed7..e6102e3d14 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 + cpu->generic-architecture)) ;;; Commentary: ;;; @@ -285,3 +286,36 @@ (define (cpu->gcc-architecture cpu) (architecture ;; TODO: More architectures architecture))) + +(define (cpu->generic-architecture cpu) + "Return the architecture name, suitable for inexact architecture optimizations, +that corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + (or (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + + (if-flags + ;; https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex + ;; v4: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL + ;; v3: AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, OSXSAVE + ;; 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") + ("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")) + (architecture + ;; TODO: More architectures + 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:19 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:19 +0000 Received: from localhost ([127.0.0.1]:57953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW91-00053v-DA for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:19 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:53375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8y-000538-50 for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:16 -0400 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-3f8c65020dfso47319465e9.2 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247470; x=1689839470; 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=6rB6+88bEE0VUXQmBy2pUIf2SRFPVhTx0NwrBSxwUb0=; b=pi0sMtgr8ymlFJJzA53Ri1lpehR+RlnH77/MLaiR3LhGEGCmu2s6S5O6xE4xLeIFMW CFIjcbGVL92DGtt5EmPLNNjwPNgaWUkul0VUEUPIVyTXUJP5vzOKDq5gqM9gpz9vu3zs 0q6Ivq1MYKj2DRqY5sijiWDr41/DGNjM55z67eYHTrgmyyBQfNmwnMRLwHN+xe5Jp2Ob OAEVzZxeKPpxh8jdCUAwR0ObiIxhCeQ2DIRpDp9LUdwqQjQsPeRWZWMYmlfFuluB7Ahl CyjpBdyk2yDudDbblLgrArG3aYm+Ds9C2Nhnwc+gI9x8FVBrlwb+C997hmnMX88jXcqk 7BDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247470; x=1689839470; 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=6rB6+88bEE0VUXQmBy2pUIf2SRFPVhTx0NwrBSxwUb0=; b=LPjXOa8UBlz8897V5PGtkhVxNc9y6C7I3pZHEOE68TGpqjuQzDEQHlMdh1CVsAWUsK W8HchZgwNV/VB7N3T6kC1XouRYYdYk7fOna3Df479vqa6r9k5NQFBTxszeR7r7/2z3w2 BXWHdSHPrRh9QCQaRlrzQ7TSb/RTsYG45yWvxc1Gph+0+iuQchjlWbWi6B4ZlxzXxwC2 t7m5vBx8sxIis3icVUR84fb/aMqwWAWg8c9TuHkf7x0TqgPXEdE1mqK8AgWuuupI42NE 1+JrwSK30c1qoZxWM87c/x2YtIULB0G6tP/Us60Jj6/9c/Hcf0Ci1HTjdP3r1DlX1OrQ n+Eg== X-Gm-Message-State: AC+VfDxVCg/gI0BbGc7CwgGQJ/k/efEY0DhNubVBIkkUQV/flD7PJlrv zjxtP745AK5qdb8jInwWlkOHUTfBcxZkrHVe X-Google-Smtp-Source: ACHHUZ6PqHuGA3lAc2Hhys5vxLK7Bgg/2JoAXDTTd4M+AqeCGsvYLlRmKbPD+GS2d0vClicdtIWyRw== X-Received: by 2002:a05:600c:22d8:b0:3f8:f884:ebec with SMTP id 24-20020a05600c22d800b003f8f884ebecmr9197668wmg.17.1687247470358; Tue, 20 Jun 2023 00:51:10 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id f20-20020a1c6a14000000b003f8f884ebe5sm1686468wmc.2.2023.06.20.00.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:10 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 3/8] guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture. Date: Tue, 20 Jun 2023 10:51:04 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->gcc-architecture): Adjust the fallback case to use cpu->generic-architecture. --- guix/cpu.scm | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index e6102e3d14..e500664503 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -210,21 +210,7 @@ (define (cpu->gcc-architecture cpu) (if (and (= 7 (cpu-family cpu)) (= #x3b (cpu-model cpu))) "lujiazui" - (if-flags ("avx512" => "knl") - ("adx" => "broadwell") - ("avx2" => "haswell") - ;; TODO: tigerlake, cooperlake, etc. - ("avx" => "sandybridge") - ("sse4_2" "gfni" => "tremont") - ("sse4_2" "sgx" => "goldmont-plus") - ("sse4_2" "xsave" => "goldmont") - ("sse4_2" "movbe" => "silvermont") - ("sse4_2" => "nehalem") - ("ssse3" "movbe" => "bonnell") - ("ssse3" "sse3" "longmode" => "nocona") - ("ssse3" "sse3" "lm" => "nocona") - ("ssse3" "sse3" => "prescott") - ("ssse3" => "core2")))) + (cpu->generic-architecture cpu))) ;; TODO: Recognize CENTAUR/CYRIX/NSC? -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:20 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:20 +0000 Received: from localhost ([127.0.0.1]:57955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW91-000542-Qm for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:20 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:44089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW8z-00053H-Pe for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:18 -0400 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-311183ef595so4158801f8f.0 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247472; x=1689839472; 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=e3Ue99nDYZ4Z89xMaS87vUllvGH8q1VmDDTQRWV3pDE=; b=ClZZ7Wgy5Puo20ozW1C+KuM+B6sEwEODsJnWkGpQ/QOaOG2bGuaz6G2yCu9J8dbJgU TaFFqRruD3YnxkLrxNQf92BbLAbx+Vy0P7O1/LBKBy8Kqeqy36NDbdt3au4KvkxdKhli K4EOJqEHx88rAl6MUGtUYKLSAKPiq23zV2AJPG9joViGDClOoMsZgAfKYwgFlLxWQ5Zh 30vb2kpNUxVKEyQ4qWIJUjgKs+dR+hdsQcSB7tUl6chjGQ5TOGrnRvhzKHR9k1jIjdU/ bTy70KvZc9SKuBm3daXxr5mQ3GLydYM+Il7vE/SlKOiNdDrKr2rKphMYZdrJ8BdIUsHj Nvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247472; x=1689839472; 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=e3Ue99nDYZ4Z89xMaS87vUllvGH8q1VmDDTQRWV3pDE=; b=eluAw55wkdIA0W8matjEZgWN3qZItySi3cZ+MAwAoZIu/oO4ipNxRT0U59+9jhWXZJ e29XIeCe5Mgcq5RB/6f8N+FdgNNoKeUdCKhFRMGGbam/SdxuiCNxdBlwROL4UXbG7RQN fu4OMu7r2TpoSBp7NweLDEUWVMkVEjgU8lfDyxdm33QuqPUm7wNnal7Ydw9N27QtnxRY 8lN4hAm6pCbpkKj9RTfDwEqSFXGzAPLUzRYTGchItGvkEq6gFJFO6mxjBKCHSFYTeyWs 3icGteHuETLrdaHH3mT4ZJUEjgUJP8Tvd8U8qAV5i7meCrfnc4Qlp+vHBP570SZhbt4W /Peg== X-Gm-Message-State: AC+VfDz3Rw57abgQ2w/VhM+41yLsenW+drK5ESyV0DkwFJyzm6mA5BqV vleYifDsvWVCuPPPtNtZvHhEnd9THzu9mmVB X-Google-Smtp-Source: ACHHUZ7q30IXsrJqzMLqtk809m86xaZ/CUrr9VWno7K9eZT0AX5NZS1aoIFCAgUDG8dFCl29UobcMw== X-Received: by 2002:a5d:46c5:0:b0:30f:ce77:434c with SMTP id g5-20020a5d46c5000000b0030fce77434cmr9103293wrs.62.1687247472177; Tue, 20 Jun 2023 00:51:12 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id i15-20020a5d55cf000000b0030633152664sm1329284wrw.87.2023.06.20.00.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:11 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 4/8] guix: cpu: Refactor cpu->gcc-architecture. Date: Tue, 20 Jun 2023 10:51:05 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->gcc-architecture): Refactor to wrap all the x86_64 options inside a common letrec-syntax. --- guix/cpu.scm | 59 +++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index e500664503..ddfa4f20bb 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -115,19 +115,19 @@ (define (cpu->gcc-architecture cpu) (match (cpu-architecture cpu) ("x86_64" ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.cc. - (or (and (equal? "GenuineIntel" (cpu-vendor cpu)) - (= 6 (cpu-family cpu)) ;the "Pentium Pro" family - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (or (and (equal? "GenuineIntel" (cpu-vendor cpu)) + (= 6 (cpu-family cpu)) ;the "Pentium Pro" family (if-flags ("avx" "raoint" => "grandridge") ("avx" "amx_fp16" => "graniterapids") ("avx" "avxvnniint8" => "sierraforest") @@ -153,20 +153,9 @@ (define (cpu->gcc-architecture cpu) ("ssse3" "movbe" => "bonnell") ("ssse3" => "core2") ("longmode" => "x86-64") - ("lm" => "x86-64")))) - - (and (equal? "AuthenticAMD" (cpu-vendor cpu)) - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + ("lm" => "x86-64"))) + (and (equal? "AuthenticAMD" (cpu-vendor cpu)) (or (and (= 22 (cpu-family cpu)) (if-flags ("movbe" => "btver2"))) (and (= 6 (cpu-family cpu)) @@ -193,28 +182,18 @@ (define (cpu->gcc-architecture cpu) ("lm" => "k8") ("mmx" "3dnow" => "k6-3") ("mmx" => "k6") - (_ => "pentium"))))) + (_ => "pentium")))) - ;; Fallback case for non-Intel processors or for Intel processors not - ;; recognized above. - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + ;; Fallback case for non-Intel processors or for processors not + ;; recognized above. (if (and (= 7 (cpu-family cpu)) (= #x3b (cpu-model cpu))) "lujiazui" - (cpu->generic-architecture cpu))) + (cpu->generic-architecture cpu)) ;; TODO: Recognize CENTAUR/CYRIX/NSC? - "x86_64")) + "x86_64"))) ("aarch64" ;; Transcribed from GCC's list of aarch64 processors in aarch64-cores.def ;; What to do with big.LITTLE cores? -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:24 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:24 +0000 Received: from localhost ([127.0.0.1]:57960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW96-00054R-8M for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:24 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:45481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW91-00053T-UF for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:20 -0400 Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-30fcda210cfso4150483f8f.3 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247474; x=1689839474; 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=I4dZXYdhtEg2FuatYsIxG7WVf/4ArICeDFNWrU3kbwY=; b=BjkdOoqK7iO4ot7TxylJCuJbNnEv8zWrzGkclNDgiXvI2GA1akpxucP4uxDmz+MT1r kzm6PE9apxC4ePJz1C3N3NbGThAoLxMb9HQkmpn7aHsqCAIRuur9m6kDHQP6wT8r7U9j qFwNBMYllnkxwk/IRhSDktqFaRYscPxUNocQMQ9JoThW8oeVKPHCv9zr3b0JxkssXFDG dFD7JYkg99VdxMz2wJWgqA4NB3T0C+xZIOSfVbf00h+IJozzIFHQaMkG62wVBbzIxP8E FyIHKkntizc3y4Wk4uHhYYgH+Xfn8pFsecWjJuLX6Zr1pT+TnzolcoGxZosB2Ej5Re83 Ce1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247474; x=1689839474; 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=I4dZXYdhtEg2FuatYsIxG7WVf/4ArICeDFNWrU3kbwY=; b=eSnAUItnW4ODJyQ8R45Ue5223dhToMc2njgNgf1iI0vAbVNXvnYqgVg9ItUT5ekW8B WMwkr5qxp1xuKS86Av0qpnfw13P16vDOkbXhRilywurFnxMGzj2qwgQ2tbHBo0PJ4i4v 5VtTXPreocSvP12cbvBl1V9YwBAQdCqPsThl5XXpXv8r1kXiRP+084KiXdb4ptuitmwp sJHksJ5RWcqLf+aNoGQoRCqlNrEjr6Uqr5P/0iIr+Oa4RLcNCjGllRHQSHbxmnaXUouf D5d+PjYuBP852hXG9HTcWBGxwTYUJ3DcS24yFNQfVJs1GoQA2DnWEdZV97Z5q9tWaauv laEg== X-Gm-Message-State: AC+VfDyn501EyaABQhYMQ8oSQaJ2nrMMWsyMaoAttP3XhPZlLDiCkHwy 7AuWp/L9oy+dw+awsF5Af3yRBOclsOO80WqG X-Google-Smtp-Source: ACHHUZ4qZ/kZu64VP7EGmyi8rPP+fAO/4vFIZ81JH8hCf8IZvpOZY5KRjQzSM0mKobu/Kq+WdZqdWw== X-Received: by 2002:a5d:654a:0:b0:30f:bd48:6828 with SMTP id z10-20020a5d654a000000b0030fbd486828mr8118366wrv.31.1687247474335; Tue, 20 Jun 2023 00:51:14 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id w8-20020adfcd08000000b00301a351a8d6sm1356318wrm.84.2023.06.20.00.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:13 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 5/8] gnu: go: Add CPU tuning targets. Date: Tue, 20 Jun 2023 10:51:06 +0300 Message-Id: <2c8bd624a47e6902bdfc25b8322aa03b31b8291f.1687247150.git.efraim@flashner.co.il> 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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * gnu/packages/golang.scm (go-1.17)[properties]: New field. (%go-1.17-arm-micro-architectures, %go-1.17-powerpc64le-micro-architectures, %go-1.18-x86_64-micro-architectures): New variables. (go-1.18)[properties]: New field. --- gnu/packages/golang.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index d51c023808..c3ea30becc 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -628,6 +628,13 @@ (define-public go-1.16 `(("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch")) ,@(package-native-inputs go-1.14))))) +;; https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support +(define %go-1.17-arm-micro-architectures + (list "armv5" "armv6" "armv7")) + +(define %go-1.17-powerpc64le-micro-architectures + (list "power8" "power9")) + (define-public go-1.17 (package (inherit go-1.16) @@ -844,7 +851,14 @@ (define-public go-1.17 "README.md" "SECURITY.md")))))))) (inputs (if (not (or (target-arm?) (target-ppc64le?))) (alist-delete "gcc:lib" (package-inputs go-1.16)) - (package-inputs go-1.16))))) + (package-inputs go-1.16))) + (properties + `((compiler-cpu-architectures + ("armhf" ,@%go-1.17-arm-micro-architectures) + ("powerpc64le" ,@%go-1.17-powerpc64le-micro-architectures)))))) + +(define %go-1.18-x86_64-micro-architectures + (list "x86_64-v1" "x86_64-v2" "x86_64-v3" "x86_64-v4")) (define-public go-1.18 (package @@ -887,7 +901,12 @@ (define-public go-1.18 "ldflags, err := setextld(ldflags, compiler)\n" "ldflags = append(ldflags, \"-r\")\n" "ldflags = append(ldflags, \"" gcclib "\")\n"))))))) - '()))))))) + '()))))) + (properties + `((compiler-cpu-architectures + ("armhf" ,@%go-1.17-arm-micro-architectures) + ("powerpc64le" ,@%go-1.17-powerpc64le-micro-architectures) + ("x86_64" ,@%go-1.18-x86_64-micro-architectures)))))) (define-public go-1.19 (package -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:28 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:28 +0000 Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW99-00054m-QT for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:28 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:56569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW94-00053m-Nk for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:23 -0400 Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-4f866a3d8e4so3734167e87.0 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247476; x=1689839476; 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=s+4t5DdUHTaWV4XSXAE8le0FxTs+pztfyGUuJdYMBZg=; b=L/z/P9IhBdAo/NNNY2RPrbUoOuZwZdjDpM3j6ilDXWRwxodVVJqge5mPdeN3dFpqg4 3MmM8cnYYh73VjhLqHYatrw+ysCthf4+kHo/VNPA8+N4l8DpUWmh1wslFwLgqRyw3jJi 4ZLik51RpzzbaqD0N5AinIjSmHtVDLdQLgf6Wy9FKY0Ct/4x69tWCNwa4B3b7LXETR58 7I94arlCKFvZnFuWdE1zLMwGBehh/AQm4MoTaVqadoqiLQ2coHIov/+6Oy8s4HrQZl1Q FaRakOlVYgVOxzcM5QJoEn58Zf0ecrPzXk1YNW5o4YJt6Mec1Mj+ZVqarOUXzwibookl lOpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247476; x=1689839476; 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=s+4t5DdUHTaWV4XSXAE8le0FxTs+pztfyGUuJdYMBZg=; b=Bhmf8wQ891FDSmnmum9uSWmcVGYfbvRXiD840u4lo52Un4rM5DW0EtMrP4i3b0pYo+ GwOfjgD+v/tPb0W3mJ++mF+oJOHpScbKZacb0m+crhG5W1KoC8bb8xUbY1slOWLXnPju jttgBQrEf48oXx53FtaTAK/t3CysX1v+1IFi9m1HY2wzdQtYcc5UJM3ntPbDV25n2Yje 84jASI3Nggc4p9tVG9FVWld7q6ygDqqd1yPFqkMhZLafpWQmiD2K/mKTBWV2WWg0TME9 zTTwOi7UoQ2l/w1jqDNqzuhgrJC7fhkdzJ2kxchAcn3mwClbRCmhWJJN/bHugVOccn3n XdyA== X-Gm-Message-State: AC+VfDzfHMQYckpGa9XwhswLaBmYaQ+dEg5Fndsqf6uEmA7gebKsGIpS SN52oGDtrofrBuvbBpih2iTaG//TR0qrJbcb X-Google-Smtp-Source: ACHHUZ7qNWXgwzdo2afU1oj63AQWDR7tU4vaz8ZfDMob3EiGJgTj9pXYztbrxqPyQb6dWvrXi2kKcQ== X-Received: by 2002:a19:4409:0:b0:4f8:7556:23e6 with SMTP id r9-20020a194409000000b004f8755623e6mr2029931lfa.54.1687247476231; Tue, 20 Jun 2023 00:51:16 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id x11-20020adff0cb000000b003112d12a1ecsm1312246wro.98.2023.06.20.00.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:15 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 6/8] transformations: Allow tuning go packages. Date: Tue, 20 Jun 2023 10:51:07 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/transformations.scm (tuned-package)[build-system]: Don't replace the build-system if inheriting from the go-build-system. [arguments]: If using the go-build-system add a phase to set the micro-architecture for Go. --- guix/transformations.scm | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/guix/transformations.scm b/guix/transformations.scm index a289f81219..47eb4b0515 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2021 Marius Bakke ;;; Copyright © 2023 Sarthak Shah +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -570,14 +571,42 @@ (define (tuned-package p micro-architecture) (package (inherit p) (build-system - (build-system-with-tuning-compiler (package-build-system p) - micro-architecture)) + ;; The go compiler doesn't need to be wrapped. + ;; XXX: This is where we check for supported micro-architectures. + (if (eq? (build-system-name (package-build-system p)) + 'go) + (package-build-system p) + (build-system-with-tuning-compiler (package-build-system p) + micro-architecture))) (arguments ;; The machine building this package may or may not be able to run code ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are run for ;; the "baseline" variant anyway. (substitute-keyword-arguments (package-arguments p) - ((#:tests? _ #f) #f))) + ((#:tests? _ #f) #f) + ;; We add the tuning parameter after the default GO flags are set. + ((#:phases phases '%standard-phases) + (if (eq? (build-system-name (package-build-system p)) + 'go) + #~(modify-phases #$phases + (add-after 'setup-go-environment 'set-microarchitecture + (lambda _ + (let ((microarch #$micro-architecture)) + (cond + ((string-prefix? "arm" microarch) + (setenv "GOARM" (string-take-right microarch 1)) + (format #t "Setting GOARM to ~s." + (getenv "GOARM"))) + ((string-prefix? "powerpc" microarch) + (setenv "GOPPC64" microarch) + (format #t "Setting GOPPC64 to ~s." + (getenv "GOPPC64"))) + ((string-prefix? "x86_64" microarch) + (setenv "GOAMD" (string-take-right microarch 2)) + (format #t "Setting GOAMD to ~s.\n" + (getenv "GOAMD"))) + (else #t)))))) + phases)))) (properties `((cpu-tuning . ,micro-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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:28 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:28 +0000 Received: from localhost ([127.0.0.1]:57965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW9A-00054o-6x for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:28 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:44348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW95-00053u-UI for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:24 -0400 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f8fa2cf847so41801115e9.1 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247478; x=1689839478; 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=rPluJ7odc7AC6rHWh4OctnBPj2llW0xVIDr/xBgkVyI=; b=X/uih4B7MPKgLDRI8x3ng7kAryL4dYIjyaEfA3HNopq71zGa6BD32dVDQX2Gez4ZOc 7rGJy592hMiO2zwl+eyKmfkrS2NIhdNEc4O3kpccyTDZi0458s4EqTcaMUfUOMLUVgPV Lx103zhEll8cJp2vxdtZ0xjJbDM5QYZC79mV9+DVgcKkDkKHpIuSCKoeXdTa2W5GogW/ xjae7NWH9pbAxSJ1yhAy9YuJIRumh3H48IH7XSOQTnTa0f9Spkmq8lFNDIYG1X72Q3FK hvahnTcvAE+36qHiRvq7VAUdQXEL4nrpb9hihqpc9dqvhXe0AySi95tMrjv3uuAGx2D5 Hr3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247478; x=1689839478; 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=rPluJ7odc7AC6rHWh4OctnBPj2llW0xVIDr/xBgkVyI=; b=Tx6SOLayutRb+Dv4kQAorFytPQ9oM/MTPvd6w+jbrTQQCShF+8BgPv+yO1lJBhPt2o dx7V/HPqDX2jBa1/TmAGCJbQyHVQCaNGXjgQcX+8DmVfggUN/6S0l32tyMIK8PnRZIck vMvRgVGK/BUZpkMFoZPbTNN4AH175Z19eTHppyuDCMiqgjPEIvIji6C7vOt4X0gYGNBP Vkd5Naygg+vDiXCY4VTRlkENlSYmKxMbr0nwsgx756okOXu/LvWd6BBYWMZ8UtsRnegu BcYDfvqslTl8MUe0q/G3Dqirj83fwNbktTWz5ULrIWUzD1+R8BK2jsA90H46OM/BFy6e mtow== X-Gm-Message-State: AC+VfDxjTKY0Jhv+6/JV17Xnaj7LsB2p//nY2Gwjr8GwM9+lFmih6tjG 5cAhwVt6qya0ZFHPEXWj29Hnwc9NkKnPtbkG X-Google-Smtp-Source: ACHHUZ5sFRICEXIpDdAO1hOyWNtnMYZYnIV4WHyMQTIYfV+XqPwNxkm9E/NuEu+tmSzS8ipTuS0P0g== X-Received: by 2002:a1c:7211:0:b0:3f9:206:c3a6 with SMTP id n17-20020a1c7211000000b003f90206c3a6mr7315291wmc.20.1687247478054; Tue, 20 Jun 2023 00:51:18 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id t20-20020a1c7714000000b003f900678815sm1603581wmi.39.2023.06.20.00.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:17 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 7/8] guix: cpu: Add gcc-architecture->generic-architecture mapping. Date: Tue, 20 Jun 2023 10:51:08 +0300 Message-Id: <12026d29411b4ef0597d2f40d874ad2fcc49a087.1687247150.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (gcc-architecture->generic-architecture): New variable. --- guix/cpu.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index ddfa4f20bb..af26e2280b 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -33,7 +33,8 @@ (define-module (guix cpu) cpu-flags cpu->gcc-architecture - cpu->generic-architecture)) + cpu->generic-architecture + gcc-architecture->generic-architecture)) ;;; Commentary: ;;; @@ -284,3 +285,21 @@ (define (cpu->generic-architecture cpu) (architecture ;; TODO: More architectures architecture))) + +(define (gcc-architecture->generic-architecture gcc-architecture) + "Return a generalized micro-architecture, using an inexact matching to provide +'good enough' optimizations." + (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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 03:51:33 2023 Received: (at 64188) by debbugs.gnu.org; 20 Jun 2023 07:51:33 +0000 Received: from localhost ([127.0.0.1]:57967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW9E-000554-Iz for submit@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:33 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:57567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBW98-00054G-K2 for 64188@debbugs.gnu.org; Tue, 20 Jun 2023 03:51:27 -0400 Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-4f86a7a5499so3305481e87.2 for <64188@debbugs.gnu.org>; Tue, 20 Jun 2023 00:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687247481; x=1689839481; 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=uliwPgGofx32KubgtxjpIsl6lux11rtd1cYIDTx20SE=; b=FOhxoa+xsYgrjtRf6zby6K7SBaaLK5iOcRCOkQCJJwFQFq+SthhhzuOF4Cv6v9XA0o k6Lgn+dmCp/Ze/5Bq/Tga2vo5iYIEwuY+j1OLl2jgAoh2VMs9DcKnqmUt1f0LzvVg7EV Vg3hY647PI8Gpdq8pkUAhkAGgDdhWVeVQqpUm83M+HEKE7WSb0pge9iC4UviE5HF4nd5 hNN/aaoUW+1S7OXEtdcKAEQpyhBB6lOuyA5GyqnHsCLafNnJmarzaBxk+xf4RbGXH6+2 XJbmnCU8B0ZEuliMmxvl5uc0OIj/rI/UTUJL63W3jP6WDA9QnanpjQRmXfrOSgdXd1KT 6fBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247481; x=1689839481; 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=uliwPgGofx32KubgtxjpIsl6lux11rtd1cYIDTx20SE=; b=FNM7lSG614ZqinhdEyQQ20GmgPDa02l126UQJ0cM2jyk6cqD5DXUMrcIuyG4HVweVF 0SPGpupBESg+iJpQS2GHWIxYKs4EqBNz1V6Y112E//RqpN2sB69PXPb21TPbkFg3m/Ua jsZrUdzgfU611VHCvDYAioOKhgn7wAu72XdaRxQk4JGGZAU5KMsM2kJ2wj16jF2xB+xz 0GjPfpa8GL2OloXh07poMK41Bf8z+zZMVTdOJlPAwaG2Oh9J2SAFca+t6IzBrJxlTjTm +0NCl5iSiqqo945Kc/zR/RminD7ierGCUhuYb8q2OSKaN/tevLVAw5uLBIuTgXW/yqgt 6Gow== X-Gm-Message-State: AC+VfDxbs8fEKxYUZy86v0uqnQWDcShzdq+6UWizW6UeRQ73JewXXaih vO2PoYix4HiHqz0goCAofxVPYkCYyfhZcKEh X-Google-Smtp-Source: ACHHUZ4sUQ4hpWvrvsNYBcEXJ9jI5/RdGot5P56iBFxpk8UepSvKgzxQOlWVC2uOQVHM3m8vWIGBLA== X-Received: by 2002:ac2:5f99:0:b0:4f8:6cad:aae7 with SMTP id r25-20020ac25f99000000b004f86cadaae7mr3399159lfe.61.1687247480681; Tue, 20 Jun 2023 00:51:20 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c469300b003f7f475c3bcsm22345002wmo.1.2023.06.20.00.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:51:19 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH 8/8] transformations: Allow autotuning for go packages. Date: Tue, 20 Jun 2023 10:51:09 +0300 Message-Id: <08188fe179fbbbe815ad75d39b14c6c8f6cca678.1687247150.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/transformations.scm (tuned-package)[build-system]: When the inherited package uses the go-build-system, use a generic micro-architecture. [arguments]: Adjust the 'set-microarchitecture phase for changes in the code. --- guix/transformations.scm | 50 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/guix/transformations.scm b/guix/transformations.scm index 47eb4b0515..122b0e74aa 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -33,7 +33,9 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) - #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) + #:autoload (guix cpu) (current-cpu + cpu->gcc-architecture + gcc-architecture->generic-architecture) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -568,16 +570,19 @@ (define (build-system-with-tuning-compiler bs micro-architecture) (define (tuned-package p micro-architecture) "Return package P tuned for MICRO-ARCHITECTURE." + (let ((generic-micro-arch (gcc-architecture->generic-architecture + micro-architecture))) (package (inherit p) (build-system - ;; The go compiler doesn't need to be wrapped. - ;; XXX: This is where we check for supported micro-architectures. - (if (eq? (build-system-name (package-build-system p)) - 'go) + ;; The go compiler doesn't need to be wrapped but we want the error + ;; checking to make sure we're targeting a recognized optimization target. + (build-system-with-tuning-compiler (package-build-system p) - (build-system-with-tuning-compiler (package-build-system p) - micro-architecture))) + (if (eq? (build-system-name (package-build-system p)) + 'go) + generic-micro-arch + micro-architecture))) (arguments ;; The machine building this package may or may not be able to run code ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are run for @@ -591,21 +596,20 @@ (define (tuned-package p micro-architecture) #~(modify-phases #$phases (add-after 'setup-go-environment 'set-microarchitecture (lambda _ - (let ((microarch #$micro-architecture)) - (cond - ((string-prefix? "arm" microarch) - (setenv "GOARM" (string-take-right microarch 1)) - (format #t "Setting GOARM to ~s." - (getenv "GOARM"))) - ((string-prefix? "powerpc" microarch) - (setenv "GOPPC64" microarch) - (format #t "Setting GOPPC64 to ~s." - (getenv "GOPPC64"))) - ((string-prefix? "x86_64" microarch) - (setenv "GOAMD" (string-take-right microarch 2)) - (format #t "Setting GOAMD to ~s.\n" - (getenv "GOAMD"))) - (else #t)))))) + (cond + ((string-prefix? "arm" #$generic-micro-arch) + (setenv "GOARM" (string-take-right #$generic-micro-arch 1)) + (format #t "Setting GOARM to ~s." + (getenv "GOARM"))) + ((string-prefix? "powerpc" #$generic-micro-arch) + (setenv "GOPPC64" #$generic-micro-arch) + (format #t "Setting GOPPC64 to ~s." + (getenv "GOPPC64"))) + ((string-prefix? "x86_64" #$generic-micro-arch) + (setenv "GOAMD" (string-take-right #$generic-micro-arch 2)) + (format #t "Setting GOAMD to ~s.\n" + (getenv "GOAMD"))) + (else #t))))) phases)))) (properties @@ -613,7 +617,7 @@ (define (tuned-package p micro-architecture) ;; Remove the 'tunable?' property so that 'package-tuning' does not ;; call 'tuned-package' again on this one. - ,@(alist-delete 'tunable? (package-properties p)))))) + ,@(alist-delete 'tunable? (package-properties p))))))) (define (tunable-package? package) "Return true if package PACKAGE is \"tunable\"--i.e., if tuning it for the -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 25 16:48:04 2023 Received: (at 64188) by debbugs.gnu.org; 25 Jun 2023 20:48:04 +0000 Received: from localhost ([127.0.0.1]:43730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWeR-0003et-Jy for submit@debbugs.gnu.org; Sun, 25 Jun 2023 16:48:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWeM-0003dT-3D for 64188@debbugs.gnu.org; Sun, 25 Jun 2023 16:48:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWeF-0001n3-QF; Sun, 25 Jun 2023 16:47:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=NYAtnOv09h3vFAZO4/0e2xF2mFDJ6pFgunka6sehDDI=; b=muJ4LEyEYQTE90Hbum1B y4onWjLz3AdpQmz3/gkKh7OH6jVCPrbKXRtGicWl6+aTqd7cCKm/4v5rzb4IZC2FdhXJMKQ9ToS8h KLgYrBBXOUebWwKCIvUW44cNbjIOBwsKLkIJvElha0sRYvZYFep4X3aUhW7PMSHztybp7kxjSAwLM sC5m+e26pkU7xG86RyG6U/qWMSEoy7Id9Ks4aCZeysbqwJX1rNPyRCNpF8jDg1SlsxBgp5/fbxEPM 9V7vkbe3FCsW1fHogRGMbbCm9BZeT+7qpdb6kBMbntkTJKlVy7JvrAH0E5sk5RACqMOPuhE1cc5eB 6j8MYARYnspszQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWeF-0001Cz-5a; Sun, 25 Jun 2023 16:47:51 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: [bug#64188] [PATCH 0/8] More package tuning References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Septidi 7 Messidor an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour du Concombre X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 25 Jun 2023 22:47:42 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 20 Jun 2023 10:48:46 +0300") Message-ID: <87bkh3z2tt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Efraim, Efraim Flashner skribis: > with gcc-11, gcc gained support for using -march=3Dx86_64-v{1,2,3,4}, > which I'm calling 'generic options,' as opposed to the more targeted > tuning we have with specific architectures. I don=E2=80=99t think these x86_64 psABI =E2=80=9Carchitecture levels=E2=80= =9D should be treated specially: =E2=80=A2 From the point of view of =E2=80=98--tune=E2=80=99, they=E2=80= =99re just another value that may be passed to =E2=80=98-march=E2=80=99. =E2=80=A2 My understanding is that those levels don=E2=80=99t match reali= ty: as discussed in the original =E2=80=98--tune=E2=80=99 patch=C2=B9, CPUs ac= tually produced don=E2=80=99t follow a pattern of strictly including features of one se= t. They=E2=80=99re really just a simplification to get more memorizable na= mes, but it=E2=80=99s hard to tell whether a given CPU really covers the set= of features of a given level. Overall, my take on this would be to add supported levels to =E2=80=98%gcc-11-x86_64-micro-architectures=E2=80=99 & co., without going f= urther. WDYT? =C2=B9 https://issues.guix.gnu.org/52283#0-lineno48 [...] > go cpu tuning targets: I mostly used the chart=C2=B9 on the go website, a= nd I > also checked the source code for go-1.18. I put in arm{5,6,7} as arm and > not armhf since armhf only works with armv7 and with go programs, since > they're statically linked, they can just be copied to other machines. Now if Go uses those names, (guix cpu) can provide helpers. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 25 16:50:12 2023 Received: (at 64188) by debbugs.gnu.org; 25 Jun 2023 20:50:12 +0000 Received: from localhost ([127.0.0.1]:43740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWgV-0003lJ-RZ for submit@debbugs.gnu.org; Sun, 25 Jun 2023 16:50:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWgU-0003l0-Ef for 64188@debbugs.gnu.org; Sun, 25 Jun 2023 16:50:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWgP-0002ML-1Z; Sun, 25 Jun 2023 16:50:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=PMDnsov4T7vr1/s8S1AKN++hKeTBRP5saiTlVqtlYTM=; b=XEyIJ7RDqb+9g8onCyLu zBd9cyUByRYCRzPfWU3aRCvX3+Bs4Ks84QfJI5Iagl8K4/iuyxrcZXcy7dZj8nek2Rw9ToznAjeK/ U235HXlkm4NS+PVhixdX4YQpeKTHodHW8RD7DeTPYbTgn7LtzsnaxP0ZbJHXfr007do01hk0Qn4vx Po43b58SjyU/nE8zIt184i4Pm0jFwFuLzl8kv2rmvyq3vh/W4FIv+nRjVn7wpPTmXAQY3icZmuQ7C ES0nv5QniikravuHuNp2s+gss+/kXVZWUNxjVAMnFgf3yWTjr9wtIF3ley0WsYImLEVpj9P1zIjJj wL8EwA4pbkgfgg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWgM-0001T3-VS; Sun, 25 Jun 2023 16:50:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: Date: Sun, 25 Jun 2023 22:49:56 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 20 Jun 2023 10:51:02 +0300") Message-ID: <877crrz2q3.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188 Cc: 64188@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Efraim Flashner skribis: > * gnu/packages/gcc.scm (%gcc-11-x86_64-micro-architectures): Add entries > for x86_64-v{1,2,3,4}. [...] > + "x86_64-v1" "x86_64-v2" "x86_64-v3" "x86_64-v4"))) ; Generic Nitpick: I=E2=80=99d call it =E2=80=9CpsABI micro-architecture levels=E2=80= =9D because I think that=E2=80=99s what the SysV psABI document calls them. Otherwise LGTM! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 25 16:52:29 2023 Received: (at 64188) by debbugs.gnu.org; 25 Jun 2023 20:52:29 +0000 Received: from localhost ([127.0.0.1]:43745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWij-0003oe-Bq for submit@debbugs.gnu.org; Sun, 25 Jun 2023 16:52:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWih-0003oP-Lj for 64188@debbugs.gnu.org; Sun, 25 Jun 2023 16:52:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWic-0002sF-3J; Sun, 25 Jun 2023 16:52:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=M1L32cT6ZaHKEJdfXR/jhULyibHCwF4GcerEhGF4BZI=; b=ZLAKmcDVDDBwoYuYtuLu iyWT30r/XB6ZJENiSNaK+TUA3vOki2WmtsxW9dNCukw4tng7wZio20D/vQC63dkxrnuoTu1nEerik PolXZfALyWwY8ouJJS7Y2jjTZZWyArhYR4Dv7vVj1RCx9ik/wLN76Z70/+DOuzC5ggg18CJl6vsT8 zgrYWdZWaHMMY2x5d1bXTZtoVt19QGqnVfv7mwcZPBxTCBycby6hDuntfLnOuCMLJpcP5GhL26JtN 6sN0/1JSPt8VOEkCfsyeUfEP1R0hCr8HkdMk3lukQpxLwScqGsnT9oQ1eH+S8Zeu/9u6NeUoIzDrZ DdEFKd+QNybQvQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWib-0001gq-LL; Sun, 25 Jun 2023 16:52:21 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: Date: Sun, 25 Jun 2023 22:52:14 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 20 Jun 2023 10:51:07 +0300") Message-ID: <87352fz2m9.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Efraim Flashner skribis: > * guix/transformations.scm (tuned-package)[build-system]: Don't replace > the build-system if inheriting from the go-build-system. > [arguments]: If using the go-build-system add a phase to set the > micro-architecture for Go. [...] > @@ -570,14 +571,42 @@ (define (tuned-package p micro-architecture) > (package > (inherit p) > (build-system > - (build-system-with-tuning-compiler (package-build-system p) > - micro-architecture)) > + ;; The go compiler doesn't need to be wrapped. > + ;; XXX: This is where we check for supported micro-architectures. > + (if (eq? (build-system-name (package-build-system p)) > + 'go) > + (package-build-system p) > + (build-system-with-tuning-compiler (package-build-system p) > + micro-architecture))) > (arguments > ;; The machine building this package may or may not be able to run = code > ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are r= un for > ;; the "baseline" variant anyway. > (substitute-keyword-arguments (package-arguments p) > - ((#:tests? _ #f) #f))) > + ((#:tests? _ #f) #f) > + ;; We add the tuning parameter after the default GO flags are set. > + ((#:phases phases '%standard-phases) > + (if (eq? (build-system-name (package-build-system p)) > + 'go) > + #~(modify-phases #$phases > + (add-after 'setup-go-environment 'set-microarchitecture Can we use the same approach as before with =E2=80=98build-system-with-tuning-compiler=E2=80=99? That seems more robus= t to me and it=E2=80=99d be more consistent. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 25 16:55:11 2023 Received: (at 64188) by debbugs.gnu.org; 25 Jun 2023 20:55:11 +0000 Received: from localhost ([127.0.0.1]:43750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWlK-0003sn-Vv for submit@debbugs.gnu.org; Sun, 25 Jun 2023 16:55:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDWlI-0003sW-6z for 64188@debbugs.gnu.org; Sun, 25 Jun 2023 16:55:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWlB-0003TE-82; Sun, 25 Jun 2023 16:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2vQ4I60dQ72I/miFOKr9b1+cIY9cnX9NejFZ7L0fStg=; b=I71PeuifrsYLaZaQc8AC Srrf+dpe2y+3WkDTPwreEWD+V4uIyYXVPrUtUiykWFQAL2NhwL08UgK8eHYOS//nDjwRnakG9jkII 8J8/MipswRWpz3FJbWADcLU6l8HkJv2wvxDppYmrju6Wwv5Wf91e8pjW1cGlj17MiMtRlAbXfLB/B uy/gBVRtX2FF7kX37mmq+o6d4jv4F3jIcV+kvV6jQueGvc0hGwUPtKL2XAI2Eyf/9TF5dP/C2IPbU fXneGlfmLeshbBD0tvviBeuJDSGAIQyOH9sBVg+Y2pmELGgDk6CLIDidNZxGbjoXjxfLforv0PO81 LGaoONm5KFqZBw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDWkv-0001tf-T3; Sun, 25 Jun 2023 16:54:58 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: <12026d29411b4ef0597d2f40d874ad2fcc49a087.1687247150.git.efraim@flashner.co.il> Date: Sun, 25 Jun 2023 22:54:38 +0200 In-Reply-To: <12026d29411b4ef0597d2f40d874ad2fcc49a087.1687247150.git.efraim@flashner.co.il> (Efraim Flashner's message of "Tue, 20 Jun 2023 10:51:08 +0300") Message-ID: <87y1k7xnxt.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Efraim Flashner skribis: > * guix/cpu.scm (gcc-architecture->generic-architecture): New variable. [...] > +(define (gcc-architecture->generic-architecture gcc-architecture) > + "Return a generalized micro-architecture, using an inexact matching to= provide > +'good enough' optimizations." > + (match gcc-architecture Let=E2=80=99s call it =E2=80=98gcc-architecture->micro-architecture-level= =E2=80=99, with a docstring that makes it=E2=80=99s clear that this is about x86_64 micro-architecture levels. Please also add a comment stating how to figure out what goes where so we can more easily keep it up-to-date. I guess this procedure is good enough for Go support, right? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 04:34:40 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 08:34:41 +0000 Received: from localhost ([127.0.0.1]:44403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgG-0000px-8b for submit@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:40 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:58580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgB-0000pd-Nb for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:39 -0400 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3fa9850bfd9so5018025e9.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 01:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687768470; x=1690360470; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=cXw5p1xY/vCxhn0hFFzXKc6RhA/Pt+6McItm98GWR7Y=; b=cTnqN3QDfBn7aCI4qgfs+OaBHoBTjQaMoZlTkWCfkNPjB82cwAv7B+8jbpGEamH2d6 0sx7bOyuxfRYRDbGcFCJql8mhGgQRYk+8NgWrwQVZxPJhCX6ddGYjkOhCRRWfnL45uJH 1qBXcUhVlT1rwMJOwX9cNiOOsEKbkQJ7HTlEv+0QG8aHp3hociCI3of0ghWBYtBCLqLU pZXoaf1TJsTnYAIV8sis69E6dUgptcy+IFU5CMprIOLzLa5sWIxzSN6RiPdBpkiDHurz ozKN8L5uhEItKUFAcOmbEek329E72Z+/deTMJEsVuWET0CPtCTtWHhffjM0AgVQu500u 0/Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687768470; x=1690360470; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cXw5p1xY/vCxhn0hFFzXKc6RhA/Pt+6McItm98GWR7Y=; b=XN1NS482GYwSRqyDgenX8Bo8Bgk0DkB4X6Nkh8O8kjMV+Ivzq2cgOxxoVZzSq/0GOq CQDfm9xVJZlSaZdXqVUjEvPndX2TuoChdrJPMoCgvOWAPXJNTRkhVXxM/WHFlF4UrgUp dnKjwduAKHoh0YF2QmhsvOLOLnNl1fcshtyJz88J45oAhRoSovtm5qPLSFFgIQwvT6s5 rPUwJgmLlaevmCjhPnbEsgc8IPx4L7hui9km/Lwffb9myGTKZc5+k+YLWDEDupSMlh5j JiQnZfiMngt+/y5dprkmApJDzlNl785cP2MUj9QJghKBTT6VVlWNnn3mpuCAIWhiwTK3 GXSw== X-Gm-Message-State: AC+VfDzckzPKXec3kQXCcDopRr4Xu2R+NcuUMKtXLJg7soMLBFJLjKya A/SAHLBsWXJN4bYBK5hohB0= X-Google-Smtp-Source: ACHHUZ7tXz1QshcDcnNyfDIjXO41bv24dJoZwzegyQkx9dbdNV+h7XR3CLiqL41eKxZeD+TJP0IgTA== X-Received: by 2002:a7b:cd89:0:b0:3fa:7991:52b3 with SMTP id y9-20020a7bcd89000000b003fa799152b3mr5951467wmj.5.1687768469599; Mon, 26 Jun 2023 01:34:29 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id k1-20020a05600c0b4100b003fa82210e7asm7028423wmr.14.2023.06.26.01.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 01:34:28 -0700 (PDT) Date: Mon, 26 Jun 2023 11:34:27 +0300 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#64188: [PATCH 0/8] More package tuning Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 64188@debbugs.gnu.org, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice References: <87352fz2m9.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oqbyHUEZ5rohXrvh" Content-Disposition: inline In-Reply-To: <87352fz2m9.fsf_-_@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --oqbyHUEZ5rohXrvh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 25, 2023 at 10:52:14PM +0200, Ludovic Court=C3=A8s wrote: > Efraim Flashner skribis: >=20 > > * guix/transformations.scm (tuned-package)[build-system]: Don't replace > > the build-system if inheriting from the go-build-system. > > [arguments]: If using the go-build-system add a phase to set the > > micro-architecture for Go. >=20 > [...] >=20 > > @@ -570,14 +571,42 @@ (define (tuned-package p micro-architecture) > > (package > > (inherit p) > > (build-system > > - (build-system-with-tuning-compiler (package-build-system p) > > - micro-architecture)) > > + ;; The go compiler doesn't need to be wrapped. > > + ;; XXX: This is where we check for supported micro-architectures. > > + (if (eq? (build-system-name (package-build-system p)) > > + 'go) > > + (package-build-system p) > > + (build-system-with-tuning-compiler (package-build-system p) > > + micro-architecture))) > > (arguments > > ;; The machine building this package may or may not be able to ru= n code > > ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are= run for > > ;; the "baseline" variant anyway. > > (substitute-keyword-arguments (package-arguments p) > > - ((#:tests? _ #f) #f))) > > + ((#:tests? _ #f) #f) > > + ;; We add the tuning parameter after the default GO flags are s= et. > > + ((#:phases phases '%standard-phases) > > + (if (eq? (build-system-name (package-build-system p)) > > + 'go) > > + #~(modify-phases #$phases > > + (add-after 'setup-go-environment 'set-microarchitecture >=20 > Can we use the same approach as before with > =E2=80=98build-system-with-tuning-compiler=E2=80=99? That seems more rob= ust to me and > it=E2=80=99d be more consistent. I'll look to see how to move this into build-system-with-tuning-compiler. I think I previously got hung-up on the tuning-compiler function which wouldn't work for go. At first glance it looks like I could just lift-and-shift the extra phase over. I'll just have to make sure that either it's only for the go-build-system or occurs sometime after the setup-go-environment phase but before/after a phase which exists in all build systems. Then it's the toss-up between leaving it as-is and only occurring with the go-build-system or also occurring on any tuned package which also has go code. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --oqbyHUEZ5rohXrvh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmSZTZAACgkQQarn3Mo9 g1GHxQ//cBUnVpVa4hjFh7MDmNLQb8ns9qu6MgkWr3Y1uwyO/QTY42N6yBsfm9or mn2zAfw0NFPNXPmjX3LHC1B5tJ1LKt4cHlK7N6YSu/geR7P921eLLdnYPG84/5JK WbcdlrhW17mj1FaC0vE5vDcOrPsFdKLO5L0qPSed4dS+QDGUq8PaxYcsN8Qw4EXj 62ql5JP6IDxmEY0BFuMN0bFXxvB7vnxdz6i57O1B7gVOdwj3HLL/5gLCovYhbAAk P+5mMocLuFuJF8PL1Dioz5dIdvVyGgjoKhqMoY5Ph9rdLhjeZCCLKYKCOniNOUlH AOsXoeg7gHD1ufi4J1FCTAzXRUNg8V/spJ1kxedJKk95Xvfsn+4HVDOtpOfTADcJ /wfHwAJXyAhRAbzV8UQOrvRalWNKxgpoyTe0JPewcJkYg3hvs9nJ764SDuDZO6ST LUxXvP23TbH9f+IYDQFkuIZ5bb9FJKc5pcyb4+6tkSo2FUgM2Pz5feWNTaTMKfg2 2Glg1qXnvwhOXCTeZIQW6cnOIBg6K5dDzPokct9DickuOHOb8G80n6cP4JO6yToN ZKbBJ21GyGzg2RW4ngRj5hMQGmq88ii447CBCrrkmSQ1+nDKGw3eGokQQnxygewW XCSxmkEAvoWeOQEJZ5oRMYpF6LN5jOAHmwg3cbjVsPMs9uMsxuY= =q4Dn -----END PGP SIGNATURE----- --oqbyHUEZ5rohXrvh-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 04:34:44 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 08:34:44 +0000 Received: from localhost ([127.0.0.1]:44406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgJ-0000qD-T1 for submit@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:44 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:45089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgG-0000pl-AO for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:40 -0400 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3fa96fd7a04so7808525e9.2 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 01:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687768474; x=1690360474; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=Jh4bHbnaivWy9+Xjp+BeWbtiuvYVaPCMWBmnGKac6wE=; b=FfOpvQEZcUzEBqVCwdpdJ7Mb3n0eEQ1z+LzVDnyr542kyRaYTDnPoxqG0l1SdZR3Zh 3N1xjP1u0AE2PF/Ol3PGv3s+QkXF9XPNOofLVZ6mri0VOsYv0bcBPLgJgPaWQKOlZu0J ksDjwXTj94FXciFmVEY0XNS5VPGi7ZB3wxyZLev92rCDL06vg4TvJIY/6XFKS61BwDif SFHvpAvAs66UQlGdOxjEnNCV7F4K5XpYABDT1qyf5xXvZ7hBeAch+9KYqrBIRBCV7d99 2wHdk5jlLOvsN43D+Ui/EnSW57iXjUTxGaRKDCn3zDDOZ3GSLo0r4ALoU15tem/iJuTt plhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687768474; x=1690360474; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jh4bHbnaivWy9+Xjp+BeWbtiuvYVaPCMWBmnGKac6wE=; b=SkqF4Mhdcjl69FnRgjLBW+b7VNB3QhOtBCKfNbkOkMg1kGLdn7KhXPfXsG8HtZ1WCT kgkFwg4Wpt4mNKrQVL7tpAFIRL64hJTxuDzaICp9zKVMrOnIIhpXDUu/Z9bJ2EyMAHQY F4kBy6//50iKHvvF2lw2x0KyA5PKlGK6S1oK/pMzCcruAXYcsXfN2kBEJVJrYGL6IETK BKilPd1sCShOVa8+qAfdLfzTRrzWCA8pASmKUF+SyOiK6cgixgWM7mbXUfai0BQC+XJg RoJLtlJWHb6j7GjFK6WepPATKwBbiVMN2pu5Z9vvbW0XhJcKAqAnng0kguuc3CL7tMFl 9wOQ== X-Gm-Message-State: AC+VfDxXZgLLg3sJv69ddJ5YJdlnHz0Z4gjNREJzPYR1n92bMNbb1H0i uz30JOSyEA+UzL1T3VG0bT8= X-Google-Smtp-Source: ACHHUZ71gLkEImj699XiwF648qt/bNNppCoJw6HYtVFD6O2NRzjlRz59rbbMf4Au5ev8MBRasBq4xQ== X-Received: by 2002:a05:600c:3647:b0:3fa:770b:366 with SMTP id y7-20020a05600c364700b003fa770b0366mr9568898wmq.27.1687768474434; Mon, 26 Jun 2023 01:34:34 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id m14-20020a7bca4e000000b003fa786b5195sm6912360wml.42.2023.06.26.01.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 01:34:33 -0700 (PDT) Date: Mon, 26 Jun 2023 11:34:32 +0300 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#64188: [PATCH 0/8] More package tuning Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 64188@debbugs.gnu.org, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice References: <12026d29411b4ef0597d2f40d874ad2fcc49a087.1687247150.git.efraim@flashner.co.il> <87y1k7xnxt.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Cq/edVlDIT5Ki3/b" Content-Disposition: inline In-Reply-To: <87y1k7xnxt.fsf_-_@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --Cq/edVlDIT5Ki3/b Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 25, 2023 at 10:54:38PM +0200, Ludovic Court=C3=A8s wrote: > Efraim Flashner skribis: >=20 > > * guix/cpu.scm (gcc-architecture->generic-architecture): New variable. >=20 > [...] >=20 > > +(define (gcc-architecture->generic-architecture gcc-architecture) > > + "Return a generalized micro-architecture, using an inexact matching = to provide > > +'good enough' optimizations." > > + (match gcc-architecture >=20 > Let=E2=80=99s call it =E2=80=98gcc-architecture->micro-architecture-level= =E2=80=99, with a > docstring that makes it=E2=80=99s clear that this is about x86_64 > micro-architecture levels. Sounds good to me. We can change the docstring if we end up adding support for more architectures (ie ppc64le). > Please also add a comment stating how to figure out what goes where so > we can more easily keep it up-to-date. >=20 > I guess this procedure is good enough for Go support, right? It would be better if we could populate x86_64-v4 and x86_64-v2, but I really didn't feel like I could comfortably draw the line anywhere and be sure I had the correct CPUs. If someone comes along and says they're sure their CPU should be in -v2 or -v4 then I/someone can check the gcc sources to make sure that's the case. I'm pretty sure there's other compilers out there that also use the psABI for tuning, my first look would be GHC. From my testing it does work for Go, and since we're using an official definition for the psABIs and not just Go's definitions I'm pretty confident it'll be useful for something else, somewhere. > Thanks, > Ludo=E2=80=99. Thanks for your review! --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --Cq/edVlDIT5Ki3/b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmSZTZgACgkQQarn3Mo9 g1GWeBAAldzyvWXXb2F38Vgkdu0r5LBX2ZZnnZM+nQbupDDlKEV0iq0xjU2RbPeq 6IyQ8H1D6uo3qpmpIz9FfNsjtySw6QiiLgW7TrjEUnWt5gW7YzPmAwCM4tTuHSxC SeiCGdii36E0CRXUbhfmDIrFCPjpRvuUxeFBGZu8Ow/jmbwV9htpdFO+RkX/gSEP ee0NOPsVu9wgiQH1B5H3/mIjR/K9ZIVvz7zLAUBroqwKOip0rxUNEvJeSHWoz6Sy Ymg9dRfJTPPj5vPiG9E+90cOxExc4VXCnYm0KUL8tAzU67GHoRVfMlhsbJHoSf1D ZB6ufvuqg+H8A/+ILgeb+MIeEmYJProgdOuqzupCGfJ4Wif/3J3j3p/cJgfy7FSI 1n5xXSI3dHzdDa5vOrlAVF0FUh4FwQYfV+D5VmNNKNwXiU5EnNtReQhBZvsCi/qx Epcrkb/0GAh8WySAx2ULBM7ps/G0r8Jsvgc+26muGra1B/l6UJ7EdE+hkdGkHo93 oex4v3aiK5VseFDPYr0f1FfyP7kZUAMX7eSh45RhUQ0fHD9ymsHb/zvWUi7vDoHJ gvcrNdxzFYV0DFWTcQQW8lbZjSxQfqXhMrfTStjWzzvMrsFg0EsVw+W74j50dPln o8MznsFsLcwf/zZCtsJMYEJYnCYPbwMo15GGqPI6X3Xi+ktSBJ4= =sfUe -----END PGP SIGNATURE----- --Cq/edVlDIT5Ki3/b-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 04:34:48 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 08:34:48 +0000 Received: from localhost ([127.0.0.1]:44409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgO-0000qV-7k for submit@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:48 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:55471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDhgL-0000pz-V4 for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 04:34:46 -0400 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3fa8cd4a113so7971365e9.2 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 01:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687768480; x=1690360480; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=pczAEbjlZWp4gvAgVryLprlxUDCQ+mG1nPUT2iBeNpo=; b=M3GSaJ082GfhYlvjy9VKjJ2N0XQ9sPZipl/r2k5epaOf3xHZD73m1rMGY2/brhsCBc +qJDlLXi15OJErfhn9yXh7BB9stQXarvFJOQR/MsT8Iq+xwOmP01xgEsitmMxDzDl55w wAN+aPN/FNr+qiUZQCCf1Cp5diyH4MoXRHZwlSM0XlYsFZtWiPd+A52ITBWX4msyZlkN 7kuHaOBKipAfehFaXE///GRoHFkmGhW7lXM4AWAk2or5NB9L55KOvUtLUUDYVwG38isN hBqaPRRMJmqvzcOBKOE+FB6p9umW26GiH1xiR4JTjU6f1nLG/OP20a77Xahv/Hw1PIBo HqsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687768480; x=1690360480; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pczAEbjlZWp4gvAgVryLprlxUDCQ+mG1nPUT2iBeNpo=; b=Cl4Uqhe+b9vujQ6Lt9ZcJEIlA22LWsH2Yo+5JxU/iHGG7YxYW/iI1tpE8ymkvqU9z0 8ReF1shfWgPKdngp8ND7oZZoH1DfoFENpGUAnAcqFy9nh1u0T6vL7dUsCe/Nazu+S/il DxcH2OxOJF/81y6N6/oYrUDAzqPeEqTWbDzyA8UKiQt9Ulg8C/7JpZ3x4zVewNhtVfBB hkLdolRSxKjMV0r5YQ36qTzLtCSV0XukzftzLFvmEMyeh2ppA6ec+LGBl5tLDNYT9J9K FSu31uvxDFpARTFWyC8JkkPUSgXwJlrDWy4g++9/87f5zAFvJ/c03O0MCAOR7gaM3JgP FrtA== X-Gm-Message-State: AC+VfDwfgmgXbSv33IbIDRYpcDZRUic2NGPhBSSyfhR8pAzDWK6voUVK QCwyHekTGGiZhiIGrBXo+Gk6G0f3OQJ9LA== X-Google-Smtp-Source: ACHHUZ45vjSEBRnWVc2Vb+gTnp+rra8mKhgcWr+utPKuyr25AaiRWNkngcZQZx4AEDwar6KG5lJfjA== X-Received: by 2002:a05:600c:2054:b0:3fb:973:fdba with SMTP id p20-20020a05600c205400b003fb0973fdbamr409960wmg.31.1687768480168; Mon, 26 Jun 2023 01:34:40 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id 4-20020a05600c228400b003f7e4d143cfsm6896255wmf.15.2023.06.26.01.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 01:34:39 -0700 (PDT) Date: Mon, 26 Jun 2023 11:34:38 +0300 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#64188] [PATCH 0/8] More package tuning Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 64188@debbugs.gnu.org, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice References: <87bkh3z2tt.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kaJcVTF42TWLJdwJ" Content-Disposition: inline In-Reply-To: <87bkh3z2tt.fsf@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --kaJcVTF42TWLJdwJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 25, 2023 at 10:47:42PM +0200, Ludovic Court=C3=A8s wrote: > Hello Efraim, >=20 > Efraim Flashner skribis: >=20 > > with gcc-11, gcc gained support for using -march=3Dx86_64-v{1,2,3,4}, > > which I'm calling 'generic options,' as opposed to the more targeted > > tuning we have with specific architectures. >=20 > I don=E2=80=99t think these x86_64 psABI =E2=80=9Carchitecture levels=E2= =80=9D should be treated > specially: >=20 > =E2=80=A2 From the point of view of =E2=80=98--tune=E2=80=99, they=E2= =80=99re just another value that > may be passed to =E2=80=98-march=E2=80=99. >=20 > =E2=80=A2 My understanding is that those levels don=E2=80=99t match rea= lity: as > discussed in the original =E2=80=98--tune=E2=80=99 patch=C2=B9, CPUs = actually produced > don=E2=80=99t follow a pattern of strictly including features of one = set. > They=E2=80=99re really just a simplification to get more memorizable = names, > but it=E2=80=99s hard to tell whether a given CPU really covers the s= et of > features of a given level. They're also useful for glibc-hwcaps, so that we could build each package multiple times and install libraries built for the psABI levels into $prefix/lib/glibc-hwcaps/x86-64-v[234]/, but I agree that, for our uses so far, they're not really useful. > Overall, my take on this would be to add supported levels to > =E2=80=98%gcc-11-x86_64-micro-architectures=E2=80=99 & co., without going= further. >=20 > WDYT? I could see keeping the code from cpu->generic-architecture (renamed cpu->psABI) either as a non-exported function or simply moved into the fallback for x86_64. > =C2=B9 https://issues.guix.gnu.org/52283#0-lineno48 >=20 > [...] >=20 > > go cpu tuning targets: I mostly used the chart=C2=B9 on the go website,= and I > > also checked the source code for go-1.18. I put in arm{5,6,7} as arm and > > not armhf since armhf only works with armv7 and with go programs, since > > they're statically linked, they can just be copied to other machines. >=20 > Now if Go uses those names, (guix cpu) can provide helpers. Go also uses power8 and power9 as PPC64(le) options, so that's also a possible use-case I was trying to also prepare for. That was my plan for the gcc-architecture->generic-architecture function, to allow for --tune to work without needing to pass different values to different packages. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --kaJcVTF42TWLJdwJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmSZTZ4ACgkQQarn3Mo9 g1HXfg/8CLljQpQQt7MxmsXDS5Fb6VGogEzjJ4RWl8C3HnDjBWOzMeV5GuUJFePk 3aIYGV8Wc+ouGl/nuB7by7/liWJGl83lpcCKJCPjc9XldAAN0+GghOmjtvKxZnjK 1a93atPpOD5SSuE59j6ZCFcIzXo7BTluVxqtzkkr/UqB1feRdqTSW4eS+JF9d6qG SHwvSDQvD1rVNf38z22kXA1FH0hQstagxY4r44m2vutvCCatqG8bk+vtnzvPjBiX 2jC4WuL527noyq3rTad4VULT6VasZwEnhqiri3KFm6C8SCczU1I7YEWz0Aoz8pqm OZO7afJeXXhrGQTxDwRdf+AvS/rim1OR/Sx6VCY6FaUC90ekMyjNUQwb/ex3cDxc DOSfcF7uwh0EdNXMc1S0okyo0W+1yYSaPydpQX3ZapxUYubDwroI2TuHcgc5ZQmU F3T8yOW1Ww74Au8OyqvBfWFqPjTO0V2tvE/SIHE8qZNM18RYiAypz1JnFfqHiz8e eunMgJw+HpPbst7FNAA2iem/L/VCPnGwll4CJokrXi51PhKPLj93cJXp0I5v0FSz GzigcWSnCMYsixKuAMoRFk9n1FtU7/Maounu2pl8nsuGr+OGCvNAqB++aKr5IYmW ITxc0YemCnKM4nacFpLOFiJ2UbfwkjnwD7axHfMwYuTIivMcdm0= =sNUj -----END PGP SIGNATURE----- --kaJcVTF42TWLJdwJ-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:06 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:06 +0000 Received: from localhost ([127.0.0.1]:44752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUn-0004F4-JF for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:05 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:50555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUk-0004EN-GR for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:03 -0400 Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-4fb7589b187so1213823e87.1 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783136; x=1690375136; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=pVRy+mX+iZOOhOOaHf+b20/lVwBFoaKAZLCmFHg+RzU=; b=bSXnqrkUWhNXaSY/4IkILIYBkBCBXz12oE90kddV/8ugloirOYUxU184x3fFIIAu1W uwbKrrJXvItE2QgDU4iCxg+GvhS1N80NVNFPMItwCy/KCQMsos37dBKmTOMpmAOl4qpw neUSEmkINhwm5cuS+UYexkNtSGs5EJ/xHcPIZDbCUCuu583FEe3bvSmZ7uPqwdjB0PZo fxOBUjKdk8oa/t7XCvUMihoIYcFC51v6msjBhYpREQ0vJAETkYQapAohQhlNjsQyV4L/ 7kG3X5v1yb+6q6Xev27n+cRP1fU+fMPs4CN44Tn6kdtZSxcjCA3ehmC224/PmzHjcffD Ww5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783136; x=1690375136; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pVRy+mX+iZOOhOOaHf+b20/lVwBFoaKAZLCmFHg+RzU=; b=CcSjMHysKoAygVw3Hsp4fkf2e8VIugokS4uaLOBMWZ8Job+Gj5F2tmb768yvJuzBFP O0H1XWU7F8ytj1yvdPwq7Si5iVk8x/eh+IUPh2e9GAlNC4/IO434ySLvTKoB6YOcLIrJ F4hvGiWxU5Ul62FhKrefe8a+rP0d/s516rUT3K/9LYQ9E83ct7bicqaG35ViDO+cN96l gFVR0fLv1squ3ujH5BrAfW2cJXaZqTQD0IgA2aBYIaup2itQ0GEoIM2JM4KJIy99F6Ne 8kO8QEo2hQIh4+x8uVbOBjRnQ5/W7TBGTK/oJinIO1GDrSB+dYgBbgi1j0coOHIUTSMS 35XQ== X-Gm-Message-State: AC+VfDyL02yFSkOFhA+vM5eJAKTgPUnw9NoIFoNBznSisRSVTSbJwN7I X0A9ebhMC7BPo9eg5ozKMfplLSiNLtkRPw== X-Google-Smtp-Source: ACHHUZ6KkJa22R38+l5iwQ4bcl4+2xU6RxRyjLjyLbAFCNG7HMrtJq4V25APWj4zKFRrWYqMhXW3Tw== X-Received: by 2002:a05:6512:3a8a:b0:4fb:7381:4c69 with SMTP id q10-20020a0565123a8a00b004fb73814c69mr2116428lfu.28.1687783135995; Mon, 26 Jun 2023 05:38:55 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id u8-20020a05600c00c800b003f70a7b4537sm10510563wmm.36.2023.06.26.05.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:38:55 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 0/7] More package tuning Date: Mon, 26 Jun 2023 15:38:36 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) I hope I've addressed the comments with this patch series. I've changed the language to use psabi or to refer to 'generalized optimizations'. The go adaptations for tuning are now part of build-system-with-tuning-compiler, with an adjustment made to (also) check the psabi listing when it comes to the go compiler. Efraim Flashner (7): gnu: %gcc-11-x86_64-micro-architectures: Add psabi entries. guix: cpu: Add generalized CPU matching. guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture. guix: cpu: Refactor cpu->gcc-architecture. guix: cpu: Add gcc-architecture->micro-architecture-level mapping. gnu: go: Add CPU tuning targets. transformations: Allow tuning go packages. gnu/packages/gcc.scm | 5 +- gnu/packages/golang.scm | 23 ++++++- guix/cpu.scm | 130 ++++++++++++++++++++++----------------- guix/transformations.scm | 37 +++++++++-- 4 files changed, 133 insertions(+), 62 deletions(-) base-commit: e85593b36b3874227ba812f47113441928c0f0c1 -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:06 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:06 +0000 Received: from localhost ([127.0.0.1]:44755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUo-0004F8-0n for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:06 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:54387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUl-0004ES-Rw for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:04 -0400 Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3112f5ab0b1so2798277f8f.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783138; x=1690375138; 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=y0/9ENgcoLtQLw34XxIld3+BcmNNGwYVTxELI04+qo8=; b=F7YFeo4QUyH8YjhcwPDZ0uB1nUwUdjliKPx7vAu7sVHqTUJGfjQi5sRs4tVcJho/AY JOKSOuQBl7eu3v1FkHnNOS0Z0kvOrr8yH+ZaLxNw4nE+Zs1qwYi/5AdYJVWGm+LyzSie 18GZWTV4D7F2ThHpFByUSJL0MgUuCkUWKkUFx4sBq2LWO5onaLHe740dASYzrTqPB1xx Wjn//kMDQCxNR9QVhh5Ln8rfafjzQsCfRc9uPcWLEnVTY2g78neOC4QFrJHkfKAqBwE9 d9AsBIW7NQT6WTXhyj6K1+6WNBidC6FvgJxVeT7xSLU54cs9Q3brcyzU/T1P5Ruxetwn Sc5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783138; x=1690375138; 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=y0/9ENgcoLtQLw34XxIld3+BcmNNGwYVTxELI04+qo8=; b=WcOqoWcd7ctsZW0jSjDq9Ft1b+9/DKALSxyHvfBEcb/0yam8mB/i2Ap88MrDkwBh7s RArmll3qKaYat1z807tZlnlqM/o61TTLxqpjmZ1Je85Ug2bF4TfmDyFAq2dNxcM5XfwP /42YVuFycis3NMkhn8eyZK9+3m76oaUUa/d2MRXVeRLVfE3zaQkWIdaUt4ecN1izNopM yLVmSUBTiBs1mrhiXWA8wBHaUyWgJMChlvgbvRB7da5eCEn5+kIOwWkq//kisTpC5uZk EfUCaBEJYAFo+wQi0zwHVDo3FCv+Z2/Q1kxjNWHyVtkFgVeofTW6T9fw3nDJeeOQzD2N BJGA== X-Gm-Message-State: AC+VfDyYtt9hUnM4kPUtf6OHVfEKhV2eIcMV977dI2hxZahZkq8cqgYw bBl/mxTgq38ck2C0SHeqvBwYTrmFMVgoBg== X-Google-Smtp-Source: ACHHUZ6O98vbb4S1E8ayHFEDV2puhs0MMiY67qm/zJxRedcV773A7oysSO0/2wvFDG7s0OTNqNv2Gw== X-Received: by 2002:a5d:608f:0:b0:313:f157:7d56 with SMTP id w15-20020a5d608f000000b00313f1577d56mr1623437wrt.30.1687783137933; Mon, 26 Jun 2023 05:38:57 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id u15-20020a5d6acf000000b003111fd2e33dsm7243909wrw.30.2023.06.26.05.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:38:57 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 1/7] gnu: %gcc-11-x86_64-micro-architectures: Add psabi entries. Date: Mon, 26 Jun 2023 15:38:37 +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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * gnu/packages/gcc.scm (%gcc-11-x86_64-micro-architectures): Add entries for x86_64-v{1,2,3,4}. --- gnu/packages/gcc.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 1b444c2b02..862fdd79c3 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -614,7 +614,10 @@ (define %gcc-11-x86_64-micro-architectures (append %gcc-10-x86_64-micro-architectures '("sapphirerapids" "alterlake" "rocketlake" ;Intel - "btver1" "btver2"))) ;AMD + "btver1" "btver2" ;AMD + + ;; psABI micro-architecture levels + "x86_64-v1" "x86_64-v2" "x86_64-v3" "x86_64-v4"))) ;; Suitable '-march' values for GCC 12. (define %gcc-12-aarch64-micro-architectures -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:12 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:12 +0000 Received: from localhost ([127.0.0.1]:44760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUu-0004Fn-DN for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:12 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:48247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUn-0004EV-Ph for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:06 -0400 Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-4f86dbce369so4158064e87.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783140; x=1690375140; 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=CXBRcMEcNe1ySkaWYCr/u8mNOd3kmsx59TQ9m6l9814=; b=W5/SMplaOd6C7EBlEIMyTTIFOZHwM7+AaAkm1RbzPjicxmdiHFaGAX+xvdjkjxa4zv NQ1ZxKPv1pL6LFwTpU5dQsO+eO46siXqkDbMIL2d87rOwnKIP5gFN5cVVDL+L72UxOON 2410RdSuq9uIiuSW7exjl7NeQTcw6dGgHo0WYPT5fIQQCx+Em9E+CnstUICrREx+H+ml NkObDCeyP2CQO3/FkDin5xhas91f7BfPYNxcehB2N3XjxtUnzHox0p8NdAJYvW+wTJJs lZo0S25H2abndtce/3T41oYJdyRbjvoIeUummWVBZd4lmatzzFFwLQYc+DYFUAnylPQx 0QHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783140; x=1690375140; 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=CXBRcMEcNe1ySkaWYCr/u8mNOd3kmsx59TQ9m6l9814=; b=b9/1yNv+UxbDuC8kN8I7D6HbdvO6WUtIKkW3oUzLFItM/Mxr8d140Dq0Xm0AnMYjCz 62JYSt00KiWk4u+jfGpoOFRPHS9fWWcNJneSYAB/u8v32vJ6PqJe8GZ3zbVYryUcv/yi j3YD+wd7CdcoFpZNPOVdIupkDWW/JBFDarz6bfiWMgFCWyMQZFUOdzvtTlCrLCD4gQ0D 2f6nE0tRYSgtKBOZhO0jEezXS4dHUikNgLKajkfmu4VgSvVJJVf4YffA2eYolKv7a74y /YsLsPMz95Oe4rOxab9DCavN2M6dxyZhgUMiQh0wg+Mmovjxp4Me83ADAToJcXv05luy tJgw== X-Gm-Message-State: AC+VfDxb4ciI4cWdUbDaVawMu+yNbhRNauxO+nJ+dxkNoCbNgLtTiZND 8Y0+AOw3/Ztk3j/b9qcktvMyQLnOhUSu1w== X-Google-Smtp-Source: ACHHUZ6/lx9TjRlfrj9Kh9axDestorK5vIJoWpJ9qek15aLt3SpK2tAUNC5QfWC1H/lyh/P4OM1xZQ== X-Received: by 2002:a19:7b06:0:b0:4f3:a051:58df with SMTP id w6-20020a197b06000000b004f3a05158dfmr16387854lfc.59.1687783139781; Mon, 26 Jun 2023 05:38:59 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f90a604885sm7598171wma.34.2023.06.26.05.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:38:59 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 2/7] guix: cpu: Add generalized CPU matching. Date: Mon, 26 Jun 2023 15:38:38 +0300 Message-Id: <7bd5d1f49f921827954ff0373121a52c0cbc0ad6.1687781377.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->micro-architecture-level): New variable. --- guix/cpu.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/guix/cpu.scm b/guix/cpu.scm index 45e1abeed7..3fc12327ed 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -285,3 +285,36 @@ (define (cpu->gcc-architecture cpu) (architecture ;; TODO: More architectures architecture))) + +(define (cpu->micro-architecture-level cpu) + "Return a micro-architecture name, suitable for generalized optimizations that +correspond roughly to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + (or (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + + (if-flags + ;; https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex + ;; v4: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL + ;; v3: AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, OSXSAVE + ;; 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") + ("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")) + (architecture + ;; TODO: More architectures + 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:13 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:13 +0000 Received: from localhost ([127.0.0.1]:44762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUu-0004Fr-QI for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:13 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:46162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUp-0004Eo-KO for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:08 -0400 Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-4f957a45b10so3990141e87.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783142; x=1690375142; 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=Q3SrNB3/9BknWXrVXQY1Lo9YB8E8g/DrbnvvbG6ob7w=; b=l+Xq46yrqW1kFcI2yxrg6goPt5HxGJusMUJYK+fYwDdjtk3xrY9zb7Tel72gVKJxDh O8MP92BthQjFgkPoegtPE1ZHmB8QFzOuEls5732Mak/jjZ0bpJPjxHX361TukoGPeoNb hOP/Z4D0+7mfhHBEzglJZHR83Davtivw2jRe/vLsXSdnekrdJBdsqr65G4IftDQz7qIU cAVqm62eCeDPed1yOx5/E20LohodDgRM5eA66/wyxXFeXnzEBTBcXOqQhsWuwp5Mlzow EV5qRhlYju+5HqNATqeEr4cBll7+IsHslKfWo8XgatSdYFYOAUVlfNrDgetIZbYG1zKT PFAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783142; x=1690375142; 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=Q3SrNB3/9BknWXrVXQY1Lo9YB8E8g/DrbnvvbG6ob7w=; b=lPNkg8dQs22qEpPJw9fx9S/Jf2CsI2xV1TQ7ONLDZZbbUN0at3Tet/IOj6r45texvb JRpjT4hhZyrk+ADGtpbNCelagHu3GBBQ64ufWsE4tTh8LhEiJBm0zeXlBIksRlIMZLKB F0/q35LviWFLyszzc7Rrx7eoWVQOdgnEwWc4UYNOEnd/ssdmeq9IjPnzJifW7yXBZqRO jyV+RSU56EqU5FqogbdtNdLP4D/pSzMLmiQHzYY0TTe6WddKYnaqNnJh/zIHsP1ZIldc Kw1W27tar/7q3fqkfFBOPrF6urvUOp2efOkLItFPz8txI2gFntIOdjTNq2lSQkSGJedc KRcw== X-Gm-Message-State: AC+VfDw5Nrcxtrph0OjnP3C45I18vnKy+lMBn8ZsV6MtleMu0TuViC4O Eb98I6VqY/UJXy7AQYumT1cJKfZOmTmRrA== X-Google-Smtp-Source: ACHHUZ6dN7rxn4nRHGKrbLaCdqr7ZzbAcdorsG2oeLpiOCa4Vr99JWJ/imABCTdOffzIz+aEPJBm3A== X-Received: by 2002:a05:6512:2314:b0:4fa:21d4:b3ca with SMTP id o20-20020a056512231400b004fa21d4b3camr2744761lfu.2.1687783141645; Mon, 26 Jun 2023 05:39:01 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f9b24cf881sm10515134wma.16.2023.06.26.05.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:39:01 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 3/7] guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture. Date: Mon, 26 Jun 2023 15:38:39 +0300 Message-Id: <4a54a8434bd741fb7bf2d3067fd8dcec106b3ece.1687781377.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->gcc-architecture): Adjust the fallback case to use cpu->micro-architecture-level. --- guix/cpu.scm | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index 3fc12327ed..1a75b8ac62 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -209,21 +209,7 @@ (define (cpu->gcc-architecture cpu) (if (and (= 7 (cpu-family cpu)) (= #x3b (cpu-model cpu))) "lujiazui" - (if-flags ("avx512" => "knl") - ("adx" => "broadwell") - ("avx2" => "haswell") - ;; TODO: tigerlake, cooperlake, etc. - ("avx" => "sandybridge") - ("sse4_2" "gfni" => "tremont") - ("sse4_2" "sgx" => "goldmont-plus") - ("sse4_2" "xsave" => "goldmont") - ("sse4_2" "movbe" => "silvermont") - ("sse4_2" => "nehalem") - ("ssse3" "movbe" => "bonnell") - ("ssse3" "sse3" "longmode" => "nocona") - ("ssse3" "sse3" "lm" => "nocona") - ("ssse3" "sse3" => "prescott") - ("ssse3" => "core2")))) + (cpu->micro-architecture-level cpu)) ;; TODO: Recognize CENTAUR/CYRIX/NSC? -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:14 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:14 +0000 Received: from localhost ([127.0.0.1]:44765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUv-0004Fy-8f for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:13 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:42052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUr-0004Ew-5D for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:09 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-31297125334so2742760f8f.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783143; x=1690375143; 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=E2lA4qQUapcvjg38AXDXp4wACqRJI5uJ52nAKM4GHYo=; b=X1Hf++xP5IdxGMgIv6bXE31WLq+hsRcaBYcvIfA8EK5wWRDz9qCXmbxufUHTykSpRS 6EY2Y+Tz8OASnoO/ubB5zRBW61Qpm+2ZLtmqBK8+NOm7FrX5L5E5xVfoGkLGZrY32Eps jwmpv1GyYfnJHqzy2AlnJL7/XsYkXGS5L2QkzxuxmHV9xNyogo2SNhHRwITkx4g+KoFQ kBa5drTqtdzp9ITGdsDyWJmP31T9ytTT7uAL9ov5C4SpkoR5tmK6CiZrW1HHvPjkbP8k QD1cWDu1pq6qR/mYNFiYpjFOkx+VxWRX0dYrHX7PL1rXQGBGBKgP0PfFKTIuGyS0LGNm 6fIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783143; x=1690375143; 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=E2lA4qQUapcvjg38AXDXp4wACqRJI5uJ52nAKM4GHYo=; b=ie+4b9lKIvmhRoOVJEDlHU0Tu6J6PPX9y0NoQw0WsKJrFqV61uVn/y0xeWhbo6KqCh +PBis+G4xGhg207D2Yt406dmargpIkZruRVZFIyHrlWjRjcillRJv0rox+TZMgcDjDVr lKXrNE/sesQdY5QXP/1+/gJwoMSD1IM0DTFW+Najp8aW+3e0UZFeZNFUUPLVfSp5jFFI bZfv/Agl6CcdBBiGgsdXeC7qM3vA7lPkc2EQR1X0u1srUp/q1cjmroQFF8GPssKsxcoe Njlp4V5nhuUO1w+xphdmo2MNWE5cIJxIiWZTw3IO3Oy7D41mCGGDbzA9S4UNOpa+PQCa 8iEg== X-Gm-Message-State: AC+VfDzU95jPNzYUjrztxn1p2+FgnNSJRJWcY4qsd3mERJSsFABP6mp3 hwOKLzjtgD2MF5J5Th5rqiq5FlHBGCVGvw== X-Google-Smtp-Source: ACHHUZ4GKPNrmGJLk3rxSAfYA6W1e98LV9dYoRtv09kiY4D2R5C7UUMyEMW0l4GpYdsl0Pj+l3aaLw== X-Received: by 2002:a5d:480c:0:b0:311:5b9:9d58 with SMTP id l12-20020a5d480c000000b0031105b99d58mr25387590wrq.16.1687783143507; Mon, 26 Jun 2023 05:39:03 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id e10-20020a056000194a00b0031134bcdacdsm7297974wry.42.2023.06.26.05.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:39:03 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 4/7] guix: cpu: Refactor cpu->gcc-architecture. Date: Mon, 26 Jun 2023 15:38:40 +0300 Message-Id: <0e756812e63220f9f5bc17169713b80281806dbe.1687781377.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/cpu.scm (cpu->gcc-architecture): Refactor to wrap all the x86_64 options inside a common letrec-syntax. --- guix/cpu.scm | 57 +++++++++++++++++----------------------------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/guix/cpu.scm b/guix/cpu.scm index 1a75b8ac62..30cd860a19 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -114,19 +114,19 @@ (define (cpu->gcc-architecture cpu) (match (cpu-architecture cpu) ("x86_64" ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.cc. - (or (and (equal? "GenuineIntel" (cpu-vendor cpu)) - (= 6 (cpu-family cpu)) ;the "Pentium Pro" family - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (or (and (equal? "GenuineIntel" (cpu-vendor cpu)) + (= 6 (cpu-family cpu)) ;the "Pentium Pro" family (if-flags ("avx" "raoint" => "grandridge") ("avx" "amx_fp16" => "graniterapids") ("avx" "avxvnniint8" => "sierraforest") @@ -152,20 +152,9 @@ (define (cpu->gcc-architecture cpu) ("ssse3" "movbe" => "bonnell") ("ssse3" => "core2") ("longmode" => "x86-64") - ("lm" => "x86-64")))) - - (and (equal? "AuthenticAMD" (cpu-vendor cpu)) - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + ("lm" => "x86-64"))) + (and (equal? "AuthenticAMD" (cpu-vendor cpu)) (or (and (= 22 (cpu-family cpu)) (if-flags ("movbe" => "btver2"))) (and (= 6 (cpu-family cpu)) @@ -192,20 +181,10 @@ (define (cpu->gcc-architecture cpu) ("lm" => "k8") ("mmx" "3dnow" => "k6-3") ("mmx" => "k6") - (_ => "pentium"))))) + (_ => "pentium")))) - ;; Fallback case for non-Intel processors or for Intel processors not - ;; recognized above. - (letrec-syntax ((if-flags (syntax-rules (=>) - ((_) - #f) - ((_ (flags ... => name) rest ...) - (if (every (lambda (flag) - (set-contains? (cpu-flags cpu) - flag)) - '(flags ...)) - name - (if-flags rest ...)))))) + ;; Fallback case for non-Intel processors or for processors not + ;; recognized above. (if (and (= 7 (cpu-family cpu)) (= #x3b (cpu-model cpu))) "lujiazui" @@ -213,7 +192,7 @@ (define (cpu->gcc-architecture cpu) ;; TODO: Recognize CENTAUR/CYRIX/NSC? - "x86_64")) + "x86_64"))) ("aarch64" ;; Transcribed from GCC's list of aarch64 processors in aarch64-cores.def ;; What to do with big.LITTLE cores? -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:14 2023 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 To: 64188@debbugs.gnu.org Subject: [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-architecture-level mapping. 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 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:24 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:24 +0000 Received: from localhost ([127.0.0.1]:44770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlV5-0004Gb-E2 for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:23 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:56495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUu-0004FR-NN for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:13 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-311099fac92so4490400f8f.0 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783147; x=1690375147; 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=QArB61ZaBlsKH9o7v20L+XAb6dBHB5LI03AapNzQ+Kw=; b=ToHq65mWgJJlNsX6Dp8yBVAG0yBp2EQzexoy6ut3qLzd0UeZN63A6d4R6Pvf6ndPQJ H7zB0krQ3R9PXN8CcWPWwyBHjzbxcKcVHoIazLhpPiLpuLRP/UXyS+f9O8wLnDlqfgGs UhBkoqTBp6QmGKpA+rjVTwNuC7PYllPRt9rGniqzRL5KENpwaEvPoqjSH370PraUDMvU k+4UjHtnT9IFqtn7+8FpC7dunKltnyCKk1JlKqJIhaugP8PhtgEgPK9RRf31Z5R67ioQ iBqprIkCn15UAuSOnchXDQ52v5jUuYxQINzu1NAbElU0Jgi/7xHW7vRbszS13bGbhjht 2XJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783147; x=1690375147; 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=QArB61ZaBlsKH9o7v20L+XAb6dBHB5LI03AapNzQ+Kw=; b=Y9lqmF07X1FKgeEp0nk5SndyU3L6HbIJEQ2weDOd3y22KMk99/YYcTG95mWArMfMKk rwsQ4yd8JkDSYH57dkI+NxirVVzPc6XW6dOtegdhFoPSiW8/N2N+ZY769Si4ogP8Rox8 WKZ4lIx9oMUD041JhwywRx22EnX9jHcvDHNYjL7v72wb1Rc20ftuAZKFMmTWAP126dR6 1wGrE1R3D+fvRWF8ncnU2vwRcfgkYfcFR4IxnKjDMfyKyYkYXodxbGk7rxZKW5UFfZ+l v+tMERef7gzH++hEmddZDmbO5mKju1bexv/ljvkPpVep/fLlr9SiFuDajvCwc/yfW2Qj O6Tg== X-Gm-Message-State: AC+VfDz9q1ead3YIkgU27VmoivAJYyVeRpTgsYXa+S40dxcMiVHhtLz+ yw4FoRrHwRdrzRWi/VhMje4yPMsrYGq0lg== X-Google-Smtp-Source: ACHHUZ7KDpfWdCj7VXWMU91lMs4qmAYILT3yOjTNmrG6jLT1xRCDlYegeoagNIGb+lC7/3Vr//Hiaw== X-Received: by 2002:adf:df82:0:b0:313:e20c:b8e0 with SMTP id z2-20020adfdf82000000b00313e20cb8e0mr6084280wrl.23.1687783147122; Mon, 26 Jun 2023 05:39:07 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id u14-20020adfdb8e000000b003112ab916cdsm7380079wri.73.2023.06.26.05.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:39:06 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 6/7] gnu: go: Add CPU tuning targets. Date: Mon, 26 Jun 2023 15:38:42 +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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * gnu/packages/golang.scm (go-1.17)[properties]: New field. (%go-1.17-arm-micro-architectures, %go-1.17-powerpc64le-micro-architectures, %go-1.18-x86_64-micro-architectures): New variables. (go-1.18)[properties]: New field. --- gnu/packages/golang.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index e4c4cb299b..55cc40dda5 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -628,6 +628,13 @@ (define-public go-1.16 `(("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch")) ,@(package-native-inputs go-1.14))))) +;; https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support +(define %go-1.17-arm-micro-architectures + (list "armv5" "armv6" "armv7")) + +(define %go-1.17-powerpc64le-micro-architectures + (list "power8" "power9")) + (define-public go-1.17 (package (inherit go-1.16) @@ -844,7 +851,14 @@ (define-public go-1.17 "README.md" "SECURITY.md")))))))) (inputs (if (not (or (target-arm?) (target-ppc64le?))) (alist-delete "gcc:lib" (package-inputs go-1.16)) - (package-inputs go-1.16))))) + (package-inputs go-1.16))) + (properties + `((compiler-cpu-architectures + ("armhf" ,@%go-1.17-arm-micro-architectures) + ("powerpc64le" ,@%go-1.17-powerpc64le-micro-architectures)))))) + +(define %go-1.18-x86_64-micro-architectures + (list "x86_64-v1" "x86_64-v2" "x86_64-v3" "x86_64-v4")) (define-public go-1.18 (package @@ -887,7 +901,12 @@ (define-public go-1.18 "ldflags, err := setextld(ldflags, compiler)\n" "ldflags = append(ldflags, \"-r\")\n" "ldflags = append(ldflags, \"" gcclib "\")\n"))))))) - '()))))))) + '()))))) + (properties + `((compiler-cpu-architectures + ("armhf" ,@%go-1.17-arm-micro-architectures) + ("powerpc64le" ,@%go-1.17-powerpc64le-micro-architectures) + ("x86_64" ,@%go-1.18-x86_64-micro-architectures)))))) (define-public go-1.19 (package -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 08:39:24 2023 Received: (at 64188) by debbugs.gnu.org; 26 Jun 2023 12:39:24 +0000 Received: from localhost ([127.0.0.1]:44772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlV6-0004Gf-0v for submit@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:24 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:44404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDlUw-0004FZ-WB for 64188@debbugs.gnu.org; Mon, 26 Jun 2023 08:39:16 -0400 Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3f9c88ac077so41425995e9.1 for <64188@debbugs.gnu.org>; Mon, 26 Jun 2023 05:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687783149; x=1690375149; 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=LwwwmFpvBIVIQtMswvyyZ/l54M3FmQmhCc8uvh4HwKQ=; b=cNqi6EQ+EjpT7nfyvz6SJvbVomnel9zomIW7We+5DbC2C0N/sWn4f+RtCJ5rbQnWsM RWzx1hH2kJVe3nrL2QGAgJ5Fo3QNrUiKFYQzJtVQlbPBXhw0axXpkuo295iriUcCzzKT YSpNcfW9EDISkIB4/wx5OdBSb1i3Rpqhfo9PcN5oMOAIhIpoEAS60Uzn7en6jtVjCsk9 /fG6G/g51OVx8yd8zbwI7mEo9i59MUDZf9nf8SBNgWk6ecZhYIPS8fn1IuacSPisLR6G 83NVzRD8jYrsA30wkDzFTb2jD14jlA988y5a6p9v7+VMc4WkdUQ6s7BFRI/3bPy2q/AM LnKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687783149; x=1690375149; 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=LwwwmFpvBIVIQtMswvyyZ/l54M3FmQmhCc8uvh4HwKQ=; b=jDjbOyxwwuBw8HKgYGwDm6MoxrcaBJlja02icgi5sK5miBIg79b+Ozx4Lez1Oqyb0a qiLIC/Ewydz2UCAJH3a3KlmmYEWXA3jpBRj5wfoMvOA11Ku02MT8MPpjHqiF/TX2fiel gi6NUgo1G14+iClSvF9PzUYI4822L1rcjh1mIANYA6YxX2v+BG4nemcAl3CS9VZecisC N04wx5XPv8oO7wrFZEzaLjRik9NpM3OSkJHjt4SuEPq1hIcTAexGFtLE6NemothLwhWI JQLoP7X7jCJxENSX3c+L/x1iRBAGfhQkpwR46Uv5l+Nw3+g1YCBsfTr9DPnhhlt7NY/t 0pow== X-Gm-Message-State: AC+VfDxV7Um/lXmjoYN0PkYbUktR0+LMLX5qmswnMcH1zcp6HmPyVboh cPeaQdypOFpBL5aA/QlQduIpAKgo031PFg== X-Google-Smtp-Source: ACHHUZ6ZwC4qkP/idR54wraMKv6S+lEzBbNFztc0utt8snU6QFGiYZqmfvmADYh0yAEj5TN1jdE2ZQ== X-Received: by 2002:a05:600c:231a:b0:3f9:b430:199b with SMTP id 26-20020a05600c231a00b003f9b430199bmr16149326wmo.15.1687783149085; Mon, 26 Jun 2023 05:39:09 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id j9-20020a5d4649000000b0030aefa3a957sm7284253wrs.28.2023.06.26.05.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:39:08 -0700 (PDT) From: Efraim Flashner To: 64188@debbugs.gnu.org Subject: [PATCH v2 7/7] transformations: Allow tuning go packages. Date: Mon, 26 Jun 2023 15:38:43 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64188 Cc: Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) * guix/transformations.scm (build-system-with-tuning-compiler): When checking if a microarchitecture is supported by the compiler, also check if it is a go compiler which supports that psabi. Add a phase after 'setup-go-environment to set the go microarchitecture. --- guix/transformations.scm | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/guix/transformations.scm b/guix/transformations.scm index a289f81219..92d9c89c0e 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2021 Marius Bakke ;;; Copyright © 2023 Sarthak Shah +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +33,9 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) - #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) + #:autoload (guix cpu) (current-cpu + cpu->gcc-architecture + gcc-architecture->micro-architecture-level) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -516,7 +519,9 @@ (define (build-system-with-tuning-compiler bs micro-architecture) 'compiler-cpu-architectures) p)) (_ #f)) - (bag-build-inputs lowered)))) + (bag-build-inputs lowered))) + (psabi (gcc-architecture->micro-architecture-level + micro-architecture))) (unless compiler (raise (formatted-message (G_ "failed to determine which compiler is used")))) @@ -528,8 +533,11 @@ (define (build-system-with-tuning-compiler bs micro-architecture) (G_ "failed to determine whether ~a supports ~a") (package-full-name compiler) micro-architecture))) - (unless (member micro-architecture - (or (assoc-ref lst architecture) '())) + (unless (or (member micro-architecture + (or (assoc-ref lst architecture) '())) + (and (string=? (package-name compiler) "go") + (member psabi + (or (assoc-ref lst architecture) '())))) (raise (make-compound-condition (formatted-message @@ -556,6 +564,27 @@ (define (build-system-with-tuning-compiler bs micro-architecture) (bag (inherit lowered) + (arguments + (substitute-keyword-arguments (bag-arguments lowered) + ;; We add the tuning parameter after the default GO flags are set. + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'setup-go-environment 'set-microarchitecture + (lambda _ + (cond + ((string-prefix? "arm" #$psabi) + (setenv "GOARM" (string-take-right #$psabi 1)) + (format #t "Setting GOARM to ~s." + (getenv "GOARM"))) + ((string-prefix? "powerpc" #$psabi) + (setenv "GOPPC64" #$psabi) + (format #t "Setting GOPPC64 to ~s." + (getenv "GOPPC64"))) + ((string-prefix? "x86_64" #$psabi) + (setenv "GOAMD" (string-take-right #$psabi 2)) + (format #t "Setting GOAMD to ~s.\n" + (getenv "GOAMD"))) + (else #t)))))))) (build-inputs ;; Arrange so that the compiler wrapper comes first in $PATH. `(("tuning-compiler" ,(tuning-compiler micro-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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 11:27:30 2023 Received: (at 64188) by debbugs.gnu.org; 13 Jul 2023 15:27:30 +0000 Received: from localhost ([127.0.0.1]:40604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJyE6-0000mv-5n for submit@debbugs.gnu.org; Thu, 13 Jul 2023 11:27:30 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:45016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJyE3-0000mX-Hi for 64188@debbugs.gnu.org; Thu, 13 Jul 2023 11:27:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=CorsTnEfVkyliyDXjye3FRKabZstppFa/uW3ZxwCe0g=; b=RJpI6CWmZDkmQ13aUDhEgWi3yhUV2LluHI4CXiGTXt9Uc2JdOvgJR88w os4iPZ0l0oIE7ReOkzUvU52YD7wb32z8gmEPoWpI6Phdw3s3HPoPMFPxQ 8x8WqMAcoZ2VcnpSswb0mQGpgqF7fG/A3eYJYv3A3ZMOAvTIPTWDxO+Ue M=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.01,203,1684792800"; d="scan'208";a="117498041" Received: from unknown (HELO ribbon) ([193.50.110.205]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2023 17:27:21 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: <87352fz2m9.fsf_-_@gnu.org> Date: Thu, 13 Jul 2023 17:27:21 +0200 In-Reply-To: (Efraim Flashner's message of "Mon, 26 Jun 2023 11:34:27 +0300") Message-ID: <871qhbzvae.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Efraim, Thanks for pushing this patch series past the finish line! Efraim Flashner skribis: > I'll look to see how to move this into > build-system-with-tuning-compiler. I think I previously got hung-up on > the tuning-compiler function which wouldn't work for go. At first glance > it looks like I could just lift-and-shift the extra phase over. I'll > just have to make sure that either it's only for the go-build-system or > occurs sometime after the setup-go-environment phase but before/after a > phase which exists in all build systems. Then it's the toss-up between > leaving it as-is and only occurring with the go-build-system or also > occurring on any tuned package which also has go code. It looks like we=E2=80=99re now adding the =E2=80=98set-microarchitecture= =E2=80=99 phase unconditionally, not just for go. For example: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build --tune eigen-benchmarks --log-file guix build: tuning eigen-benchmarks@3.4.0 for CPU skylake https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-eigen-benchmar= ks-3.4.0 $ wget -qO- https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-ei= gen-benchmarks-3.4.0 |gunzip -c| grep -C3 set-micro phase `reset-gzip-timestamps' succeeded after 0.0 seconds starting phase `compress-documentation' phase `compress-documentation' succeeded after 0.0 seconds starting phase `set-microarchitecture' Setting GOAMD to "v3". phase `set-microarchitecture' succeeded after 0.0 seconds @ build-succeeded /gnu/store/pdz0g9q2yd9i1jkbhk2rnbfa88ngvffw-eigen-benchma= rks-3.4.0.drv - --8<---------------cut here---------------end--------------->8--- What I had in mind was to have a procedure similar to =E2=80=98tuning-compi= ler=E2=80=99 that would return a wrapper around the =E2=80=9Cgo=E2=80=9D binary that wou= ld set =E2=80=98GOAMD=E2=80=99 (or similar). That way the change would be well is= olated. Could you look into providing a patch for that? Thanks in advance! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 17 08:02:13 2023 Received: (at 64188) by debbugs.gnu.org; 17 Jul 2023 12:02:13 +0000 Received: from localhost ([127.0.0.1]:49237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLMvc-0000Kr-V8 for submit@debbugs.gnu.org; Mon, 17 Jul 2023 08:02:13 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:46401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLMva-0000Kd-Fi for 64188@debbugs.gnu.org; Mon, 17 Jul 2023 08:02:11 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fc0aecf15bso43541975e9.1 for <64188@debbugs.gnu.org>; Mon, 17 Jul 2023 05:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689595324; x=1692187324; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=jEUZQcoWxUjhDeHgJOfDc44hR7mg2ADzmXMExHo0a5I=; b=IYkkyAboixajNRweXLIWtyH3l+taqibG15gzwSXle25ME6FuyRtcNbMzGHwuhKzRFL v9h0fnGnsrD2MZFDJx5DEfa88iju+sapIud0n6oooCXw1lBB12DJIUlgpauTF79agJju CNewerwIpS5MFAITdt7waoLXSs9COrtRGMVB1nC2BiEuyQhSNGfm48mgDX9efls1E+YL TptGG9AiI5R8+4yKb/QED60tuxvWLD/ER3JZMkZ7qOZGBiYTVF1fbzwnv+MrkRTnM+1J a0e7jquUyiBeFi/FBnJoGkksJCMCAh4xj4iHzyFed91YODQAZbqysA6aOINXL/nbBZ0K q8pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689595324; x=1692187324; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jEUZQcoWxUjhDeHgJOfDc44hR7mg2ADzmXMExHo0a5I=; b=QroU/7AdTM15ujxxOSHPAF2pE2PdBc59tjVpjeKgLhGnd4JznIjTb+yIaUym0CiolO uGNiR6ZUNd+RxqEXTRLUCjEKm0UQMggvN7jRZuZayWGIZGPItPP5Dc2dg0ctrMCV4kiI WEL+Xa5k/GftnzceBISFFjol2O6eJrBvDxOxJbaZpOCVUP29dqmN5US9oViwNVYsM9aK JbaW2L3u9ndJ+6OUhMc2H53AL5TX25N/LUfDtWYqdtjNdoKynKJg0sfUrxuqBtnC5dz1 Ir8PGPoHyN4ma7bjrrnAKn2LlVbrtbaqlqRbPgTZxBgmpVEPdyu1e0zUaa1YbCHw4FLq gbFA== X-Gm-Message-State: ABy/qLYxXMlZrQyKJKR1Cd51Hch1rQ5DnXdobabpQ5ZuykqT/mwst/k0 kZ2z9DkifehynhPCkjabx+A= X-Google-Smtp-Source: APBJJlHr659DsBpl6Lx2hJkZn1vDeBJ9aP1NMHEMR3yRkxr6HSuFSM0dAhHnr/XhltWZ1/AODi9zGg== X-Received: by 2002:a05:600c:210c:b0:3fb:dd9c:72d2 with SMTP id u12-20020a05600c210c00b003fbdd9c72d2mr10657063wml.31.1689595324336; Mon, 17 Jul 2023 05:02:04 -0700 (PDT) Received: from localhost ([2a02:ed3:914:a500:bdef:3269:70ba:bfc8]) by smtp.gmail.com with ESMTPSA id q17-20020a7bce91000000b003fc0062f0f8sm8025680wmj.9.2023.07.17.05.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 05:02:03 -0700 (PDT) Date: Mon, 17 Jul 2023 15:02:02 +0300 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#64188: [PATCH 0/8] More package tuning Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 64188@debbugs.gnu.org, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/sNiu/+iZvYQGNHa" Content-Disposition: inline In-Reply-To: <871qhbzvae.fsf_-_@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --/sNiu/+iZvYQGNHa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 13, 2023 at 05:27:21PM +0200, Ludovic Court=C3=A8s wrote: > Hi Efraim, >=20 > Thanks for pushing this patch series past the finish line! >=20 > Efraim Flashner skribis: >=20 > > I'll look to see how to move this into > > build-system-with-tuning-compiler. I think I previously got hung-up on > > the tuning-compiler function which wouldn't work for go. At first glance > > it looks like I could just lift-and-shift the extra phase over. I'll > > just have to make sure that either it's only for the go-build-system or > > occurs sometime after the setup-go-environment phase but before/after a > > phase which exists in all build systems. Then it's the toss-up between > > leaving it as-is and only occurring with the go-build-system or also > > occurring on any tuned package which also has go code. >=20 > It looks like we=E2=80=99re now adding the =E2=80=98set-microarchitecture= =E2=80=99 phase > unconditionally, not just for go. For example: >=20 > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix build --tune eigen-benchmarks --log-file > guix build: tuning eigen-benchmarks@3.4.0 for CPU skylake > https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-eigen-benchm= arks-3.4.0 > $ wget -qO- https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-= eigen-benchmarks-3.4.0 |gunzip -c| grep -C3 set-micro > phase `reset-gzip-timestamps' succeeded after 0.0 seconds > starting phase `compress-documentation' > phase `compress-documentation' succeeded after 0.0 seconds > starting phase `set-microarchitecture' > Setting GOAMD to "v3". > phase `set-microarchitecture' succeeded after 0.0 seconds > @ build-succeeded /gnu/store/pdz0g9q2yd9i1jkbhk2rnbfa88ngvffw-eigen-bench= marks-3.4.0.drv - > --8<---------------cut here---------------end--------------->8--- >=20 > What I had in mind was to have a procedure similar to =E2=80=98tuning-com= piler=E2=80=99 > that would return a wrapper around the =E2=80=9Cgo=E2=80=9D binary that w= ould set > =E2=80=98GOAMD=E2=80=99 (or similar). That way the change would be well = isolated. >=20 > Could you look into providing a patch for that? >=20 > Thanks in advance! >=20 > Ludo=E2=80=99. That's actually really surprising to me. I thought that if you tried to add a phase after a non-existent phase then it just wouldn't be added. I tried just wrapping the call to the 'go' binary itself so that every time 'go' was called it would also set the environment variable setting the optimization level but I was having a hard time working that. While experimenting I did change what I had written to check for the 'setup-go-environment phase, and if it existed to add the optimization at the end of that phase. I have the part with wrapping the go binary as a WIP, and when it's ready I'll post both parts so we can choose which one seems better. I like the idea of go being wrapped, it makes it easier to just add in the optimizations whenever go is added to a package. On the other hand I like the extra phase, since it's already done :) --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --/sNiu/+iZvYQGNHa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmS1LbcACgkQQarn3Mo9 g1GFPRAAtlZfGzO8ZjjOSmGsPQt1DB2lmKogOiILcYHVrSP6np2AUzyB6qJ3JQsw +BdtzV9MjCzy3cdtjgjmL6lrw21cj1YBRCgaLAE3x+s+ZBIPpwH5T/0NA5MsOKei f6wKXFGbf0j/thwbzxW7QOf4XTT3KF/gCOhC2xQhzOF2hPFs0MWR0GMsQj8I+B5E hzmzntHavs8LBrysUz1Z9wGdWdmrIxPLkI6hybV7CUgYFuqAnIFEcbluEzYyD9hA OlRwx7H4Y2153dRFXoABaFhbaNDgNfZL7uJr7ORO/IgOGQegoq3yHCSQ1rNzIkqM +1Vs4tbI4gwmFrE2Ihmv1pCv57GJ6iVkp7y2ROhQlJxrj5nMrzQODjgZXgH5d/Vd aS2OM2iFm9cwdh5q1ThaPoqQdhOWMDDHCoCZnT4A0lbSiFOL9r/JofpZSj3DqmCn DIQjmmap0cesgGcSPiT9yWAO6urP7GWXkSiwyzxJ2mkSvaxAqsQCVqmaCRdzWGH0 RW0gQNJ1AtKoQc8dfSDscbJvExN91JPicefWP7/dXqo/uW6lSL/hhrbEcFT2/bFi Z7syi5MtRhVsw5qhtmaZBgWVafNBkYU+iVYNtY7zvTqfuh17CKia3KGDPl0WO/P9 FoTZ2z7Wm5TjHn8Emmsv51E6KbJeYi8iKC1y/qH4Sq4PWAKaiZs= =B0mm -----END PGP SIGNATURE----- --/sNiu/+iZvYQGNHa-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 17 11:41:46 2023 Received: (at 64188) by debbugs.gnu.org; 17 Jul 2023 15:41:46 +0000 Received: from localhost ([127.0.0.1]:50787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLQM6-0000ak-CK for submit@debbugs.gnu.org; Mon, 17 Jul 2023 11:41:46 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:32018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLQM2-0000aS-If for 64188@debbugs.gnu.org; Mon, 17 Jul 2023 11:41:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=oA8vaJonNeyBQPqhUKXaEPZ89dW5h2t3RrTjEpBXPm8=; b=pFWH6O1QPUzJqwe1CMw2xEVoukKWVDdcE6XOmSIColZpxbr5mQVro46Y 3t1Z9vNp2Osabb06tXzR2VvvxIVQFiaiv+Ih4k0pwZBizMyQqnGtId9Z5 YSi0yVgWFcB7PHHwvaxwiD3ArKibJAlDuhIlJuZ/a0DOYhCXCfRv0TFw8 w=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.01,211,1684792800"; d="scan'208";a="61573614" Received: from unknown (HELO ribbon) ([193.50.110.205]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 17:41:36 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 29 Messidor an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour du =?utf-8?Q?Bl=C3=A9?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 17 Jul 2023 17:41:35 +0200 In-Reply-To: (Efraim Flashner's message of "Mon, 17 Jul 2023 15:02:02 +0300") Message-ID: <87wmyypmts.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Efraim Flashner skribis: > On Thu, Jul 13, 2023 at 05:27:21PM +0200, Ludovic Court=C3=A8s wrote: [...] >> It looks like we=E2=80=99re now adding the =E2=80=98set-microarchitectur= e=E2=80=99 phase >> unconditionally, not just for go. For example: >>=20 >> --8<---------------cut here---------------start------------->8--- >> $ ./pre-inst-env guix build --tune eigen-benchmarks --log-file >> guix build: tuning eigen-benchmarks@3.4.0 for CPU skylake >> https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-eigen-bench= marks-3.4.0 >> $ wget -qO- https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky= -eigen-benchmarks-3.4.0 |gunzip -c| grep -C3 set-micro >> phase `reset-gzip-timestamps' succeeded after 0.0 seconds >> starting phase `compress-documentation' >> phase `compress-documentation' succeeded after 0.0 seconds >> starting phase `set-microarchitecture' >> Setting GOAMD to "v3". >> phase `set-microarchitecture' succeeded after 0.0 seconds >> @ build-succeeded /gnu/store/pdz0g9q2yd9i1jkbhk2rnbfa88ngvffw-eigen-benc= hmarks-3.4.0.drv - >> --8<---------------cut here---------------end--------------->8--- >>=20 >> What I had in mind was to have a procedure similar to =E2=80=98tuning-co= mpiler=E2=80=99 >> that would return a wrapper around the =E2=80=9Cgo=E2=80=9D binary that = would set >> =E2=80=98GOAMD=E2=80=99 (or similar). That way the change would be well= isolated. >>=20 >> Could you look into providing a patch for that? >>=20 >> Thanks in advance! >>=20 >> Ludo=E2=80=99. > > That's actually really surprising to me. I thought that if you tried to > add a phase after a non-existent phase then it just wouldn't be added. Actually I thought so too. :-) But anyway, the point is that we=E2=80=99re modifying phases unconditionally (whether or not this has an effect), and it would be nicer to avoid it IMO. > I tried just wrapping the call to the 'go' binary itself so that every > time 'go' was called it would also set the environment variable setting > the optimization level but I was having a hard time working that. While > experimenting I did change what I had written to check for the > 'setup-go-environment phase, and if it existed to add the optimization > at the end of that phase. > > I have the part with wrapping the go binary as a WIP, and when it's > ready I'll post both parts so we can choose which one seems better. I > like the idea of go being wrapped, it makes it easier to just add in the > optimizations whenever go is added to a package. On the other hand I > like the extra phase, since it's already done :) Not a valid argument! :-) We can discuss the implementation on IRC if you want. It might be that we can slightly generalize =E2=80=98tuning-comp= iler=E2=80=99 so that it works for go (perhaps there=E2=80=99s an option like =E2=80=98-m= arch=E2=80=99 that we could use instead of setting =E2=80=98GOAMD=E2=80=99?). Thanks in advance! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 07:17:51 2023 Received: (at 64188) by debbugs.gnu.org; 18 Jul 2023 11:17:51 +0000 Received: from localhost ([127.0.0.1]:51704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLiiE-0006K0-O2 for submit@debbugs.gnu.org; Tue, 18 Jul 2023 07:17:51 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLiiC-0006Jk-60 for 64188@debbugs.gnu.org; Tue, 18 Jul 2023 07:17:49 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fba8e2aa52so57886585e9.1 for <64188@debbugs.gnu.org>; Tue, 18 Jul 2023 04:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689679062; x=1692271062; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=+8e90LHLplUzpPF2kyU1dYM7L5uw2vEi6Sezqe98+m8=; b=aOdSU+ijn37+vB8Bl7iCg7S6pKMROmF8QE58YTlX4fUP6TiRNyACeA1Xrdt1wgO0eN doDOT8K/voVc7008jhjWh77rKqdPX0+DVcidRGyyScd2alVuFqHgipMiB9h78//e4n4K XkR6RJHraxEdJiDu4gRwJ6MQ9LnHSta8J2OjCW7ycHvctTDtADxY5e8YAcVe7TVcT5gN T3T5sm6LnfxqUA7kmq0dSJ3+/1TXoEG/KyWhgoYD8RBkUUJui90BeGexWnp+8DG4ERVC hmsq44EMivzTxGgGYQg8AMUpPb8/gSt2Rd25KeX5MeiR1bGc3fIMf2XizeKEM1sWN4cr QHaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689679062; x=1692271062; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+8e90LHLplUzpPF2kyU1dYM7L5uw2vEi6Sezqe98+m8=; b=THXeuh6OUKgDv7LMjdt4FrLt5jQBuAjAGW8X3HG0elwnFoUEvjtm/+Uk5EZveAmiik bcQmMw8o6tTdgNj6S2yQJQdrIrkpOvlNICbUAsCn/8td9gudFtJ7EVo9o2CKVacGgaM/ ME9R8ir+hCv8dZSb1ME7WxVQzyu5p8FB4Jn9s4LPHJ3JuasLbESMF1PMaw5qr6ckE38C RxcQno38lN5nPN3CnAeiGTlB9xnJuJHVPktr8U/5YXlSqcJVWhJtCISQHcfU/Z832hWz MvJt+FRcGYHx4L87m/sSzod6pgmXIsNXfTFTtziIMFsi2LtJ2MJyF1wfh8UTxEB2vMiv Wkzg== X-Gm-Message-State: ABy/qLaNg/Jo/rPdXC5If1L3Udnghhk9+B6fmaI9pKmCtoD4LeEfePJV zhxUmm3o4WFJ78PrPZIu5xI= X-Google-Smtp-Source: APBJJlGKI5tTVRZdXoGgBmbKMavwhGjjmljIK4F5g/9fo6Cijc4JKJCxv7yski8/7o2HQgRjd5tCLw== X-Received: by 2002:a1c:e915:0:b0:3fb:e054:903f with SMTP id q21-20020a1ce915000000b003fbe054903fmr1677004wmc.36.1689679062110; Tue, 18 Jul 2023 04:17:42 -0700 (PDT) Received: from localhost ([2a02:ed3:914:a500:bdef:3269:70ba:bfc8]) by smtp.gmail.com with ESMTPSA id 25-20020a05600c025900b003fc00702f65sm9998426wmj.46.2023.07.18.04.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 04:17:41 -0700 (PDT) Date: Tue, 18 Jul 2023 14:17:39 +0300 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#64188: [PATCH 0/8] More package tuning Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 64188@debbugs.gnu.org, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> <87wmyypmts.fsf@inria.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6MEHSWBLO7koTwxw" Content-Disposition: inline In-Reply-To: <87wmyypmts.fsf@inria.fr> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --6MEHSWBLO7koTwxw Content-Type: multipart/mixed; boundary="3aqIM1pGO/veOiQe" Content-Disposition: inline --3aqIM1pGO/veOiQe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 05:41:35PM +0200, Ludovic Court=C3=A8s wrote: > Hi, >=20 > Efraim Flashner skribis: >=20 > > On Thu, Jul 13, 2023 at 05:27:21PM +0200, Ludovic Court=C3=A8s wrote: >=20 > [...] >=20 > >> It looks like we=E2=80=99re now adding the =E2=80=98set-microarchitect= ure=E2=80=99 phase > >> unconditionally, not just for go. For example: > >>=20 > >> --8<---------------cut here---------------start------------->8--- > >> $ ./pre-inst-env guix build --tune eigen-benchmarks --log-file > >> guix build: tuning eigen-benchmarks@3.4.0 for CPU skylake > >> https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0pky-eigen-ben= chmarks-3.4.0 > >> $ wget -qO- https://ci.guix.gnu.org/log/djwka1jhzhk08yb23as83yk5hysn0p= ky-eigen-benchmarks-3.4.0 |gunzip -c| grep -C3 set-micro > >> phase `reset-gzip-timestamps' succeeded after 0.0 seconds > >> starting phase `compress-documentation' > >> phase `compress-documentation' succeeded after 0.0 seconds > >> starting phase `set-microarchitecture' > >> Setting GOAMD to "v3". > >> phase `set-microarchitecture' succeeded after 0.0 seconds > >> @ build-succeeded /gnu/store/pdz0g9q2yd9i1jkbhk2rnbfa88ngvffw-eigen-be= nchmarks-3.4.0.drv - > >> --8<---------------cut here---------------end--------------->8--- > >>=20 > >> What I had in mind was to have a procedure similar to =E2=80=98tuning-= compiler=E2=80=99 > >> that would return a wrapper around the =E2=80=9Cgo=E2=80=9D binary tha= t would set > >> =E2=80=98GOAMD=E2=80=99 (or similar). That way the change would be we= ll isolated. > >>=20 > >> Could you look into providing a patch for that? > >>=20 > >> Thanks in advance! > >>=20 > >> Ludo=E2=80=99. > > > > That's actually really surprising to me. I thought that if you tried to > > add a phase after a non-existent phase then it just wouldn't be added. >=20 > Actually I thought so too. :-) >=20 > But anyway, the point is that we=E2=80=99re modifying phases unconditiona= lly > (whether or not this has an effect), and it would be nicer to avoid it > IMO. >=20 > > I tried just wrapping the call to the 'go' binary itself so that every > > time 'go' was called it would also set the environment variable setting > > the optimization level but I was having a hard time working that. While > > experimenting I did change what I had written to check for the > > 'setup-go-environment phase, and if it existed to add the optimization > > at the end of that phase. > > > > I have the part with wrapping the go binary as a WIP, and when it's > > ready I'll post both parts so we can choose which one seems better. I > > like the idea of go being wrapped, it makes it easier to just add in the > > optimizations whenever go is added to a package. On the other hand I > > like the extra phase, since it's already done :) >=20 > Not a valid argument! :-) We can discuss the implementation on IRC if > you want. It might be that we can slightly generalize =E2=80=98tuning-co= mpiler=E2=80=99 > so that it works for go (perhaps there=E2=80=99s an option like =E2=80=98= -march=E2=80=99 that we > could use instead of setting =E2=80=98GOAMD=E2=80=99?). I found -goarch, but it's for cross-compiling and wouldn't take x86_64-v3 as an input. The attached diff has 2 parts, the first wraps the go binary (and only the go binary) with GOAMD or the like. The second part is commented out, but is how I would've fixed the extra 'set-microarchitecture phase. I'm pretty certain that I have the logic correct, but I'm not certain that it's being applied. It probably needs (system* "export" "GOAMD" #$psabi) or something similar, when I tried adjusting syncthing to display (getenv "GOAMD") I was getting #f. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --3aqIM1pGO/veOiQe Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="wrap-go-binary.diff" Content-Transfer-Encoding: quoted-printable diff --git a/guix/transformations.scm b/guix/transformations.scm index 92d9c89c0e..0665f33178 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -441,6 +441,9 @@ (define tuning-compiler #~(begin (use-modules (ice-9 match)) =20 + (define psabi #$(gcc-architecture->micro-architecture-level + micro-architecture)) + (define* (search-next command #:optional (path (string-split (getenv "PATH") @@ -469,10 +472,25 @@ (define tuning-compiler (match (search-next (basename command)) (#f (exit 127)) (next - (apply execl next + (if (and (search-next "go") + (string=3D? next (search-next "go"))) + (cond + ((string-prefix? "arm" psabi) + (setenv "GOARM" (string-take-right psabi 1))) + ((string-prefix? "powerpc" psabi) + (setenv "GOPPC64" psabi)) + ((string-prefix? "x86_64" psabi) + (setenv "GOAMD" (string-take-right psabi 2))) + (else #t)) + '()) + (apply + execl next (append (cons next arguments) + (if (and (search-next "go") + (string=3D? next (search-next "go"))) + '() (list (string-append "-march=3D" - #$micro-architecture))))))= )))) + #$micro-architecture))))))= ))))) =20 (define program (program-file (string-append "tuning-compiler-wrapper-" micro-archit= ecture) @@ -489,7 +507,8 @@ (define tuning-compiler (for-each (lambda (program) (symlink #$program (string-append bin "/" progr= am))) - '("cc" "gcc" "clang" "g++" "c++" "clang= ++"))))))) + '("cc" "gcc" "clang" "g++" "c++" "clang= ++" + "go"))))))) =20 (define (build-system-with-tuning-compiler bs micro-architecture) "Return a variant of BS, a build system, that ensures that the compiler = that @@ -564,27 +583,31 @@ (define (build-system-with-tuning-compiler bs micro-a= rchitecture) =20 (bag (inherit lowered) - (arguments + #;(arguments (substitute-keyword-arguments (bag-arguments lowered) ;; We add the tuning parameter after the default GO flags are se= t. ((#:phases phases '%standard-phases) - #~(modify-phases #$phases - (add-after 'setup-go-environment 'set-microarchitecture - (lambda _ - (cond - ((string-prefix? "arm" #$psabi) - (setenv "GOARM" (string-take-right #$psabi 1)) - (format #t "Setting GOARM to ~s." - (getenv "GOARM"))) - ((string-prefix? "powerpc" #$psabi) - (setenv "GOPPC64" #$psabi) - (format #t "Setting GOPPC64 to ~s." - (getenv "GOPPC64"))) - ((string-prefix? "x86_64" #$psabi) - (setenv "GOAMD" (string-take-right #$psabi 2)) - (format #t "Setting GOAMD to ~s.\n" - (getenv "GOAMD"))) - (else #t)))))))) + ;; This phase is only in the go-build-system. + #~(if (assoc-ref #$phases 'setup-go-environment) + (modify-phases #$phases + (replace 'setup-go-environment + (lambda* args + (apply (assoc-ref #$phases 'setup-go-environment) a= rgs) + (cond + ((string-prefix? "arm" #$psabi) + (setenv "GOARM" (string-take-right #$psabi 1)) + (format #t "Setting GOARM to ~s." + (getenv "GOARM"))) + ((string-prefix? "powerpc" #$psabi) + (setenv "GOPPC64" #$psabi) + (format #t "Setting GOPPC64 to ~s." + (getenv "GOPPC64"))) + ((string-prefix? "x86_64" #$psabi) + (setenv "GOAMD" (string-take-right #$psabi 2)) + (format #t "Setting GOAMD to ~s.\n" + (getenv "GOAMD"))) + (else #t))))) + #$phases)))) (build-inputs ;; Arrange so that the compiler wrapper comes first in $PATH. `(("tuning-compiler" ,(tuning-compiler micro-architecture)) --3aqIM1pGO/veOiQe-- --6MEHSWBLO7koTwxw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmS2dNAACgkQQarn3Mo9 g1FeRRAApJ8+8JI5fKn8Bgxt5cqle/sbgsr3eDJo50jLAH+/D/jFLNqqoAtgN87+ 5RKiqOOBSQgT6Xkxj9DJIOyjEnGyX2xvGCVC4iyTD6fNA1FbzbTYBGsnFjE68Axn Y3xl/ghr+oTRxMYOFjoifREJh+PjpGKpSmIR4Vp0TxKymzGOS8TMKr+RCf9l9BYr ONpfqHPD37Ekvo/6KztGEq2lbF8A3gKPPU86PMc291oJhnv+OZcyPBAQHMCYXKln ce0Mz5ogF6y+eWlmrY45sP5+T/3ucX81lOjG0aplmHyEvrKv6rXnrD4I7mi36rbX mthbN4qfZjuFAepkArn01KaRv+aYRUo4Rj9/MNwsIUnatIxM0oeRVAEWtLpHAQ/f 25j3pgIRfDfpf/Mii7M7xtr+7u4HrI0mdoTe+h2SrIojv3QHxUhYzGGS463NCA2U i//55OUgXpn8/5ttYJAQhlVGiXAeVOo1gAV5vPEMOIn/MWSpvxYerDXyFmtBGFVe /ic1wa+T/wDledgfsBFl7x2kCNdx1LVw1QsljKKFtzBRwS4OY0imuDPA5e0UAPyY z10i8s2FnstK9GyOVi5rnKlRpViSqBo4jUiEn1QsF3Hx4WLQT4VDMUoMRpBMZtMS cv6F0t/l0bpCtxTdZgLZDdC80tTfU4Cp518rpA8YNuUTCFCqeN0= =eyLC -----END PGP SIGNATURE----- --6MEHSWBLO7koTwxw-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 04:39:27 2023 Received: (at 64188) by debbugs.gnu.org; 19 Jul 2023 08:39:27 +0000 Received: from localhost ([127.0.0.1]:54930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM2iV-0006am-2A for submit@debbugs.gnu.org; Wed, 19 Jul 2023 04:39:27 -0400 Received: from jpoiret.xyz ([206.189.101.64]:41688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM2iS-0006ae-V5 for 64188@debbugs.gnu.org; Wed, 19 Jul 2023 04:39:25 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id E89C9185305; Wed, 19 Jul 2023 08:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1689755962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1eFmUeId3eRjn4Kf0VzC5WVs8TEqiNwgmFY789QlEp0=; b=hL+p6rcEvlZInr+wvxZKHn+FiOZrU5Q0E+VeCYuiuYYkRA+Bv6Lcwy48KzpS08ECcVpGDM /DI1z4+99qrWnObGq7T0pMM1VBETIckN54IdffRpCfzPmTS5iVAlpZKa2oylxadHkCAuhX oMBzqk2nYszdtOT4BK7kMXOAKoqSHbG+2tXcUUzZUPgeSOljUK6E4VYKqsutsRBbp1r5eA 3BZTk7Sgayzgl/oXwL3Wb1qXvi5yfoNl6c+usC0/lywbuAbFLm1G2lriF6Hg/8zaAQ0Q4+ tW2Y7AG+gvaMe4qJi2WT20deUzCh0Q71gwZwIrUIAtMWJh9BL8Mb1ZiINtv7sg== From: Josselin Poiret To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8?= =?utf-8?Q?s?= Subject: Re: bug#64188: [PATCH 0/8] More package tuning In-Reply-To: References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> <87wmyypmts.fsf@inria.fr> Date: Wed, 19 Jul 2023 10:39:16 +0200 Message-ID: <87y1jce1mz.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spamd-Bar: + Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Level: * X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64188 Cc: Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Efraim, Efraim Flashner writes: > I'm pretty certain that I have the logic correct, but I'm not certain > that it's being applied. It probably needs (system* "export" "GOAMD" > #$psabi) or something similar, when I tried adjusting syncthing to > display (getenv "GOAMD") I was getting #f. That system* call won't do anything: export is a built-in in most shells that sets an environment variable for the current shell session. system* doesn't run the command you're giving it through a shell, so it won't find `export`, and if you use system instead (which would run it through a shell) it will only take effect during the (system ...) call, after which the shell session is torn down. You really need to use the guile setenv if you want it to have any effect on started programs (or use the spawn interface to specify env variables for a specific invocation). Best, =2D-=20 Josselin Poiret --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmS3oTQQHGRldkBqcG9p cmV0Lnh5egAKCRBQXkC5FhcailnwC/0ek+2bPY8Sau/7IFBKrhEqw0cKj5wQxhWy H50CNtQoUGxL+6w3LoTM+aRtPjFoVONJIWw4ZsKVrq9jo5kvhkFvvQU4t0VlzsZP 2Faih50f22UZZsGMqCijpcymoeQHyHP79ULpVvTQiGk9zTHMtnShPotlTTho3HP7 SbXRqhNrTbJR51wjBH+g20uaRcDqTucrpvGcct603hmCmYWbFJ2PRG0AZ/QItNte PexuYdL5QtS+ju2++jUl5eSEOSpE6RXaZ0pCPIhJ4pZjf2UAOXYdmoWFOoNYc8/T 7/FQPEWEbqh5ZMY2rgwzdU95YPKyWkWhtOG15BrrwcifqUDf9kpAs+d58mUZlRFC iG4ys5pXKWtaROoxZZpMcEtrBHy6c9Yr+CCX4SHzV3ahrLVneGlR9Tj1GGgyJbRj GLJd7e8WEak14Fr0uUB8UlKskk5+VYtSTm73FWlOdtAxdrLezc4nWh2d6H3j2LMN +YQn4AxJvJq/6wV+I0sWnqOu64Z6or4= =QPqO -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 07 03:33:26 2023 Received: (at 64188) by debbugs.gnu.org; 7 Aug 2023 07:33:26 +0000 Received: from localhost ([127.0.0.1]:60470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSujz-00051i-43 for submit@debbugs.gnu.org; Mon, 07 Aug 2023 03:33:26 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:44517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSujt-00051R-8R for 64188@debbugs.gnu.org; Mon, 07 Aug 2023 03:33:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=NVIbFrDc3YQXrdVZvHCW6gMhcD3ul15GPxH2rGc0cow=; b=Go8r/wWRT1kqyfXb/wN6Q5TrRrln22NTbo0HmbKpkyNIVS01v0l+lMLq V8Ce7K+47QQNyuS+zsBb+gMyidg7H1+3tj98iGhEajYf3h/CH4KPaiwh+ cTgz8LwfP50yX8ctKJ8ejuAZwrINEfoK4SGVR6tS0civOBmAFEC9naD3U o=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.01,261,1684792800"; d="scan'208";a="120355880" Received: from unknown (HELO ribbon) ([193.50.110.195]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 09:33:11 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> <87wmyypmts.fsf@inria.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 20 Thermidor an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de =?utf-8?Q?l'=C3=89cluse?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 07 Aug 2023 09:33:10 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 18 Jul 2023 14:17:39 +0300") Message-ID: <87il9rxq6h.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 64188 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , 64188@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Hi, Efraim Flashner skribis: >> Not a valid argument! :-) We can discuss the implementation on IRC if >> you want. It might be that we can slightly generalize =E2=80=98tuning-c= ompiler=E2=80=99 >> so that it works for go (perhaps there=E2=80=99s an option like =E2=80= =98-march=E2=80=99 that we >> could use instead of setting =E2=80=98GOAMD=E2=80=99?). > > I found -goarch, but it's for cross-compiling and wouldn't take > x86_64-v3 as an input. > > The attached diff has 2 parts, the first wraps the go binary (and only > the go binary) with GOAMD or the like. The second part is commented out, > but is how I would've fixed the extra 'set-microarchitecture phase. At first sight it seems to me like it=E2=80=99s going in the right directio= n. Perhaps we should create a separate =E2=80=98tuning-go-compiler=E2=80=99 fo= r clarity, and arrange to factorize =E2=80=98search-next=E2=80=99 between the two. Let me know what you think! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 12:55:13 2023 Received: (at 64188-done) by debbugs.gnu.org; 21 Aug 2023 16:55:13 +0000 Received: from localhost ([127.0.0.1]:57609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY8BM-0002vt-UP for submit@debbugs.gnu.org; Mon, 21 Aug 2023 12:55:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY8BJ-0002vb-WD for 64188-done@debbugs.gnu.org; Mon, 21 Aug 2023 12:55:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY8BA-0003gw-HV; Mon, 21 Aug 2023 12:55:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=IO1I7hEMgsozb6MaqsFkYeOXL23vbR98RD46LWwHhjo=; b=B/zLktiwJbwmU1SX1zXn 6L6BiF3co0vtLP5h9+/09re4JEoQuSeFL4aMVHQeY5mOiA6OgGoHbflYC2u+XvNzDWmuB2BUAe/oW yuWUZ2hhXljGXS+FKfAnjafcTi7o6mRtwUvOE8YKy5TrXF3fpG3zUmz79DK+YEZ4p2tyqkUU3hsM0 zdH+JGmMgpGuAf91QaHdCGMjNxb/fPdHXTN0uY3JTUOjbv+m83tgxH658hOl4cK7bwMIAmjDLYKrf lE+vj8qZ+sQq42D76EtN8U9xI7Z4VH7euUZd0StcAOIW8pjKnSdujAsL1VywLi0eHHNHT2bnI7ovh SAqoo767payF8Q==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Efraim Flashner Subject: Re: bug#64188: [PATCH 0/8] More package tuning References: <87352fz2m9.fsf_-_@gnu.org> <871qhbzvae.fsf_-_@gnu.org> <87wmyypmts.fsf@inria.fr> <87il9rxq6h.fsf@inria.fr> Date: Mon, 21 Aug 2023 18:54:56 +0200 In-Reply-To: <87il9rxq6h.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Mon, 07 Aug 2023 09:33:10 +0200") Message-ID: <87a5uk8hen.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64188-done Cc: Josselin Poiret , Christopher Baines , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 64188-done@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Efraim, Ludovic Court=C3=A8s skribis: > Efraim Flashner skribis: > >>> Not a valid argument! :-) We can discuss the implementation on IRC if >>> you want. It might be that we can slightly generalize =E2=80=98tuning-= compiler=E2=80=99 >>> so that it works for go (perhaps there=E2=80=99s an option like =E2=80= =98-march=E2=80=99 that we >>> could use instead of setting =E2=80=98GOAMD=E2=80=99?). >> >> I found -goarch, but it's for cross-compiling and wouldn't take >> x86_64-v3 as an input. >> >> The attached diff has 2 parts, the first wraps the go binary (and only >> the go binary) with GOAMD or the like. The second part is commented out, >> but is how I would've fixed the extra 'set-microarchitecture phase. > > At first sight it seems to me like it=E2=80=99s going in the right direct= ion. > > Perhaps we should create a separate =E2=80=98tuning-go-compiler=E2=80=99 = for clarity, > and arrange to factorize =E2=80=98search-next=E2=80=99 between the two. > > Let me know what you think! I see you pushed a variant as 1fd4f544b3065af225731462f3d3d647da781ee8, neat. Closing! Ludo=E2=80=99. From unknown Sun Jun 22 00:20:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Sep 2023 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator