From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 64E463858D35 for ; Fri, 8 Mar 2024 06:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64E463858D35 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 64E463858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709878934; cv=none; b=JMp4nfbasYJlHEQLlcLxcHbHffEgSOjGer+SXtAmrqGgci25jvHdPvJsIWIHi7oAN2YEUkLLV2AeKUo5Vr2DlRHxHcjfDqIP6vjPnRrpw7loMted/kcEjUu+enYlCSd2tY97M3wvsp3FPLGXX/bY5NUM8JiyTV8c7CQSHZDeetk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709878934; c=relaxed/simple; bh=Ma3lCf4uiaT1q0cbLGu/kmv/zjSL8WvrHlduM0f02QE=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=JN8OYRtwPG83jVLrYkwtw8Q+XPjM8KMhS1UsJHtB6jspEktLDLI0jigearYoakXEcM2TwvbpvJbYZShYsHmfC3+kUotlWGYjSvtOnjFk4ysyLjVT2hl42oYnInHt06yEzGb+DHwObUynBnej2Vf+wL49Ry/CY1blRYWOku3rDgs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1709878930; bh=Ma3lCf4uiaT1q0cbLGu/kmv/zjSL8WvrHlduM0f02QE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=CikuWg6TALwCBXJfbgY8wyZiD7q2FH3h+rV52OyT3fI4QzB1TdamfOq0SFx4kB5oq qqzopkdAoPZXMMJ7PN0rlXkWnFsg68U3pMxrSS0O+3VN8SUUz1vgfINNpkBnUad9i+ 2Fk2dN3/BeDRmqjXQqr18pCgjC6xqQ8JyKXi1ULQ= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (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 4847F66EB1; Fri, 8 Mar 2024 01:22:09 -0500 (EST) Message-ID: <4f47c4af1410462df24b4d7a3725ed03905b81f1.camel@xry111.site> Subject: Re: [PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi. From: Xi Ruoyao To: chenglulu , gcc-patches@gcc.gnu.org Cc: i@xen0n.name, xuchenghua@loongson.cn Date: Fri, 08 Mar 2024 14:22:07 +0800 In-Reply-To: References: <20240307011252.11808-1-chenglulu@loongson.cn> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,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 List-Id: On Thu, 2024-03-07 at 21:07 +0800, chenglulu wrote: >=20 > =E5=9C=A8 2024/3/7 =E4=B8=8B=E5=8D=888:52, Xi Ruoyao =E5=86=99=E9=81=93: > > It should be better to extend the expected value before the ll/sc loop > > (like what LLVM does), instead of repeating the extending in each > > iteration.=C2=A0 Something like: >=20 > I wanted to do this at first, but it didn't work out. >=20 > But then I thought about it, and there are two benefits to putting it in= =20 > the middle of ll/sc: >=20 > 1. If there is an operation that uses the $r4 register after this atomic= =20 > operation, another >=20 > register is required to store $r4. >=20 > 2. ll.w requires long cycles, so putting an addi.w command after ll.w=20 > won't make a difference. >=20 > So based on the above, I didn't try again, but directly made a=20 > modification like a patch. Ah, the explanation makes sense to me. Ok with the original patch then. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University