This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70742] New: Add a builtin for obtaining a quotient and remainder of an integer division
- From: "daniel.gutson at tallertechnologies dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Apr 2016 21:29:46 +0000
- Subject: [Bug c/70742] New: Add a builtin for obtaining a quotient and remainder of an integer division
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70742
Bug ID: 70742
Summary: Add a builtin for obtaining a quotient and remainder
of an integer division
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: daniel.gutson at tallertechnologies dot com
Target Milestone: ---
Created attachment 38318
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38318&action=edit
example with disassembly listing
This idea has been originated here
https://sourceware.org/ml/libc-alpha/2016-04/msg00503.html
and later from here
https://sourceware.org/bugzilla/show_bug.cgi?id=19974
Due to suggestions in both the libc-alpha mailing list and in the glibc issue
tracker, I created this issue here as a compiler enhencement.
Basically the idea is to create the __builtin_div builtins family, so they
finally get translated to a single asm insn (if available) that calculates both
the quotient and the remainder. I attach the same file that is attached in the
glibc's bug tracker.
The goal is that std::div and cstdlib's div can be reimplemented as calling
this builtin.