From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +IU0GxqbA2LTuAAAgWs5BA (envelope-from ) for ; Wed, 09 Feb 2022 11:44:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0KjnFxqbA2IdOwAAauVa8A (envelope-from ) for ; Wed, 09 Feb 2022 11:44:42 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 16F94E06A for ; Wed, 9 Feb 2022 11:44:42 +0100 (CET) Received: from localhost ([::1]:56864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHkSn-0003ZR-3S for larch@yhetil.org; Wed, 09 Feb 2022 05:44:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHkSM-0002ng-Fa for guix-patches@gnu.org; Wed, 09 Feb 2022 05:44:15 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHkSA-00012v-QN for guix-patches@gnu.org; Wed, 09 Feb 2022 05:44:14 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHkSA-0000CG-Ai for guix-patches@gnu.org; Wed, 09 Feb 2022 05:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53895] [PATCH 0/5] More CPU detection Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53895 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 53895@debbugs.gnu.org Received: via spool by 53895-submit@debbugs.gnu.org id=B53895.1644403411682 (code B ref 53895); Wed, 09 Feb 2022 10:44:02 +0000 Received: (at 53895) by debbugs.gnu.org; 9 Feb 2022 10:43:31 +0000 Received: from localhost ([127.0.0.1]:50007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHkRf-0000Av-Ib for submit@debbugs.gnu.org; Wed, 09 Feb 2022 05:43:31 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:44718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHkRe-0000AZ-5i for 53895@debbugs.gnu.org; Wed, 09 Feb 2022 05:43:30 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8CC461B7; Wed, 9 Feb 2022 11:43:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Swc1X8JIVJ0w; Wed, 9 Feb 2022 11:43:22 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 55570174; Wed, 9 Feb 2022 11:43:22 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Wed, 09 Feb 2022 11:43:21 +0100 In-Reply-To: (Efraim Flashner's message of "Wed, 9 Feb 2022 12:21:48 +0200") Message-ID: <878ruk8gmu.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 8CC461B7 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644403482; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=zIbgqCwG54jnIy5Fe4ASZCYrPtufHoeUd7hISFbkyHg=; b=M9rdFmkrgm2aqNtg1jmN1HzMVL//I1n/X+Yn1y8BIKi/eaT02q02h2YcOJsTLx/z+QLH3l +EZGrA1xF4YLg2AGgIu7rh0Pl6OXbIFU121EEk4VM09WjDeNKLCM1YrtagRr5DuBoPs/R0 Crxq6DIkbeM2hulxX/EVLJbFOzOzgYBDVS+HF2fQFY8hOyRq4lRJqdTY7zstJg3i1fTGlp ZlQVm7tkABomMVOJtebcLeo3wSmVmB+DSz2TcDgPeRTEAwt2v+JZ4GGzDTDXHY1snIDyZM B6veap36ICUw2UZttSxAONl8LrGZW8+612klmGmbL9aUqDQZ6Pd93ECspOAYKg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644403482; a=rsa-sha256; cv=none; b=QPajL1V8I4D92/SDmfFkb3juTSQHbMzVRKPbIoEDvxRKe/EDSEp2QKVQfG4Is3zXD6XEHq hjJdL2bc/EFoe9H46LcWZdQlzLV3O7DGM2CyFb/788hZRvIJ6iRlpoD/1720cE2pB8Te5M vEjnPHeID3vR9RYrTnX7VDa9As0kq7OQcGz9kTZ9YCDRC61n7yum6AtXa3eM5NKFVItwEK WBTEnpWCvc7XUZQ9QuBQiDT87TfvFNHtmZU1PysA6VbW+si8P7tSzz1rUYwIMQh4UvdtTx Wkkg47zLTqnXsQxN+H5eAFCT4k8CP7nB1Q+vQ1fgO/rNOQtwpPaUCL4Jh3a1Ig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 16F94E06A X-Spam-Score: -4.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 645SwH68A0Pi Efraim Flashner skribis: > * guix/cpu.scm : Add vendor field. > (current-cpu): Also fill in the 'vendor' field. > (cpu->gcc-architecture): Add detection logic for AMD CPUs. [...] > + (and (equal? "AuthenticAMD" (cpu-vendor cpu)) Isn=E2=80=99t that equivalent to (=3D (cpu-family cpu) some-value)? > + (letrec-syntax ((if-flags (syntax-rules (=3D>) > + ((_) > + #f) > + ((_ (flags ... =3D> name) rest= ...) > + (if (every (lambda (flag) > + (set-contains? (= cpu-flags cpu) > + f= lag)) > + '(flags ...)) > + name > + (if-flags rest ...)))))) > + > + (when (=3D 22 (cpu-family cpu)) > + (if-flags ("movbe" =3D> "btver2"))) > + (when (=3D 6 (cpu-family cpu)) > + (if-flags ("3dnowp" =3D> "athalon"))) This has no effect (because =E2=80=98if-flags=E2=80=99 returns a value that= is ignored since it=E2=80=99s not returned.) What we could do is extend =E2=80=98if-flags=E2=80=99 so that it can option= ally check for a family number: (if-flags ((family 22) "movbe" =3D> "btver2") =E2=80=A6) > + (if-flags ("vaes" =3D> "znver3") > + ("clwb" =3D> "znver2") > + ("clzero" =3D> "znver1") However, the code in driver-i386.c seems to look at model IDs (the big =E2=80=9Cswitch (processor)=E2=80=9D thing) and not feature flags. Or am I= overlooking something? Thanks, Ludo=E2=80=99.