public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "zhongyunde at huawei dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107090] New: [aarch64] sequence logic should be combined with mul and umulh Date: Thu, 29 Sep 2022 17:51:35 +0000 [thread overview] Message-ID: <bug-107090-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107090 Bug ID: 107090 Summary: [aarch64] sequence logic should be combined with mul and umulh 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/x5jMhqW8s ``` # define BN_BITS4 32 # define BN_MASK2 (0xffffffffffffffffL) # define BN_MASK2l (0xffffffffL) # define BN_MASK2h (0xffffffff00000000L) # define BN_MASK2h1 (0xffffffff80000000L) # define LBITS(a) ((a)&BN_MASK2l) # define HBITS(a) (((a)>>BN_BITS4)&BN_MASK2l) # define L2HBITS(a) (((a)<<BN_BITS4)&BN_MASK2) void mul64(unsigned long in0, unsigned long in1, unsigned long &l, unsigned long &h) { unsigned long m, m1, lt, ht, bl, bh; lt = LBITS(in0); ht = HBITS(in0); bl = LBITS(in1); bh = HBITS(in1); m = bh * lt; lt = bl * lt; m1 = bl * ht; ht = bh * ht; m = (m + m1) & BN_MASK2; if (m < m1) ht += L2HBITS((unsigned long)1); ht += HBITS(m); m1 = L2HBITS(m); lt = (lt + m1) & BN_MASK2; if (lt < m1) ht++; l = lt; h = ht; } ``` * The above source is equel to an mull operater for two 64bits integer vaules, so it should be fold to similar assemble ``` mul x8,x1,x0 umulh x9,x0,x1 str x8,[x2] str x9,[x3] ret ```
next reply other threads:[~2022-09-29 17:51 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-29 17:51 zhongyunde at huawei dot com [this message] 2022-09-29 17:55 ` [Bug middle-end/107090] " pinskia at gcc dot gnu.org 2022-09-29 21:32 ` [Bug tree-optimization/107090] " pinskia at gcc dot gnu.org 2022-10-01 23:42 ` zhongyunde at huawei dot com 2022-10-01 23:51 ` pinskia at gcc dot gnu.org 2022-10-07 9:44 ` zhongyunde at huawei dot com 2022-10-10 4:22 ` zhongyunde at huawei dot com 2022-10-10 4:30 ` pinskia at gcc dot gnu.org 2022-10-10 9:49 ` zhongyunde at huawei dot com 2022-10-12 13:36 ` zhongyunde at huawei dot com 2022-10-12 21:33 ` pinskia at gcc dot gnu.org 2022-10-13 2:57 ` zhongyunde at huawei dot com 2022-10-29 1:54 ` zhongyunde at huawei dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107090-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).