This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/79219] Feature request: double width/single width -> single width integer division and remainder


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]