Re: [Algorithms] Shifting or Multiplication....
Brought to you by:
vexxed72
From: Corrinne Y. <cor...@ho...> - 2000-12-28 01:27:41
|
Floating point multiplication can be fast on PC based systems. Some compilers can choose to turn all your * 2 into << 1 automatically for you for integers. IMO nothing to get too stressed about. Whatever is readable and debuggable. :) Corrinne ----- Original Message ----- From: Alex Morano To: gda...@li... Sent: Saturday, December 23, 2000 2:38 PM Subject: [Algorithms] Shifting or Multiplication.... I was wondering if anyone could clear up something. Algorithmically, is bitshifting or using multiplication faster?? Now, I know this sounds like a subjective question, as some will undoubtadly say, it depends on the compiler and what it translates the code into. Lets take it down to the ASM level. Shifting, to me, looks like a 1 cycle operation. In this age, if the CPU can handle most MUL's almost as rapidly, is there a place for bitshifts? If so, then for what kinds of algo applications? Do we still need them to mask off bits in pixels colors? |