This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/19974] optimize div() so the asm insn that calcs quotient and remainder is used when available
- From: "daniel.gutson at tallertechnologies dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 20 Apr 2016 21:32:47 +0000
- Subject: [Bug math/19974] optimize div() so the asm insn that calcs quotient and remainder is used when available
- Auto-submitted: auto-generated
- References: <bug-19974-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19974
--- Comment #8 from Daniel Gutson <daniel.gutson at tallertechnologies dot com> ---
(In reply to Daniel Gutson from comment #7)
> (In reply to Adhemerval Zanella from comment #6)
> > The idea of implementing it as builtin in gcc is to not only allow writing
> > code with __builtin_div, but also make gcc understand 'div' as a operation
> > it can lower directly (as mostly target do with memset and memcpy when used
> > with defined constraints).
> >
> > I would just avoid adding these kind of optimization in headers because
> > carrying such implementation adds complexity and burden maintainability.
> > Also if when gcc eventually supports it, it will be redundant.
>
> OK but there is one bit I don't understand: even if I implement the builtin,
> shouldn't it be called from the header file anyway in order to avoid the
> call?
I found the answer in https://sourceware.org/bugzilla/show_bug.cgi?id=19974#c5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70742 created. Anyway please keep
this issue open until reaching consensus with the gcc maintainers.
--
You are receiving this mail because:
You are on the CC list for the bug.