How-to: Why does GCC generate such radically different assembly for nearly the same C code? #development #it #answer
How-to: Why does GCC generate such radically different assembly for nearly the same C code? #development #it #answer
Why does GCC generate such radically different assembly for nearly the same C code?
While writing an optimized ftol function I found some very odd behaviour in GCC 4.6.1. Let me show you the code first (for clarity I marked the differences):
fast_trunc_one, C:
int fast_trunc_one(int i) { int mantissa, exponent, sign, r; mantissa = (i & 0x07fffff) | 0x800000; exponent = 150 - ((i >> 23) & 0xff);…
View On WordPress
















