¡@

Home 

c++ Programming Glossary: lea

C++11: GCC 4.8 `thread_local` Performance Penalty?

http://stackoverflow.com/questions/13106049/c11-gcc-4-8-thread-local-performance-penalty

4005bb 64 8b 00 mov eax DWORD PTR fs rax 4005be 8d 50 25 lea edx rax 0x25 4005c1 48 c7 c0 fc ff ff ff mov rax 0xfffffffffffffffc..

1D or 2D array, what's faster?

http://stackoverflow.com/questions/17259877/1d-or-2d-array-whats-faster

one additional mov instruction while get_1d has two extra lea instructions 5 instructions 2d vs 6 1d in total . I did some.. the loop away eventhough it would still be possible at least in the inlined case I think . Fortunately it doesn't happen... the matrix grows but will still be present. Risk of memory leaks The bunch of allocations requires an appropriate exception..

Why does gcc generate 15-20% faster code if I optimize for SIZE instead of speed?

http://stackoverflow.com/questions/19470873/why-does-gcc-generate-15-20-faster-code-if-i-optimize-for-size-instead-of-speed

SIZE instead of speed I first noticed in 2009 that gcc at least on my projects and on my machines have the tendency to generate.. static int add const int x const int y return x y 100.00 lea rdi rsi 1 eax retq ... int z add x y 1.93 callq add.. static int add const int x const int y return x y 51.59 lea rdi rsi 1 eax ... __attribute__ noinline static int..

Do modern compilers optimize the x * 2 operation to x << 1?

http://stackoverflow.com/questions/235072/do-modern-compilers-optimize-the-x-2-operation-to-x-1

this to x x 01391000 push ecx int x 0 scanf d x 01391001 lea eax esp 01391004 push eax 01391005 push offset string d 13920F4h.. int y x 2 01391018 mov ecx dword ptr esp 8 0139101C lea edx ecx ecx In an x64 build it is even more explicit and uses.. mov edx dword ptr x printf d y 000000013FB91022 lea rcx string d 13FB921B0h 000000013FB91029 add edx edx This is..

Fast multiplication/division by 2 for floats and doubles (C/C++)

http://stackoverflow.com/questions/7720668/fast-multiplication-division-by-2-for-floats-and-doubles-c-c

seconds with an inner loop of movupd xmm0 xmmword ptr ecx lea ecx ecx 10h mulpd xmm0 xmm1 movupd xmmword ptr ecx 10h xmm0.. otherwise with an inner loop of add dword ptr ecx 400000h lea ecx ecx 8 Truly unexpected EDIT 2 Mystery solved One of the..