2 ms·
glibc's abs() implementation is here: https://github.com/bminor/glibc/blob/master/stdlib/abs.c https://github.com/bminor/glibc/blob/master/stdlib/abs.c It's th
by mappu 11y ago
glibc's abs() implementation is here: https://github.com/bminor/glibc/blob/master/stdlib/abs.c https://github.com/bminor/glibc/blob/master/stdlib/abs.c
It's the naive branching version (probably for platform independence?), but my installed GCC 4.9.3 does convert it to branchless cdq/xor trick on both -O3 and -O0.