From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 9692E3858D1E for ; Thu, 18 Aug 2022 04:28:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9692E3858D1E Received: from [IPv6:240e:358:11b1:ee00:dc73:854d:832e:3] (unknown [IPv6:240e:358:11b1:ee00:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 60D6F6686A; Thu, 18 Aug 2022 00:28:06 -0400 (EDT) Message-ID: <2a6884217b6d3f2e9de9e95ed6c0fdea10958746.camel@xry111.site> Subject: Re: [PATCH v6] LoongArch: add addr_global attribute From: Xi Ruoyao To: Lulu Cheng , Hans-Peter Nilsson Cc: gcc-patches@gcc.gnu.org, Youling Tang , Chenghua Xu , Huacai Chen , Jinyang He , Wang Xuerui Date: Thu, 18 Aug 2022 12:27:55 +0800 In-Reply-To: <9d449d35-529b-a883-dce1-f1f441718000@loongson.cn> References: <6529f5cf76e4df3cdfb6c85ea9da962797f97437.camel@xry111.site> <9d449d35-529b-a883-dce1-f1f441718000@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2022 04:28:16 -0000 On Thu, 2022-08-18 at 11:54 +0800, Lulu Cheng wrote: > Sorry, I have already added the code of cmodel=3Dextreme, and I am sortin= g out the code and test cases. > I still insist on using __attribute__(model(extreme)) to describe the var= iables of precpu. > I will send my patch today. Ok, I can live with it. A possible enhancement (we can add it later or abandon it if it won't really produce any benefit): The address of a per-CPU variable is per_cpu_buf_addr + cpu_offset + var_offset Or, B + C + V as an abbreviation. Currently we have $r21 =3D C, and the faked address of per-cpu symbol is (B + V). As (B + V) is large, we have to use five (PC-rel) or four (Absolute) instructions to address it. But in the future we can make $r21 =3D B + C, and the faked address V. As V <=3D 2GiB we can add model(low) and use a lu12i/addi pair to address V. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University