4 ms·
Today I learned six new things: - Clang thinks compressing 0x104111 to 0x495 is a good idea - Clang thinks 0x495>>((c-'a')>>1)&1 is better than 1<<c-
by ncmncm 6y ago
Today I learned six new things:
- Clang thinks compressing 0x104111 to 0x495 is a good idea
- Clang thinks 0x495>>((c-'a')>>1)&1 is better than
1<<c-'a'&0x104111
- LLVM has a machine code analyzer
- Godbolt has a button to apply it
- Clang is wrong about that
- Gcc-9 and newer prefers to index into a jump table,
instead of bitmasking. (!)
Yet another reason to set up a periodic contribution to Godbolt.
- fluffything 6y agoWhile deprecated, intel has also an opensource machine code analyzer called IACA. It is also worth pointing out that these "analyzers" are just tools that simulate particular CPU architectures. Their models are just approximations and aren't perfect, so don't take them as a source of truth.