From patchwork Mon Apr 15 19:24:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 1923867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=uxszdqMX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJHJP553sz1yZ2 for ; Tue, 16 Apr 2024 05:28:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D355D3858C98 for ; Mon, 15 Apr 2024 19:28:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 710B23858D32 for ; Mon, 15 Apr 2024 19:27:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 710B23858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 710B23858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713209268; cv=none; b=SRfr/9VF9Eb+F6odhMqQvvr+U7mj4y7TqRggHQCKrIu360TfxSUoEYHmB4ay+L+gDeXx8CMDgs4lke5uTxpXWrvu6bfiAmeaMkowdw+syW/NB7NAdnJbEmW+c093LwAIrvXYCRXK4dVmY8X+I0prDUseylH1Uw/tDIfvoJUaXOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713209268; c=relaxed/simple; bh=+ZFi+hP5oOLrQ1rPzFEhmN3DHKGL+6VT+/HsZ2zdUuY=; h=DKIM-Signature:Subject:Date:Message-ID:MIME-Version:From:To; b=qoSHtUnDheqSpTL1Jm8u9SwWsoBjPw35RWPFIxz+/DOJPf8Cm7aO5w9xYUsGmEVZAHsSBOohFyD1m87hHvSy9i6Wq11W7gf0uKtE+EkMFLUsGSB4LkBZwIyNA2ScHLemoe22OnE6om4xff6pX4PY2xgoSC1tFRilNNDDcX1JIxA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ed0e9ccca1so3294931b3a.0 for ; Mon, 15 Apr 2024 12:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713209265; x=1713814065; darn=sourceware.org; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=2Ds0BxBbN++BjOhmjNVz+P6nrL0U4LcThDqPB9QnZlg=; b=uxszdqMXsCJrVDTBjN/WFDQA44krxTPf+bGwS38qIFpaeXs9r38vzrYW7bQUIUYqM5 vOteD783ZSt01PWMY5YjdHLHDoMXMIKwRggRNiPd8HNN4woyviCBDryxxOw1ddHnf0l8 YmzsiB5biv1MsKsoxoH1O7/+ioQrgG2VNpL9oWdaBuof9aWmIAC+19Hz6atvdv7cVeLt QPU4c26DSVgs+W0O+/j03rung5Ux8cPvOI32DnUY7U7j5stHpyLTZ5A+iHxxc90QkQCm Blzo05msUK1+giZKGU/m0r1Ww5BsbB14Z7cC4p90SnQ8gc3u91ehPxKjLi3/PgQwOW2c ozsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209265; x=1713814065; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2Ds0BxBbN++BjOhmjNVz+P6nrL0U4LcThDqPB9QnZlg=; b=TnqzBHockwEV8iFH/bZzhLmvQ7yYULr+gZWEYzV9QggG4KEgtN1Wg6F4x4ahp+jCT+ aRJIZYqf51Bn5urWW+yO+D432oehS/Yrn4qV5grE2Cvq0uFtCyu5mCXUTehkE59EzJPx zPawDaIhqTKZmKhtCN8WkKMkEqXgvHWoc6KX7xCKn4u0wpyUVuhpshnCo/OkHGulnQab GBBMxLkp4mXBNKRpMcp+RqdTaCPnlzNJIdMSVMTdUIn5UO4/m05pFJtpTO02RWzpu5lJ 6SnTtk4kg37McsRvw17xaIlvJXkOUyW9IYhsY2xVJsWtF2XxFg+1pGCN5bKXUcXlVEFT j1lg== X-Gm-Message-State: AOJu0YwUwcFcP3ehAKGbhFSDLTQsy3Q1tc+AiqBUlvYvNtEbxp0CrXAe wHR8+8RC/AZvP1mEbLBbbTEeZs0wlbYUA06V+OwhDORUERG4d0EUwDD5i5mKWts= X-Google-Smtp-Source: AGHT+IEHqM3Ae5EzebbNIVn4qRm6vcIsfQ8aifT+rzVSy95p7NbsU9bEcdV8elHHXKXt9uYAEhkjFA== X-Received: by 2002:a05:6a21:4987:b0:1a6:b689:8c29 with SMTP id ax7-20020a056a21498700b001a6b6898c29mr9822906pzc.61.1713209265105; Mon, 15 Apr 2024 12:27:45 -0700 (PDT) Received: from localhost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id bm5-20020a056a00320500b006ecf6417a9bsm7658056pfb.29.2024.04.15.12.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:27:44 -0700 (PDT) Subject: [RFC] build-many-glibcs: Add a rv64gcbv-on-rv64gc/lp64d sub-variant Date: Mon, 15 Apr 2024 12:24:15 -0700 Message-ID: <20240415192414.14155-2-palmer@rivosinc.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: libc-alpha@sourceware.org X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Signed-off-by: Palmer Dabbelt --- So this is very much an RFC. I had written a commit message as This will hopefully be a widely used configuration in the future, but it's not all that common right now. That said, let's be proactive and at start testing it. but I even that's kind of a strong statement here so I'm just stashing it off to the side to be sure. A few of us were talking about the GCC meeting last week, but I figured I'd send a glibc patch to at least start some discussion on the lists as something similar had come up in the TLSDESC thread and a while ago when we talked about glibc-hwcaps. I'm not really sure what the right thing to do here is: we don't have broadly available hardware that supports these new extensions, but they're pretty much table stakes for hardware that's competitive with arm64/x86. Without B and V we're going to end up piling up a ton of IFUNC-based routines to try and work around the base ISA, but those extensions are so fundamental to good codegen that it doesn't feel like we're going to get where we want with just IFUNCs. Unfortunately I don't think we can drop support for the other base ISAs: the distros appear to be targeting rv64gc and that's the only common base for most hardware that's out there. I guess we could drop support for the rv*ima-based base ISAs, but I'm not sure that buys us much: we've got a lot of embedded users so we won't be able to drop the GCC support for soft float, and dropping the glibc support puts us in a clunky spot for testing. So we're probably stuck in a bit of a performance hole for a while. That said, we could at least put a stake in the ground and start testing some target with some newer extensions. That way distros that want to try a larger base than rv64gc have something that's getting tested and is thus likely to work. For GCC we ended up adding some test targets with pretty much all the non-embedded, but at least B and V seem like the bare minimum. I'm not sure if all that is worth the extra build/test resource burden for everyone, though, particularly given the lack of hardware. --- scripts/build-many-glibcs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index ecc743e672..21da46dc4a 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -411,7 +411,9 @@ class Context(object): os_name='linux-gnu', variant='rv64imafdc-lp64d', gcc_cfg=['--with-arch=rv64imafdc', '--with-abi=lp64d', - '--disable-multilib']) + '--disable-multilib']), + extra_glibcs=[{'variant': 'rv64gcbv-rv64gc-lp64d', + 'ccopts': '-march=rv64gcv_zba_zbb_zbs'}] self.add_config(arch='s390x', os_name='linux-gnu', glibcs=[{},