home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,295 of 4,675   
   Frank Tetzel to All   
   Re: Does using LEA in stead of (I)MUL st   
   07 Mar 18 01:01:19   
   
   From: s1445051@nospicedham.mail.zih.tu-dresden.de   
      
   > In this day and age, does it still make sense to use things like   
   >   
   > LEA EAX, [EAX + EAX * 4]   
   > ADD EAX, EAX   
   >   
   > rather than   
   >   
   > IMUL EAX, 10   
      
   One easy way to find out: ask your compiler!   
   https://godbolt.org/g/XLgURC   
      
   It depends on the CPU. Multiplication got way better, but multiplying   
   by a small constant is still done with LEA.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca