Is there a instruction to implement bit reverse??
yuyang-ok opened this issue · comments
yuyang commented
or there is a cheap way to implement bit reverse?
current now I only can do this using iteration.
Craig Topper commented
You can use the Zbb rev8
from instruction to swap the bytes and then use shifts, ands, and ors to reverse the bits within each byte. https://godbolt.org/z/5onMsrq7r
Or you can use rev8
and brev8
from Zbkb to reverse bytes and bits within bytes. https://godbolt.org/z/5zh6dbjM7
yuyang commented
ok,thanks you.