From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9BFCE386F45A; Wed, 27 May 2020 12:38:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BFCE386F45A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590583087; bh=j1rWHofE13fNp31+OUfQhe/7ZKlZQ4LqpRiVtkOgO4I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UCEo7JUsGKvz597USvETP/5d81aImHk7it1TtvckP12WSn4nibhbsyDW9YpZRYltm tP4ElQK4L2tFOoPlXYuj7teztYJ3QZRLmM5ZMZ7FptnPuq/EH29PjTNWk5qullUM0b /6RPyT2lqsKXbjP0bZ5LG/t1acdSgSSPo5nygsLU= From: "bule1 at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95285] AArch64:aarch64 medium code model proposal Date: Wed, 27 May 2020 12:38:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bule1 at huawei dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 12:38:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95285 --- Comment #11 from Bu Le --- > You're right, we need an extra add, so it's like this: >=20 > adrp x0, bar1.2782 > movk x1, :high32_47:bar1.2782 > add x0, x0, x1 > add x0, x0, :lo12:bar1.2782 >=20 > > (By the way, the high32_47 relocation you suggested is the prel_g2 in t= he > > officail aarch64 ABI released) >=20 > It needs a new relocation because of the ADRP. ADR could be used so the > existing R__MOVW_PREL_G0-3 work, but then you need 5 instructions. So you suggest a new relocation type "high32_47" to calculate the offset between ADRP and bar1. Am I right? > > And in terms of engineering, you idea can save the trouble to modify the > > linker for calculating the offset for 3 movks. But we still need to mak= e a > > new relocation type for ADRP, because it currently checking the overflo= w of > > address and gives the "relocation truncated to fit" error. Therefore, b= oth > > idea need to do works in binutils, which make it also equivalent. >=20 > There is relocation 276 (R__ADR_PREL_PG_HI21_NC). Yes, through, we still need to make a change to compiler so when it comes to medium code model, ADRP can use R__ADR_PREL_PG_HI21_NC relocation.=