mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.4K
active users

#bittwiddling

0 posts0 participants0 posts today
रञ्जित (Ranjit Mathew)<p>The mother lode of <a href="https://mastodon.social/tags/BitTwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BitTwiddling</span></a> tips (apart from the <a href="https://mastodon.social/tags/book" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>book</span></a> “Hacker’s Delight”, by Henry S. Warren Jr, and “HAKMEM” by the MIT hackers):</p><p>“Bit Twiddling Hacks”, Sean Eron Anderson (<a href="https://graphics.stanford.edu/~seander/bithacks.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">graphics.stanford.edu/~seander</span><span class="invisible">/bithacks.html</span></a>).</p><p>On HN: <a href="https://hn.algolia.com/?dateRange=all&amp;page=0&amp;prefix=false&amp;query=Bit%20Twiddling%20Hacks&amp;sort=byPopularity&amp;type=story" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">hn.algolia.com/?dateRange=all&amp;</span><span class="invisible">page=0&amp;prefix=false&amp;query=Bit%20Twiddling%20Hacks&amp;sort=byPopularity&amp;type=story</span></a></p><p><a href="https://mastodon.social/tags/Math" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Math</span></a> <a href="https://mastodon.social/tags/Optimization" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Optimization</span></a> <a href="https://mastodon.social/tags/Compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compilers</span></a></p>
रञ्जित (Ranjit Mathew)<p>This 👇🏽 is good 👌🏽:</p><p>“A Leap Year Check In Three Instructions”, Falk Hüffner (<a href="https://hueffner.de/falk/blog/a-leap-year-check-in-three-instructions.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">hueffner.de/falk/blog/a-leap-y</span><span class="invisible">ear-check-in-three-instructions.html</span></a>).</p><p>Via HN: <a href="https://news.ycombinator.com/item?id=43999748" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">news.ycombinator.com/item?id=4</span><span class="invisible">3999748</span></a></p><p>On Lobsters: <a href="https://lobste.rs/s/ybjgex/leap_year_check_three_instructions" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">lobste.rs/s/ybjgex/leap_year_c</span><span class="invisible">heck_three_instructions</span></a></p><p><a href="https://mastodon.social/tags/Optimization" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Optimization</span></a> <a href="https://mastodon.social/tags/Assembly" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Assembly</span></a> <a href="https://mastodon.social/tags/Compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compilers</span></a> <a href="https://mastodon.social/tags/GCC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GCC</span></a> <a href="https://mastodon.social/tags/Math" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Math</span></a> <a href="https://mastodon.social/tags/LeapYear" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LeapYear</span></a> <a href="https://mastodon.social/tags/GregorianCalendar" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GregorianCalendar</span></a> <a href="https://mastodon.social/tags/BitTwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BitTwiddling</span></a> <a href="https://mastodon.social/tags/Speed" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Speed</span></a></p>
Shane Celis<p>I'm sure this has been done many times before, but I'm still happy to be bit-twiddling in <a href="https://mastodon.gamedev.place/tags/shaders" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>shaders</span></a>. The star is this line:</p><p>(vertex_index &amp; 3u) + (vertex_index &gt;&gt; 2u)</p><p>"Give me the first two bits but add one if the third bit is set.” </p><p>The shader generates a UV-mapped quad (right-triangle pair) from the 0 through 5 vertex indices. The screenshot code is abridged; full code is at the link.</p><p><a href="https://github.com/shanecelis/bevy/blob/add-viewport-post-processing/crates/bevy_core_pipeline/src/viewport_vertex_shader/viewport.wgsl" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/shanecelis/bevy/blo</span><span class="invisible">b/add-viewport-post-processing/crates/bevy_core_pipeline/src/viewport_vertex_shader/viewport.wgsl</span></a> <a href="https://mastodon.gamedev.place/tags/gamedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gamedev</span></a> <a href="https://mastodon.gamedev.place/tags/bevyengine" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bevyengine</span></a> <a href="https://mastodon.gamedev.place/tags/bittwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bittwiddling</span></a> <a href="https://mastodon.gamedev.place/tags/wgsl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wgsl</span></a></p>
Kernel Bob<p>In 2013, past me wrote some mysterious code. Effectively, it was this.</p><p> uint8_t decay(uint8_t x) { return (x &gt;&gt; 1) | (x &gt;&gt; 2); }</p><p>Sort of a low level multiply by 0.75, but with an | instead of a +. The target was an 8 bit AVR. Is there any good reason for using | here? I vaguely remember a bug where certain values didn't decay, but testing shows all 255 nonzero values of x do decay.</p><p>Any thoughts?</p><p><a href="https://chaos.social/tags/CProgramming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CProgramming</span></a> <a href="https://chaos.social/tags/BitTwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BitTwiddling</span></a></p>
Blippy the Wonder Slug (MOVED)<p>Re: coding.</p><p>If it ain't native ASM, it ain't shit.</p><p>POP!</p><p><a href="https://social.cologne/tags/BitTwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BitTwiddling</span></a></p><p>**scampers away cackling maniacally**</p>
Matthew Flint<p>I made a tiny <a href="https://mastodon.me.uk/tags/Swift" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Swift</span></a> package for decoding Base32 values.</p><p><a href="https://gitlab.com/mflint/base32" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="">gitlab.com/mflint/base32</span><span class="invisible"></span></a></p><p><a href="https://mastodon.me.uk/tags/iOSDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iOSDev</span></a> <a href="https://mastodon.me.uk/tags/BitTwiddling" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BitTwiddling</span></a></p>