From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 774BA3858CD1 for ; Wed, 20 Dec 2023 18:41:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 774BA3858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 774BA3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703097673; cv=none; b=aDZ5g0k3Yo4c0r4rBBHj8VOa4cJM0ld8KmY84K9Gw2qiHn3D7xdwfAd85m/JqnZoIrEX2jCqrMofRqcABE438yQ/garlaDvdieJVnN0un2+KzkFBJihD24kERfxpsRzJS0WGQT3atcOMuk5lKkZVGbz23t35s9dLqFv0/vrHm1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703097673; c=relaxed/simple; bh=BPQEvI2jW169WUt4pjaai3tgwWVYS8TFKbWsIZgg76E=; h=DKIM-Signature:Date:Subject:From:To:Message-ID:Mime-Version; b=I3uDHszPMKqDbELA6GniU5dB1YWRcJoqcmuFhDJ66oBflLYtlKLEE5NNZLxux2/4qcrgtY/OHlFgCJz1WcnkI7tqYN+ks9h89t8pB3gCZ96uYySLyETVyD4bOsatjrftPX9ZJBMOvdeogOrbZHLsqKF5AcDU8hdypT0luMFNaBQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6d2350636d6so5208617b3a.2 for ; Wed, 20 Dec 2023 10:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1703097669; x=1703702469; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=5oLwR8bPDbBB19efOnUvIAbAGzQts+oVcqCQXhOigLQ=; b=SVvnFKiYMprTaKb2QWDxofbpiahbQmBYWOzdngJYqG2Fda76frvgU7Ybl0KxthKBSM iGpqGxbO1Ol1CEPBiIcOz5O8uhC5jwyy6Ms/p36e3u8HXVK9CCx0esWG/sMQtExeVHEd IlM343HEvAjV/7H8Y5HFFJxDV7V0oAiWFNm7HpmgZcF8SfpOhTK4tGSMN/cGGxqGShAH HZN8yat/R1DRApWEqlxR2bobwBQKfKPErZH2cR/6QlRqlQkroK0dCqpRHb7z5Jew+EQJ i731PZOJmuXkGZFv5w4sSwSsoSJ+JVHSIN7jBz7WdLVOzS4Z5J9eq0eERBJ//fS2QBUG FRIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703097669; x=1703702469; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5oLwR8bPDbBB19efOnUvIAbAGzQts+oVcqCQXhOigLQ=; b=AqAdXoPsoLZv0GuXYS653nNLqTaSnCjYo56sjZDUaAopGrL5MHU0sJSXbPBBf310mL say0WR0Kce/ZyLUflw2TFKDRA6dCt6J6UHwTS+wJvowAu0cWDWsYvASc77kCn5u0pjiH rfRMh+LiDFTQdhv7Env9EZGmGBXoqptpuQsQ0kCdAFYWDnY5T/KrOcxSE8brABlm3VId 1jHRG2212140gGJSK4PLoAmBsiz504Vsc5bpzgCqoi6qRgzxTbCIiKtM2zjhT7F0paTu vaIDwhmdfN4fwMO+FOQ0mMx/vwKba2WSObbbAZ904SQKB/6p7jzz+7kLCiVsN8niNlWM 2vsg== X-Gm-Message-State: AOJu0YwXhP5XWRi/eJ3iiMYfZK0nYieQR0sMAqgLf6aEhPEHZadqi3Ds yO+peZNG/qgbEa1L1BlYc3ySHw== X-Google-Smtp-Source: AGHT+IHaJ/uD8uUFs3vM8PgmctW3zeCxoLPjmZ3gFsdi3cpgar/7in3kuZrcATSMoMaombwXtYxf4Q== X-Received: by 2002:a05:6a20:411f:b0:194:9567:45c5 with SMTP id y31-20020a056a20411f00b00194956745c5mr101288pze.9.1703097669248; Wed, 20 Dec 2023 10:41:09 -0800 (PST) Received: from localhost ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id t20-20020a056a00139400b006c4d128b71esm89041pfg.98.2023.12.20.10.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 10:41:08 -0800 (PST) Date: Wed, 20 Dec 2023 10:41:08 -0800 (PST) X-Google-Original-Date: Wed, 20 Dec 2023 10:41:01 PST (-0800) Subject: Re: [RFC][V2] RISC-V: Support -mcmodel=large. In-Reply-To: CC: Patrick O'Neill , best124612@gmail.com, gcc-patches@gcc.gnu.org, Kito Cheng From: Palmer Dabbelt To: jeffreyalaw@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 20 Dec 2023 10:25:00 PST (-0800), jeffreyalaw@gmail.com wrote: > > > On 12/20/23 11:21, Palmer Dabbelt wrote: > >>> Yea, the implementation relies largely on just pushing stuff into the >>> constant pool, so we're largely independent ABI stuff with the likely >>> exception being relocations. >> >> Ya, but I think we'd only need the relocations if we were going to try >> relaxing stuff.  We'd kicked around some ideas there: we could >> de-duplicate constant pools or inline smaller constants.  That's all way >> to complex to try and get into this upcoming binutils release, though >> (doubly so with this LEB128 ABI break we're still trying to deal with). > Agreed. And note that de-duplication is mostly implemented without need > for the target to do anything. I was kindof amazed to see some of the > places it kicked in on other ports I've worked with. I think all we'd need from GCC is some way to get the "this load is a constant pool address that can be messed with" relocation in there, the linker would do all the heavy lifting. That's probably just a new assembler pseudo, so pretty much nothing on the compiler side of things. >>> In theory (and I did not test this), it should be possible to use large >>> code model codegen in a smaller mode and it should interoperate.  I >>> seriously pondered doing that as an additional test, then figured I had >>> other higher priority items on my list. >> >> IMO we should test that.  At least the common case of a medlow libc >> linked into medany programs should be easy. >> >> +Patrick: let's add some configs to the CI for this? > I was pondering a one-off by turning on the large code model by default, > then doing a bootstrap & regression test in QEMU. But integrated into > CI is even better. OK, let's just add it to CI -- it'd be essentially the same testing, just it'll stick around. > > Jeff