question regarding div / std::div implementation

Mike Frysinger vapier@gentoo.org
Wed Apr 20 20:27:00 GMT 2016


On 20 Apr 2016 16:44, Daniel Gutson wrote:
>    is there any reason that std::div / cstdlib div is not implemented
> in such a way that it is expanded to
> the assembly instruction -when available- that calculates both the
> remainder and the quotient,
> e.g. x86' div ?
> 
> For example, why not an inline function with inline assembly? Or,
> should this require a gcc built-in?

sounds like an optimization for gcc rather than hacking something at the
cpp level.  you could post to the gcc-help@ list and they would know best.
	https://gcc.gnu.org/ml/gcc-help/
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160420/efea2cdc/attachment.sig>


More information about the Libc-alpha mailing list