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 D5B913858C54 for ; Mon, 20 Nov 2023 01:51:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5B913858C54 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 D5B913858C54 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=1700445084; cv=none; b=phIQv/DIjVRSEyOeg+utX9Er9AF274/l8gNeltxQNHrGK+23zhS2lqzjhVCjmomaLEnhTOzLZcUyFHoj5WrS8CDHjucRw8Y+g5Tqb+eiKXrIwSyARF5aM94RF9oknH6GXGVaDP1DjXniiRnZG899RdZSIkzciVR1YokZnbE5NC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700445084; c=relaxed/simple; bh=M+GHkwOOw5FcPR/p6sJUDzzLdPlIfnfReMA7Bfbz0YA=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=qiBsLWBPWOAfu1oA/YAv0l+2EfJR9dVxGJGiwi2lTUapaevM3Ff/hpCepQqihtDoIT9/8zj8/1qfK5iildXcoKMnO4LQ+o9A2FRDTXaYW8nt7x2vPnKcwR/bJ6+3wwpKeosfNYthx14XEe8z8OWAesERi689xjUU2oCi+jCqL7w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1700445081; bh=M+GHkwOOw5FcPR/p6sJUDzzLdPlIfnfReMA7Bfbz0YA=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=kLfhr0J+BIsiYAsF7NxjYVQasBg+ysS1qSf6q66G5ZLQ7YJ68OxgUMOkYoELrIYMs u9iv4AItATxbGwZLauQWPEEajaLB+a1t4Ly8PDgNMWdv7Uba01PsEAsabAEk4hTN2N FQ8dh7pL/kB637jrpiMQtBbdEDxcJaPuWbWyrgOo= 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 680F266B39; Sun, 19 Nov 2023 20:51:20 -0500 (EST) Message-ID: <07e40cebfbae358acb97c17b2390d202a3124cfc.camel@xry111.site> Subject: Re: [pushed][PATCH v2] LoongArch: Add code generation support for call36 function calls. From: Xi Ruoyao To: chenglulu , gcc-patches@gcc.gnu.org Cc: i@xen0n.name, xuchenghua@loongson.cn Date: Mon, 20 Nov 2023 09:51:18 +0800 In-Reply-To: References: <20231116072745.6177-1-chenglulu@loongson.cn> <4a04776c-810d-5c3c-6132-646cf52fbe5c@loongson.cn> <2efc73688c6891980d84cd7cd0cbc66bc5283b1f.camel@xry111.site> 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.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 Mon, 2023-11-20 at 09:09 +0800, chenglulu wrote: >=20 > =E5=9C=A8 2023/11/19 =E4=B8=8A=E5=8D=881:24, Xi Ruoyao =E5=86=99=E9=81=93= : > > On Sat, 2023-11-18 at 16:16 +0800, chenglulu wrote: > > > Pushed to r14-5567. > > >=20 > > > =E5=9C=A8 2023/11/16 =E4=B8=8B=E5=8D=883:27, Lulu Cheng =E5=86=99=E9= =81=93: > > > > When compiling with '-mcmodel=3Dmedium', the function call is made = through > > > > 'pcaddu18i+jirl' if binutils supports call36, otherwise the > > > > native implementation 'pcalau12i+jirl' is used. > > > >=20 > > > > gcc/ChangeLog: > > > >=20 > > > > * config.in: Regenerate. > > > > * config/loongarch/loongarch-opts.h (HAVE_AS_SUPPORT_CALL36): Defi= ne macro. > > > > * config/loongarch/loongarch.cc (loongarch_legitimize_call_address= ): > > > > If binutils supports call36, the function call is not split over e= xpand. > > > > * config/loongarch/loongarch.md: Add call36 generation code. > > > > * config/loongarch/predicates.md: Likewise. > > > > * configure: Regenerate. > > > > * configure.ac: Check whether binutils supports call36. > > With this change I get some test failures with "old" Binutils 2.41: > >=20 > > FAIL: gcc.target/loongarch/func-call-medium-1.c scan-assembler test:.*l= a.global\\t.*g\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-1.c scan-assembler test1:.*= la.global\\t.*f\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-1.c scan-assembler test2:.*= la.local\\t.*l\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-2.c scan-assembler test:.*l= a.global\\t.*g\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-2.c scan-assembler test1:.*= la.local\\t.*f\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-2.c scan-assembler test2:.*= la.local\\t.*l\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-3.c scan-assembler test2:.*= la.local\\t.*l\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-4.c scan-assembler test1:.*= la.local\\t.*f\\n\\tjirl > > FAIL: gcc.target/loongarch/func-call-medium-4.c scan-assembler test2:.*= la.local\\t.*l\\n\\tjirl > >=20 > > Some strange thing is happening: with -mexplicit-relocs=3Dauto or alway= s I > > get pcalau12i + jirl as expected, but with -mexplicit-relocs=3Dnone I g= et > > "pcaddu18i $r1,%call36(g)" and jirl.=C2=A0 This seems irony (!). > >=20 > Thank you for the revision. Then I'll push https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637153.html if this is an approval? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University