Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
johnregehr's profile
John Regehr
John Regehr
John Regehr
@johnregehr

Tweets

John Regehr

@johnregehr

john.regehr.org
Joined September 2009

Tweets

  • © 2019 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    John Regehr‏ @johnregehr 4 Jan 2016

    musl's strlen() is a work of art except for the hopefully-harmless UB http://git.musl-libc.org/cgit/musl/tree/src/string/strlen.c …

    1:36 PM - 4 Jan 2016
    • 13 Retweets
    • 20 Likes
    • Stewart Henderson Adrian Burgess Barry K. Nathan Brian Smith Pradeep Gowda 🇮🇳🇺🇸 Rich Felker Marius Gedminas Scott Be A Nacho Jason Meltzer
    12 replies 13 retweets 20 likes
      1. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @johnregehr

        I'm not being snarky, I really do love this little file

        0 replies 0 retweets 2 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. New conversation
      2. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @johnregehr

        @johnregehr The aliasing? I plan to fix it with an __attribute__((__may_alias__)) type conditional on __GNUC__, fallback to naive if !GNUC.

        1 reply 0 retweets 0 likes
      3. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @RichFelker

        @johnregehr Actually, for 32-bit words, a naive 16x unrolled byte-based strlen blows away everything else in performance.

        1 reply 0 retweets 1 like
      4. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @RichFelker

        @johnregehr It consist of 100% correctly-predicted branches until end-of-string, and achieves ~1 cycle/byte even on my slow Atoms.

        1 reply 0 retweets 2 likes
      5. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @RichFelker

        @RichFelker cool!

        1 reply 0 retweets 0 likes
      6. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @johnregehr

        @johnregehr The bad news: compilers won't generate this unrolled code even if you ask them to. You have to write it by hand...

        2 replies 0 retweets 0 likes
      7. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @RichFelker

        @RichFelker gcc 5.3 gives me a nice 8-way unroll with -funroll-all-loops -O3

        1 reply 0 retweets 0 likes
      8. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @johnregehr

        @johnregehr What's your idea of a "nice unroll"? I get cmpb;leaq;je per iteration. Instead it should just do cmpb;je.

        1 reply 0 retweets 0 likes
      9. Rich Felker‏ @RichFelker 4 Jan 2016
        Replying to @RichFelker

        @johnregehr This change makes a 2x performance difference, from "slowest reasonable strlen" to "fastest strlen".

        1 reply 0 retweets 0 likes
      10. 2 more replies
      1. New conversation
      2. JF Bastien‏ @jfbastien 4 Jan 2016
        Replying to @johnregehr

        @johnregehr don't forget musl's beauties such as this 64-bit atomic primitive which totally won't tear: http://git.musl-libc.org/cgit/musl/tree/arch/arm/atomic.h#n247 …

        3 replies 0 retweets 2 likes
      3. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @jfbastien

        @jfbastien I don't even understand

        2 replies 0 retweets 2 likes
      4. Brian Smith‏ @BRIAN_____ 4 Jan 2016
        Replying to @johnregehr

        @johnregehr @jfbastien Do you have more examples of questionable musl stuff? OpenWrt (many SOHO routers & IoT things) just switched to it...

        1 reply 0 retweets 0 likes
      5. JF Bastien‏ @jfbastien 4 Jan 2016
        Replying to @BRIAN_____

        @BRIAN_____ @johnregehr not at the moment, I'll send patches to @RichFelker once we start doing WebAssembly's libc using musl.

        0 replies 0 retweets 2 likes
      6. End of conversation
      1. New conversation
      2. whitequark‏ @whitequark 4 Jan 2016
        Replying to @johnregehr

        @johnregehr just the read past the end or something else I don't see?

        2 replies 0 retweets 0 likes
      3. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @whitequark

        @whitequark yep, reads past the end-- probably not a big deal

        2 replies 0 retweets 0 likes
      4. whitequark‏ @whitequark 4 Jan 2016
        Replying to @johnregehr

        @johnregehr can you even implement fast strlen() without UB?

        2 replies 0 retweets 0 likes
      5. John Regehr‏ @johnregehr 4 Jan 2016
        Replying to @whitequark

        @whitequark I can't see any way to do it w/o padding all strings

        1 reply 0 retweets 0 likes
      6. Steve Canon‏ @stephentyrone 4 Jan 2016
        Replying to @johnregehr

        @johnregehr @whitequark either write asm, or write the naive loop and depend on a Smart Compiler.

        1 reply 0 retweets 1 like
      7. Steve Canon‏ @stephentyrone 4 Jan 2016
        Replying to @stephentyrone

        @johnregehr @whitequark (significantly less compiler smarts required for the naive loop than this clever implementation, BTW).

        1 reply 0 retweets 1 like
      8. whitequark‏ @whitequark 4 Jan 2016
        Replying to @stephentyrone

        @stephentyrone @johnregehr there's something incestous in compiler recognizing this idiom and replacing it with optimized SIMD

        2 replies 1 retweet 2 likes
      9. whitequark‏ @whitequark 4 Jan 2016
        Replying to @whitequark

        @stephentyrone @johnregehr hell, let it also recognize bubble sort and replace with qsort. why not.

        2 replies 1 retweet 0 likes
      10. 11 more replies

    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.

      Promoted Tweet

      false

      • © 2019 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info