This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 math/19974] optimize div() so the asm insn that calcs quotient and remainder is used when available


https://sourceware.org/bugzilla/show_bug.cgi?id=19974

--- Comment #7 from Daniel Gutson <daniel.gutson at tallertechnologies dot com> ---
(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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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