stassats
Joined 19 years ago
Karma
175
Submissions
67
Member since
Jan 29
Joined 19 years ago
x * 6:
lea eax, [rdi+rdi*2]
add eax, eax
x * 7:
lea eax, [0+rdi*8]
sub eax, edi
x * 11:
lea eax, [rdi+rdi*4]
lea eax, [rdi+rax*2]
But with -Os you get imul eax, edi, 6And on modern CPUs multiplication might not be actually all that slow (but there may be fewer multiply units).
E.g. for x * 5 gcc issues lea eax, [rdi+rdi*4].
It was hard to do reasonably with qt4 already. The best solution would be to support the C++ ABI natively, but that's never going to happen.
Why doesn't GCC use LLVM? Why is Zig writing their own backend?
But lisp doesn't need TCO.
Or write your own operations that compute to the precision you want.
Please, don't do that!