Wiljan
Junior Member level 3
I do work on some software in c++ in MSVS express 2013 where I need to rotate a lot and as fast as possible.
so in C, C++ and probably many other langue you can write
A=B >> 5 ... and then B will rotate 5 times right and store it in A.
But what does actually happens under the hood?
The c code will be compiled to asm and probably use a SHR which only rotate reg 1 bit at a time so now you will have some loop counting from 5 to 0 .... not so quick.
if you are on a intel x64 PC and you could end up with SHDL which can accept the rotate value... so my question are will it tale the same time to rotate different values ?like
A=B >> 5
A=B >> 27
A=B >> 8
Any good suggestions for fast rotaing?
so in C, C++ and probably many other langue you can write
A=B >> 5 ... and then B will rotate 5 times right and store it in A.
But what does actually happens under the hood?
The c code will be compiled to asm and probably use a SHR which only rotate reg 1 bit at a time so now you will have some loop counting from 5 to 0 .... not so quick.
if you are on a intel x64 PC and you could end up with SHDL which can accept the rotate value... so my question are will it tale the same time to rotate different values ?like
A=B >> 5
A=B >> 27
A=B >> 8
Any good suggestions for fast rotaing?