by Coding_Cat · 9y ago · 0 comments
You can do so, but on modern processors it's ~4 cycles to access the L1 cache and
return 175 & id & ((id ^ 173) + 11)
takes 3 cycles (cylce 1, do the first & and the ^; cycle two, do the +; cycle 3, do the second &).This makes sense as the clock is also somewhat of the 'driving force' for pushing signals through the chip from one part to the other. (some architectures have 'zero cost' operations I believe, but these are usually baked into the pipeline and have to be turned on-or-off depending on need).