Re: Typen - Berechnung

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hallo Martin!

Doku wüßte ich jetzt nicht. Aber es macht keinen Sinn, einen x86 Prozessor im 32Bit Protected Mode alte 16 Bit Befehle ausführen zu lassen. Diese erhalten dann nämlich einen Prefix und sind meines Wissens auch langsamer als ihr 32 Bit Equivalent.

ACK! Eine Shift Operation, die nur die unteren 16bit benutzt (shl ax) ist um einiges langsamer als der shift auf eax!

Zudem wird ja auch nur ein Wort geladen.
Interessant ist, dass in diesem Fall sogar die oberen 16bits returniert werden, die beim Shift entstehen. Theoretisch ja ein Wert, der ignoriert wird.
Die aufrufende Funktion sorgt dafür, dass wirklich nur die unteren 16bit verwendet werden.

--
Martin Richter [MVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
FAQ: http://www.mpdvc.de Samples: http://www.codeproject.com
.



Relevant Pages

  • Re: Typen - Berechnung
    ... Diese erhalten dann nämlich einen Prefix und sind meines Wissens auch langsamer als ihr 32 Bit Equivalent. ... Eine Shift Operation, die nur die unteren 16bit benutzt ist um einiges langsamer als der shift auf eax! ...
    (microsoft.public.de.vc)
  • Re: prime number
    ... > have a bit shift operation. ... > shift to the right. ... > square root is a little harder so I never consider the fact that my upper ... Lets be generous and assume that the shift takes 1 clock cycle and that ...
    (comp.programming)
  • Re: prime number
    ... >> have a bit shift operation. ... >> shift to the right. ... >> square root is a little harder so I never consider the fact that my upper ... >> I guess for a large enough value of N it might be worth calculating the ...
    (comp.programming)
  • Re: >> to accelerate division
    ... > In order to force unsigned right shift on a signed type, ... If you want unsigned shift semantics it is unclear to me why you would ... shift operation will produce the same result as if unsigned. ... > between compatible types, not assuming int size. ...
    (comp.lang.c)
  • Re: Q: bit shifting
    ... SHIFT operation you use shift ... Its good at the language level, its is not a good paradigm for creating and documenting instructions; similar to languages that define certain operations that have to be synthesized byt the compiler as a series of instructions. ...
    (comp.arch)