www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Special integer operations

reply IGotD- <nise nise.com> writes:
I'm trying to find if D has any built in special integer 
operations like bit reverse, population count, count leading 
zeroes, count trailing zeroes. Many ISAs have dedicated 
instructions for these kinds of operations. I haven't found any 
of these in the documentation, either implemented as fallback D 
code or working directly on the ISA instructions.

Do these exist or do you have to create these yourselves or 
resort to compiler intrinsics?
Oct 28 2019
parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 10/28/2019 03:20 PM, IGotD- wrote:
 I'm trying to find if D has any built in special integer operations like 
 bit reverse, population count, count leading zeroes, count trailing 
 zeroes.
https://dlang.org/phobos/core_bitop.html Ali
Oct 28 2019