TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Neat Bitwise Trick for Swapping Even and Odd Bits

1 pointsby lawrencewuabout 7 years ago

1 comment

joezydecoabout 7 years ago
8 bit input? Use a pre-generated lookup table. Store it in ROM.<p>The table deference will take 1 or 2 operations instead of the AND&#x2F;SHIFT&#x2F;PUSH&#x2F;AND&#x2F;SHIFT&#x2F;POP&#x2F;OR described in the answer.
评论 #16639901 未加载