Bitwise rotate of integral

Johan Engelen j at
Tue Jan 8 10:37:55 UTC 2019

On Monday, 7 January 2019 at 14:39:07 UTC, Per Nordlöw wrote:
> What's the preferred way of doing bitwise rotate of an integral 
> value in D?
> Are there intrinsics for bitwise rotation available in LDC?

LDC does not expose this intrinsic currently, but you can use 
LLVM's fshl:
It's a fairly new intrinsic, so won't work with older LLVM 

As noted by others, the optimizer is strong enough to recognize 
what you are doing (without intrinsic) and use ror/rol if it 
deems it advantageous to do so.


More information about the Digitalmars-d-learn mailing list