3 ms·
As pointed out above, gcc ≥11 optimises it to a switch / lookup table (https://godbolt.org/z/PxvGKqGrd https://godbolt.org/z/PxvGKqGrd).
by azalemeth 6y ago
As pointed out above, gcc ≥11 optimises it to a switch / lookup table (https://godbolt.org/z/PxvGKqGrd https://godbolt.org/z/PxvGKqGrd).
- rantwasp 5y agooh wow. this is really nice. was expecting some sort if gcc documentation or a blog post. got the real deal. thanks for the link