|
Em seg., 7 de dez. de 2020 às 09:07, Xmilia Hermit <xmilia.hermit@gmail.com> escreveu:Maybe also take a look at gcc.
x86-x64 gcc 10.2 (-O2):
f(int):
mov eax, 10
ret
f(unsigned int):
cmp edi, -10
sbb eax, eax
and eax, 10
ret
I would say in this case f(int) is faster.It seems to me that someone forgot to apply the same optimization for "unsigned int", into gcc code.What leads to the conclusion, where are these modern compilers really?Clang 11.0 is not a modern compiler?