Hey fellow twittettes. What's the quickest way to do an endian swap on RV32I ?
-
Show this thread
-
Replying to @OlofKindgren
Not sure if that's the best way to do it, but here is a solution in 11 instructions. (In RV32B it's going to be just one instruction of course. ;)pic.twitter.com/r0SAs9IVx1
4 replies 0 retweets 12 likes -
Replying to @oe1cxw @OlofKindgren
For 11 instructions there’s no need for a mask. Just (x << 24) | (x >> 24) | (x << 8 >> 24 << 8) | (x >> 8 << 24 >> 8)
1 reply 0 retweets 1 like -
Replying to @BruceHoult @oe1cxw
In practice I think minimizing shifts could be beneficial if the CPU doesn't have barrel shifters but this is of course all very hypothetical
2 replies 0 retweets 1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.