From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sDZBCjqZA2KstgAAgWs5BA (envelope-from ) for ; Wed, 09 Feb 2022 11:36:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SE3cBjqZA2IlQwAAauVa8A (envelope-from ) for ; Wed, 09 Feb 2022 11:36: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 3C71F474D1 for ; Wed, 9 Feb 2022 11:36:41 +0100 (CET) Received: from localhost ([::1]:47080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHkL2-00056f-EL for larch@yhetil.org; Wed, 09 Feb 2022 05:36:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHkKW-0004nN-58 for guix-patches@gnu.org; Wed, 09 Feb 2022 05:36:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHkKQ-0003yu-OI for guix-patches@gnu.org; Wed, 09 Feb 2022 05:36:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHkKQ-0008Om-IG for guix-patches@gnu.org; Wed, 09 Feb 2022 05:36: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:36: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.164440294632257 (code B ref 53895); Wed, 09 Feb 2022 10:36:02 +0000 Received: (at 53895) by debbugs.gnu.org; 9 Feb 2022 10:35:46 +0000 Received: from localhost ([127.0.0.1]:49987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHkK9-0008OC-80 for submit@debbugs.gnu.org; Wed, 09 Feb 2022 05:35:46 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:44488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHkJu-0008Nh-Rk for 53895@debbugs.gnu.org; Wed, 09 Feb 2022 05:35:43 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6021C234; Wed, 9 Feb 2022 11:35:24 +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 P_bW0OxTj_GJ; Wed, 9 Feb 2022 11:35:23 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 94A0A1B4; Wed, 9 Feb 2022 11:35:22 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <848868e0ad4427a976bec55968f82a3469009fb9.1644401681.git.efraim@flashner.co.il> Date: Wed, 09 Feb 2022 11:35:22 +0100 In-Reply-To: <848868e0ad4427a976bec55968f82a3469009fb9.1644401681.git.efraim@flashner.co.il> (Efraim Flashner's message of "Wed, 9 Feb 2022 12:21:47 +0200") Message-ID: <87ee4c8h05.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: 6021C234 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=1644403001; 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=bAYvLgQIyHVo9cDdjqJqEAY0t1aX8XShf2TkPP07sWQ=; b=fTQatR+JvdKaWmKgCIoVvqPNK2A6OE/iFOZpCMAUM8GAE9nnvN5RdP7mdJwKrXX/ekFIdA jca87Wqi4zg7kePcPK9uYbGyaRIBQuSEvstQh+aNDejW295uKKW1iJETuEH4pTenTLzrys 5PP2Jf2XaWzw+YZjxYCXjhQdG7q0+prrEdXOE2CwREcxHnX9Yfwn14SWHE1NfkVGXNcTXU UkbndHZfLVv8QNPsVqK+0BZKWhPrR0/yl7wz31ozZlZEVasKPCawjUVeSf2b8RB44I/Vz4 r7tzIRtXO7RuXNA/aGRJO6GdJ8K+iWh49u3SeazbiqSfu1hM1LPt2cptvRl0xw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644403001; a=rsa-sha256; cv=none; b=sIs9A0/rBrh3+I4tcE76eMAYOOmEM26I0zZCYj+5FMWKB4cHeJv/vy8ALPw7vTDjn4F9wn QXU6sYjjDlWCBb6uMpF1QMF4G4HeQIx4/BEoWhAt2n2vTyhmqyxltXzj09AH9prPvNhrIo +DN/j5dFOONPTQocNyr0V14r4gcdBl+VX4mCEE8CP1uEDE7sVP1aaa6r0ZMdj+QtJsuzal batC9jZB+yYSDpglqdUJKKMAClecs56tpnv0ePBpxpXcersbKwBZykUHWL/fnwbk6EUF3V BoX0L2lo/1QgK+j2eDRdRKuEIdhDGSZM6XgqRx+c7/v2XF+OollRAk/4sRAKLw== 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: -3.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: 3C71F474D1 X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: KjruixNj30uA Hi! Efraim Flashner skribis: > * guix/cpu.scm (cpu->gcc-architecture): Rewrite detection based on > detected feature flags. [...] > ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. > (or (and (=3D 6 (cpu-family cpu)) ;the "Pentium Pro" f= amily > - (letrec-syntax ((model (syntax-rules (=3D>) > - ((_) #f) > - ((_ (candidate =3D> integers ...)= rest > - ...) > - (or (and (=3D (cpu-model cpu) in= tegers) > - candidate) > - ... > - (model rest ...)))))) > - (model ("bonnel" =3D> #x1c #x26) > - ("silvermont" =3D> #x37 #x4a #x4d #x5a #x5d) > - ("core2" =3D> #x0f #x17 #x1d) > - ("nehalem" =3D> #x1a #x1e #x1f #x2e) > - ("westmere" =3D> #x25 #x2c #x2f) > - ("sandybridge" =3D> #x2a #x2d) > - ("ivybridge" =3D> #x3a #x3e) > - ("haswell" =3D> #x3c #x3f #x45 #x46) > - ("broadwell" =3D> #x3d #x47 #x4f #x56) > - ("skylake" =3D> #x4e #x5e #x8e #x9e) > - ("skylake-avx512" =3D> #x55) ;TODO: cascadelake > - ("knl" =3D> #x57) > - ("cannonlake" =3D> #x66) > - ("knm" =3D> #x85)))) > + (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 ...)))))) > + > + (if-flags ("avx" "avx512vp2intersect" "tsxldtrk" =3D> "s= apphirerapids") > + ("avx" "avx512vp2intersect" =3D> "tigerlake") > + ("avx" "avx512bf16" =3D> "cooperlake") > + ("avx" "wbnoinvd" =3D> "icelake-server") > + ("avx" "avx512bitalg" =3D> "icelake-client") > + ("avx" "avx512vbmi" =3D> "cannonlake") In current master, the logic is: if it=E2=80=99s an intel then pick the model ID if that didn=E2=80=99t work then do feature-based detection Here you=E2=80=99re removing the first part (using the Intel model ID) and extending the second part. Perhaps we could extend the second part but still keep the first one? The AMD detection code would have to go before the generic fallback case though. WDYT? Ludo=E2=80=99.