https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118468

uis <uis9936 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uis9936 at gmail dot com

--- Comment #3 from uis <uis9936 at gmail dot com> ---
Similar code, but made with switch statement: https://godbolt.org/z/qPjzx6rPx

#include <stddef.h>
bool square(size_t len, char in[static len]) {
    for(size_t i = 0; i < len; i++) {
        switch(in[i]) {
            case 0:
            case '\r':
            case '<':
            case '&':
            case '\n':
                return true;
            default:
        }
    }
    return false;
}

I was pointed at this bugreport after looking if GCC could do vectorization
similar to one
http://lemire.me/blog/2024/06/08/scan-html-faster-with-simd-instructions-chrome-edition/
did.

This is what Firefox developers did:
https://github.com/mozilla-firefox/firefox/commit/86a403a0d1ff#diff-23af936998411919799579c8cbf2b1335c61b458a3021e39a40af883523dcdd3

Reply via email to