Juan Manual Cabo reports a substantial speedup for such with this code:
------------
import std.stdio;
import std.datetime;
int fibw(int n) { //Linear Fibonacci
int a = 1;
int b = 1;
for (int i=2; i <= n; ++i) {
int sum = a + b;
a = b;
b = sum;
}
return b;
}
void main() {
auto start = Clock.currTime();
int r = fibw(1000_000_000);
auto elapsed = Clock.currTime() - start;
writeln(r);
writeln(elapsed);
}
----------------
Comment #1 by bearophile_hugs — 2013-06-08T11:15:23Z
Isn't loop alignment worth doing in 32 bit code too? GCC (and Clang) align loops even in 32 bit code since many years.
Comment #2 by juanmanuel.cabo — 2013-06-08T14:18:43Z