Maybe also take a look at gcc.
x86-x64 gcc 10.2 (-O2):
mov eax, 10
cmp edi, -10
sbb eax, eax
and eax, 10
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?