public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rsaxvc at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106484] Failure to optimize uint64_t/constant division on ARM32 Date: Mon, 01 Aug 2022 12:12:15 +0000 [thread overview] Message-ID: <bug-106484-4-I4jRFi10Wy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106484-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106484 --- Comment #3 from rsaxvc at gmail dot com --- > 32-bit division by constant relies on a 32x32->64 bit multiply. I believe only the upper half of the bits are required for the product to represent the integer component of the quotient. This makes parameter passing much easier in the uint64_t/constant case. > We don't have an instruction for that on arm nor does gcc support 128-bit integer types on a 32-bit compiler. I ran into that as well. The attached uint64_t umulh( uint64_t a, uint64_t b ) implements a 64x64->64MSBsOf128BitProduct using only 32x32->64 bit multiplication, 64-bit addition, and register-aligned shifting.
next prev parent reply other threads:[~2022-08-01 12:12 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-30 18:38 [Bug target/106484] New: " rsaxvc at gmail dot com 2022-07-30 18:39 ` [Bug target/106484] " rsaxvc at gmail dot com 2022-07-30 22:29 ` pinskia at gcc dot gnu.org 2022-08-01 10:50 ` rearnsha at gcc dot gnu.org 2022-08-01 12:12 ` rsaxvc at gmail dot com [this message] 2023-05-04 12:55 ` rsaxvc at gmail dot com 2023-07-08 18:10 ` rsaxvc at gmail 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-106484-4-I4jRFi10Wy@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).