From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13616 invoked from network); 15 Aug 2023 09:33:08 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 15 Aug 2023 09:33:08 -0000 Received: (qmail 8104 invoked by uid 550); 15 Aug 2023 09:33:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 8072 invoked from network); 15 Aug 2023 09:33:04 -0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ayaya.dev; s=key1; t=1692091973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wllBDgfFhwmYqgzZSfARJ7WXk9K8bEFyUZ4VCmvH8zo=; b=OvfBwrLK//fqtPHUtRR95njVt1epl1Yrf4tMMibG9SIV976ud8NCqx+OJAmG/axXBHGrDb pA+dQiMgRWxCjhie4ZTWZpVnaaSG5ivX6AuZAs1Pg75jCJ2IUwlgr/hWMqCZsiiiKHvmE3 wc2UefgCBvB4SVBSxRXDaAgk5ZP0zhU= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 15 Aug 2023 09:32:52 +0000 Message-Id: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "alice" To: References: <20230418093844.GP3630668@port70.net> <0fd19586-376c-14ec-a50b-8c561f9f82f2@loongson.cn> <72a1a5d1-6f57-9a12-7775-84e1ff2c1df2@loongson.cn> <64955faf-c213-34bf-c7e2-691064da51f9@loongson.cn> <968652d9-3780-0843-908e-f21bc93b6ee1@loongson.cn> <320c8444.bb9a.189c45903f8.Coremail.zhaixiaojuan@loongson.cn> <20230805154307.GS4163@brightrain.aerifal.cx> <20230813014109.GU4163@brightrain.aerifal.cx> <278c595b-10fb-2180-b634-6bbcbd5a2614@loongson.cn> In-Reply-To: <278c595b-10fb-2180-b634-6bbcbd5a2614@loongson.cn> X-Migadu-Flow: FLOW_OUT Subject: Re: [musl] add loongarch64 port v7. On Tue Aug 15, 2023 at 9:24 AM UTC, Hongliang Wang wrote: > > > In fenv.S: > >=20 > >> ++#ifdef __clang__ > >> ++#define FCSR $fcsr0 > >> ++#else > >> ++#define FCSR $r0 > >> ++#endif > >=20 > > It's not clear to me what's going on here. Is there a clang > > incompatibility in the assembler language you're working around? Or > > what? If so that seems like a tooling bug that should be fixed. > >=20 > The GNU assembler cannot correctly recognize $fcsr0, but the > LLVM IAS does not have this issue, so make a distinction. > This issue has been fixed in GNU assembler 2.41. but for compatible > with GNU assembler 2.40 and below, $r0 need reserved. > > The linux kernel also has a similar distinction: the kernel patch checks if the assembler supports fcsr, and then uses that,= or falls back to r. in this case, you only check for ifdef clang- which means even with binutil= s 2.41, it will not use fcsr (__clang__ is not defined). don't you need to pe= rform a similar test, so clang or binutils>=3D2.41 both use the top path? most li= kely, you need a ./configure test. > > commit 38bb46f94544c5385bc35aa2bfc776dcf53a7b5d > Author: WANG Xuerui > Date: Thu Jun 29 20:58:43 2023 +0800 > > LoongArch: Prepare for assemblers with proper FCSR class support > > The GNU assembler (as of 2.40) mis-treats FCSR operands as GPRs, but > the LLVM IAS does not. Probe for this and refer to FCSRs as"$fcsrNN" > if support is present. > > Signed-off-by: WANG Xuerui > Signed-off-by: Huacai Chen >