|
Message-ID: <20210301192646.GA2766@voyager> Date: Mon, 1 Mar 2021 20:26:46 +0100 From: Markus Wichmann <nullplan@....net> To: musl@...ts.openwall.com Subject: Re: [PATCH v2 2/2] Use modulo instead of mul+sub in __secs_to_tm On Sun, Feb 28, 2021 at 07:58:27PM +0000, Jon Chesterfield wrote: > Note that module coming for free with division doesn't make it cheap. > Integer division is far more expensive that integer multiply on ~ every > architecture. Several architectures implement division in software. It's > not cheap on x86, despite the dedicated instruction. > > Cheers And then there's PowerPC, which does have a divide instruction but no modulo. The manual explicitly states that if you need a modulo, you are supposed to divide, multiply, and subtract. Ciao, Markus
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.