Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qODAy-00795F-CO for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jul 2023 08:13:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qOD9y-00FGl9-Rs for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jul 2023 08:12:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOD9y-00FGkw-EF for pgsql-hackers@lists.postgresql.org; Tue, 25 Jul 2023 08:12:46 +0000 Received: from mail.loongson.cn ([114.242.206.163]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qOD9n-001Sfa-W6 for pgsql-hackers@lists.postgresql.org; Tue, 25 Jul 2023 08:12:44 +0000 Received: from loongson.cn (unknown [211.137.73.174]) by gateway (Coremail) with SMTP id _____8DxxPDrg79k0aMJAA--.24537S3; Tue, 25 Jul 2023 16:12:28 +0800 (CST) Received: from localhost (unknown [211.137.73.174]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx1szlg79kg1c6AA--.15584S2; Tue, 25 Jul 2023 16:12:22 +0800 (CST) From: huchangqi To: pgsql-hackers@lists.postgresql.org Cc: "John Naylor" , wengyanqing@ymatrix.cn, wanghao@ymatrix.cn Subject: Re: [PATCH] Add loongarch native checksum implementation. References: <87y1j45sz4.fsf@loongson.cn> Date: Tue, 25 Jul 2023 16:12:21 +0800 Message-ID: <87r0ow5s0q.fsf@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID:AQAAf8Cx1szlg79kg1c6AA--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Ik0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJV W8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07UNvtZU UUUU= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk -------------------- Start of forwarded message -------------------- From: huchangqi To: YANG Xudong Subject: Re: [PATCH] Add loongarch native checksum implementation. Date: Tue, 25 Jul 2023 15:51:43 +0800 Both cisticola and nuthatch are on the buildfarm now=E3=80=82 cisticola is "old world ABI". https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=3Dcisticola&br= =3DHEAD nuthatch is "new world ABI". https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=3Dnuthatch&br= =3DHEAD ---------- Best regards, huchangqi YANG Xudong writes: > On 2023/7/6 15:14, huchangqi wrote: >> Hi, i have a loongarch machine runing Loongnix-server (based on redhat/c= entos, it has gcc-8.3 on it), i am trying to test buildfarm on it, when i e= dit build-farm.conf it seems to need animal and secret to connect the build= farm server. >> then i go to https://buildfarm.postgresql.org/cgi-bin/register-form.pl,= and registered the buildfarm a week ago, but didn't receive any response.= so what else i need to do next. >>=20 >>=20 > > Is it possible to provide a build farm instance for new world ABI of=20 > loongarch also by loongson? It will be really appreciated. > > Thanks! > >>=20 >>> -----Original Messages----- >>> From: "YANG Xudong" >>> Send time:Wednesday, 07/05/2023 10:15:51 >>> To: "John Naylor" >>> Cc: pgsql-hackers@lists.postgresql.org, wengyanqing@ymatrix.cn, wanghao= @ymatrix.cn >>> Subject: Re: [PATCH] Add loongarch native checksum implementation. >>> >>> Is there any other comment? >>> >>> If the patch looks OK, I would like to update its status to ready for >>> committer in the commitfest. >>> >>> Thanks! >>> >>> On 2023/6/16 09:28, YANG Xudong wrote: >>>> Updated the patch based on the comments. >>>> >>>> On 2023/6/15 18:30, John Naylor wrote: >>>>> >>>>> On Wed, Jun 14, 2023 at 9:20=E2=80=AFAM YANG Xudong >>>> > wrote: >>>>> =C2=A0> >>>>> =C2=A0> Attached a new patch with fixes based on the comment below. >>>>> >>>>> Note: It's helpful to pass "-v" to git format-patch, to have different >>>>> versions. >>>>> >>>> >>>> Added v2 >>>> >>>>> =C2=A0> > For x86 and Arm, if it fails to link without an -march fla= g, we >>>>> allow >>>>> =C2=A0> > for a runtime check. The flags "-march=3Darmv8-a+crc" and >>>>> "-msse4.2" are >>>>> =C2=A0> > for instructions not found on all platforms. The patch also >>>>> checks both >>>>> =C2=A0> > ways, and each one results in "Use LoongArch CRC instructi= on >>>>> =C2=A0> > unconditionally". The -march flag here is general, not spe= cific. In >>>>> =C2=A0> > other words, if this only runs inside "+elif host_cpu =3D= =3D >>>>> 'loongarch64'", >>>>> =C2=A0> > why do we need both with -march and without? >>>>> =C2=A0> > >>>>> =C2=A0> >>>>> =C2=A0> Removed the elif branch. >>>>> >>>>> Okay, since we've confirmed that no arch flag is necessary, some other >>>>> places can be simplified: >>>>> >>>>> --- a/src/port/Makefile >>>>> +++ b/src/port/Makefile >>>>> @@ -98,6 +98,11 @@ pg_crc32c_armv8.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> =C2=A0=C2=A0pg_crc32c_armv8_shlib.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> =C2=A0=C2=A0pg_crc32c_armv8_srv.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> >>>>> +# all versions of pg_crc32c_loongarch.o need CFLAGS_CRC >>>>> +pg_crc32c_loongarch.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> +pg_crc32c_loongarch_shlib.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> +pg_crc32c_loongarch_srv.o: CFLAGS+=3D$(CFLAGS_CRC) >>>>> >>>>> This was copy-and-pasted from platforms that use a runtime check, so >>>>> should be unnecessary. >>>>> >>>> >>>> Removed these lines. >>>> >>>>> +# If the intrinsics are supported, sets >>>>> pgac_loongarch_crc32c_intrinsics, >>>>> +# and CFLAGS_CRC. >>>>> >>>>> +# Check if __builtin_loongarch_crcc_* intrinsics can be used >>>>> +# with the default compiler flags. >>>>> +# CFLAGS_CRC is set if the extra flag is required. >>>>> >>>>> Same here -- it seems we don't need to set CFLAGS_CRC at all. Can you >>>>> confirm? >>>>> >>>> >>>> We don't need to set CFLAGS_CRC as commented. I have updated the >>>> configure script to make it align with the logic in meson build script. >>>> >>>>> =C2=A0> > Also, I don't have a Loongarch machine for testing. Could = you >>>>> show that >>>>> =C2=A0> > the instructions are found in the binary, maybe using objd= ump and >>>>> grep? >>>>> =C2=A0> > Or a performance test? >>>>> =C2=A0> > >>>>> =C2=A0> >>>>> =C2=A0> The output of the objdump command `objdump -dS >>>>> =C2=A0> ../postgres-build/tmp_install/usr/local/pgsql/bin/postgres = =C2=A0| grep >>>>> -B 30 >>>>> =C2=A0> -A 10 crcc` is attached. >>>>> >>>>> Thanks for confirming. >>>>> >>>>> --=20 >>>>> John Naylor >>>>> EDB: http://www.enterprisedb.com >>> >>=20 >>=20 >> =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5=90=AB= =E6=9C=89=E9=BE=99=E8=8A=AF=E4=B8=AD=E7=A7=91=E7=9A=84=E5=95=86=E4=B8=9A=E7= =A7=98=E5=AF=86=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E9=99=90=E4=BA=8E=E5=8F= =91=E9=80=81=E7=BB=99=E4=B8=8A=E9=9D=A2=E5=9C=B0=E5=9D=80=E4=B8=AD=E5=88=97= =E5=87=BA=E7=9A=84=E4=B8=AA=E4=BA=BA=E6=88=96=E7=BE=A4=E7=BB=84=E3=80=82=E7= =A6=81=E6=AD=A2=E4=BB=BB=E4=BD=95=E5=85=B6=E4=BB=96=E4=BA=BA=E4=BB=A5=E4=BB= =BB=E4=BD=95=E5=BD=A2=E5=BC=8F=E4=BD=BF=E7=94=A8=EF=BC=88=E5=8C=85=E6=8B=AC= =E4=BD=86=E4=B8=8D=E9=99=90=E4=BA=8E=E5=85=A8=E9=83=A8=E6=88=96=E9=83=A8=E5= =88=86=E5=9C=B0=E6=B3=84=E9=9C=B2=E3=80=81=E5=A4=8D=E5=88=B6=E6=88=96=E6=95= =A3=E5=8F=91=EF=BC=89=E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84= =E4=BB=B6=E4=B8=AD=E7=9A=84=E4=BF=A1=E6=81=AF=E3=80=82=E5=A6=82=E6=9E=9C=E6= =82=A8=E9=94=99=E6=94=B6=E6=9C=AC=E9=82=AE=E4=BB=B6=EF=BC=8C=E8=AF=B7=E6=82= =A8=E7=AB=8B=E5=8D=B3=E7=94=B5=E8=AF=9D=E6=88=96=E9=82=AE=E4=BB=B6=E9=80=9A= =E7=9F=A5=E5=8F=91=E4=BB=B6=E4=BA=BA=E5=B9=B6=E5=88=A0=E9=99=A4=E6=9C=AC=E9= =82=AE=E4=BB=B6=E3=80=82 >> This email and its attachments contain confidential information from Loo= ngson Technology , which is intended only for the person or entity whose ad= dress is listed above. Any use of the information contained herein in any w= ay (including, but not limited to, total or partial disclosure, reproductio= n or dissemination) by persons other than the intended recipient(s) is proh= ibited. If you receive this email in error, please notify the sender by pho= ne or email immediately and delete it. -------------------- End of forwarded message --------------------