From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by sourceware.org (Postfix) with ESMTPS id B179B3858CD1 for ; Wed, 20 Dec 2023 21:13:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B179B3858CD1 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 B179B3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703106834; cv=none; b=D5uYt7DcfG/vh7GEndwzp6oS+DGyraHRrc5NdrhkGUPsL4DW6YOnIH0HPCD3B+TXMs+0oxNw9eb5ianmDYm7a2mQpb+DINli0zUZ4HISPQRL4oP68uiqEO4pDAwRn+oTP/GEZ6JTNiUL5HI8oU/a/GIp3mjXYKcYcDia7jJv1Zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703106834; c=relaxed/simple; bh=8EYEit2/raIqa8XtGh9sJeEafi6QnExdnp4179KhY5o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=kBBDBDvSstP2831QQwcaHgELHlI/ZIt9ss9BTDsnkY46O6BSH0DnSXaP3H/gZqTH4kM/Ie6XDSxazjnWxH2bwDI1YSNxPFEZPMkjnKdAjTKfCJOLUH2RRmB8TcDeHanVsfnjSiB0kAmqq3VyLX+ojM5KsMry3alMmUwQYvQmE2Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-593fbe8147fso78802eaf.2 for ; Wed, 20 Dec 2023 13:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1703106832; x=1703711632; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lkfwngsqNsclNEWz1e3rqZ2IHeWDTY1TIdLJzusXrCo=; b=ATmmE5fCsTPk6zFPm5kCrUIIJPIj0eNUxTlKSeZovOCa3+NWaQduFAv5zQQI8lFdeM bW373UpUKZYfsI0zSyn19Q5PHcbsqVa/IncdxX60dTMTh/A6TyMUsc3iJm9d/B9qB0lK 7EuTfFjb0CS5oRRv7s7xxMr93cRvMdvzDVT7VPYht+dF7dn+AYuU/GvqAm2BBTeflzrW /YF+4Rlm2ue6Gd2SjTs1erJ8vExfHmGd1m8MtBnMDY5fkLgetsPBElQrpfAdGlIE+3pq syqY441bdAu4V/gxZzktwQsCZcmF2DubUqk/Q5HXADWnPGOb+CfZyUC1H74axGGCB9h3 VqMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703106832; x=1703711632; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lkfwngsqNsclNEWz1e3rqZ2IHeWDTY1TIdLJzusXrCo=; b=tNDlizxnrA94oCy5aOtrEHVxXZN3tf9W8fMZ0ZrPDJYsEMHtnjBE7Fa555NbtjLm/9 UL7TywFgt5WrSja+nVRDL2Slfj4zkvEnm29N2wDJRbPbv1EGHryoyU3Y6PCJ0ov/O1g/ M/w/QK68ZzvEgrcrSUIP/WdiMoe9cYTAzcmM+J74XhliI0iKWaQy1fXt8tY03uGOOt+X JNUePAidwA3ovJfO6/dHrGAWyqEcsRAeNY88NcO7dxX50aImgPpPEY2AsXZYPeecj1zC wVO/f+CXWvL6rrZYIvVqrDN82zZeU6UuhISbz2R24RoYc2LBdO+4EK3ix8cNxZ0nfv4D nBsA== X-Gm-Message-State: AOJu0YyEtoSTzgPXHAvaWsmPQ+9E/EVVoqhKYFkJaljfbKHQOnY5aJ71 HhIs9f+/uICRDXtse/NA6f4ppw== X-Google-Smtp-Source: AGHT+IGleN8fzA186Tj4U5tcOBCjNtU+3YwSErqrA86yzQe1C3wcvVeXmj5FMDdHLG8RQEPDsDlFsw== X-Received: by 2002:a05:6358:d08f:b0:170:50f4:447a with SMTP id jc15-20020a056358d08f00b0017050f4447amr359718rwb.48.1703106831997; Wed, 20 Dec 2023 13:13:51 -0800 (PST) Received: from [10.0.17.156] ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id h24-20020a631218000000b005c6746620cfsm224034pgl.51.2023.12.20.13.13.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Dec 2023 13:13:51 -0800 (PST) Message-ID: <60bda519-e391-447a-affe-75037e189a46@rivosinc.com> Date: Wed, 20 Dec 2023 13:13:50 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC][V2] RISC-V: Support -mcmodel=large. Content-Language: en-US To: Palmer Dabbelt , jeffreyalaw@gmail.com Cc: best124612@gmail.com, gcc-patches@gcc.gnu.org, Kito Cheng References: From: Patrick O'Neill In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 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 12/20/23 10:41, Palmer Dabbelt wrote: > 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. ACK :) Patrick > >> >> Jeff