From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A6A37385843E; Wed, 19 Oct 2022 11:26:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6A37385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666178787; bh=R/BZFUuxxtmCiq8Yn9STz7gh+AagW+hoaRh8ceOaYz4=; h=From:To:Subject:Date:From; b=btp+LQ0lXKqRWeKEfQTp7dOdoqzbKfXIrcTIFeATSIMLr/BR1E+7brw6bm3NXw3Si Ywt6ABTFahboZte0W9CNaPE4XVU1pgMvMrZNRALEFMY+Bp/w72KfzmFLNP0k/a8x4t TlJ5Vu37tXfbLG3H9KdIIWeu9dVXetzmnQRbyob4= From: "zhongyunde at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107316] New: [aarch64] Init big const value should be improved compare to llvm Date: Wed, 19 Oct 2022 11:26:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhongyunde 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107316 Bug ID: 107316 Summary: [aarch64] Init big const value should be improved compare to llvm Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zhongyunde at huawei dot com Target Milestone: --- test case: https://godbolt.org/z/ahreYnahE ``` int main (int argc, char** argv) { if (lshift_1 (0xaaaa5555aaaa5555ull) !=3D 0ll) abort(); return 0; } ``` * gcc use 4 instructions ``` mov x0, 21845 movk x0, 0xaaaa, lsl 16 movk x0, 0x5555, lsl 32 movk x0, 0xaaaa, lsl 48 ``` * while llvm use 3 instructions: ``` mov x0, #6148914691236517205 movk x0, #43690, lsl #16 movk x0, #43690, lsl #48 ```=