3 ms·
Java has Integer.numberOfLeadingZeros(), which I suspect exposes LZCNT where available.
by marginalia_nu 5y ago
Java has Integer.numberOfLeadingZeros(), which I suspect exposes LZCNT where available.
- Const-me 5y agoYeah, and where not available Java probably uses BSR instruction which does the same thing but introduced in i386 (1985): https://www.felixcloutier.com/x86/bsr https://www.felixcloutier.com/x86/bsr