From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 484343858C39 for ; Wed, 14 Jun 2023 09:28:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 484343858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b1a66e71f9so5412941fa.2 for ; Wed, 14 Jun 2023 02:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686734884; x=1689326884; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2ECukoW/NkRuyK/waKX6dVi7E30Fm306bMDhCxRVTnk=; b=S6/XUbfqax5A9q1wVcayhkVasYBQRQBjkbCvDN2m/q/LfluRvJZKvE6qC/PXdYHlid BVRlxjeyD6VW4xecE85TXGImWlV+uCF0bubQz/gAq1GPoM0OD+4GNJBESQPdVAQ/zhGc U7Wef+JZ7s8eiISXi1vlNRsO8G4G8wcAjGhITUe4MVDIaWjEcUSDiXUo4nnz2mEx7Uc7 mwG4AKpbZ+CAWZenUq9HUCQIvQZCoccsMVHzunn/FbmeDAjnvTGkrDr96PTYjKQHznal e00TZqWhr2RuzwwfBNM+svJd1J5c/4ET59JdNqEanKRaOKLZwBYSHh6KVS8Aq41Adl+U 5bYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686734884; x=1689326884; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ECukoW/NkRuyK/waKX6dVi7E30Fm306bMDhCxRVTnk=; b=BiXmntnYO0356Eg6fpim0ONG212Y8iVFUKgq6+pJ2nE05iwqSgi75HGsPkX4OH7SVa OSCsTqzbwqPfjYJ9NjQmtQgYv5+S/WjJkz4fW+61KLhBazbj84K4v39UXwuyDDnPY/Cd cEjVRfQI15rB0jEdkmqnEmKpRnVH6uNrDzOLc41jDHEjw3yU35x7y3km8EohhofCPpQa 3gvY4VMG8k+ywrl56Q3TqUzmFK6BrE2IkDWGKlcUSdLGIlVmz43ahA2jMqfvqnAB8rbD 0TOjAJqSEa8J38obMGCw2csCZ/tlOux31MTeYt0u1Y8ynTBg1oC2q66wgr2bxeKVOOEa JmUg== X-Gm-Message-State: AC+VfDy1Pq6sPo50jTHpdq/ASg/lZzzUUg3RswitJjHaQzlpPvuAe4g+ GG3A7nYQmxVn2P2Z5oJLpa+jde7PdSIbaQlJA15jHdBGDA43UA== X-Google-Smtp-Source: ACHHUZ5UQQHjHWu2oFrecmyTKnzTw1Uq/EU0BkOlJTqYDU94mrfLF18JsnIThzhNjd+QirVd5vsNwe3RjWUtCkUVEVA= X-Received: by 2002:a2e:9948:0:b0:2ac:6f6f:ff63 with SMTP id r8-20020a2e9948000000b002ac6f6fff63mr6696997ljj.47.1686734884205; Wed, 14 Jun 2023 02:28:04 -0700 (PDT) MIME-Version: 1.0 References: <20230612083649.907511-1-chenfeiyang@loongson.cn> <09b1e6e3-0add-839e-1130-33bd1e40ccf0@loongson.cn> In-Reply-To: <09b1e6e3-0add-839e-1130-33bd1e40ccf0@loongson.cn> From: Feiyang Chen Date: Wed, 14 Jun 2023 17:27:51 +0800 Message-ID: Subject: Re: [PATCH] LoongArch: Add fcsr register names support To: mengqinggang Cc: Feiyang Chen , liuzhensong@loongson.cn, xuchenghua@loongson.cn, chenhuacai@loongson.cn, binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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, Jun 14, 2023 at 4:39=E2=80=AFPM mengqinggang wrote: > > I think forbid r4-r31 is a safer choice. > > To prevent the use of general registers (r0-r3) in the future, a warning > message can be output. > I agree with you. I will send v2 later. > > =E5=9C=A8 2023/6/14 =E4=B8=8B=E5=8D=883:28, Feiyang Chen =E5=86=99=E9=81= =93: > > On Wed, Jun 14, 2023 at 3:07=E2=80=AFPM mengqinggang wrote: > >> Because there are only fcsr0-fcsr3, whether fc_htab just append r0-r3= ? > >> > >> Any general register bigger than r3 is invalid? > >> > > I believe this is a good approach, similar to what LLVM appears to do. > > However, I'm not certain if there might be some code intentionally > > using r4, as the manual doesn't explicitly forbid its usage, only > > stating that doing so would result in undefined outcomes. > > > >> =E5=9C=A8 2023/6/12 =E4=B8=8B=E5=8D=884:36, Feiyang Chen =E5=86=99=E9= =81=93: > >>> + /* Add general purpose registers for backward compatibility. = */ > >>> + for (i =3D 0; i < ARRAY_SIZE (loongarch_r_normal_name); i++) > >>> + str_hash_insert (fc_htab, loongarch_r_normal_name[i], (void *) = (i + 1), > >>> + 0); >