This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79219] Feature request: double width/single width -> single width integer division and remainder
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jan 2017 09:25:24 +0000
- Subject: [Bug c/79219] Feature request: double width/single width -> single width integer division and remainder
- Auto-submitted: auto-generated
- References: <bug-79219-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79219
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I must say I don't understand the need for an extension here.
The argument that there might not be a type twice as large as the largest
you've made in the high part multiply case (which doesn't make much sense
anyway, because I assume the reason you want that is that it is fast and that
will only be the case if it is at most word * word -> highpart of doubleword
and in that case you always have a type for the doubleword (__int128 for
64-bit, long long for 32-bit)) doesn't apply here, you need to have the double
word value to divide. So IMNSHO you should just write
long foo (__int128_t a, long b)
{
return a / b;
}
or similar and if the HW has instruction for such a divide, it can use it.