We take a simple code:
void main() { int x = abs(-1); }
We assemble and disassemble it:
$ gcc sample.c -o sample && objdump -d ./sample
We get a listing where there is no conditional command:
80483a1: e8 ee ff ff ff call 8048394 <some> 80483a6: 89 c2 mov %eax,%edx 80483a8: c1 fa 1f sar $0x1f,%edx 80483ab: 31 d0 xor %edx,%eax 80483ad: 29 d0 sub %edx,%eax
How in C / C ++ to get the absolute value of an integer without a comparison operation?