Re: Zahl gerade oder ungerade?



Respekt...

So tief bin ich noch nie in die Materie eingestiegen.


"Thomas Scheidegger [MVP]" <spam.netmaster@xxxxxxxxxxxxxx> schrieb im Newsbeitrag news:OpsbIEg0HHA.1184@xxxxxxxxxxxxxxxxxxxxxxx
> Eine Integer-Divison (incl.remainder) braucht (mind. bei etwas älteren CPUs)
> meist einige/etliche Zyklen,


Irrtum vorbehalten, für aktuelle intel Core2 CPUs
http://www.intel.com/products/processor/manuals/

'Optimization Reference Manual'
http://www.intel.com/design/processor/manuals/248966.pdf

gelten wohl grob Angaben wie:

IDIV :
Latency: 22 Throughput 22

AND/OR/XOR :
Latency: 1 Throughput 0.33


Hinzu kommen offenbar in bestimmten Konstellationen (wie im vorliegenden Fall) sogar Optimierungen wie zB:
'Macro fusion'

http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/enterprise/porting/281974.htm?page=3

wo unser optimaler Fall mit 'AND' (=TEST) und Verzweigung 'Then' (=> JE):
test eax,1
je 0000004E
sogar noch in einem (CPU-internen) OP zusammengefasst werden kann!

Binäre Logik ist halt die allereinfachste und 'reinste Form' von 'Mathematik',
sowie massgeschneidert für aktuelle Prozessoren...




--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/




.



Relevant Pages

  • Re: 2.6.12 Performance problems
    ... > at the cost of decreased throughput - can't ... "Low latency comes at the cost of decreased ... Threading the kernel ...
    (Linux-Kernel)
  • Re: 2.6.12 Performance problems
    ... > at the cost of decreased throughput - can't ... "Low latency comes at the cost of decreased ... Threading the kernel ...
    (Linux-Kernel)
  • [patch] voluntary-preempt-2.6.9-rc1-bk4-Q7
    ... the main change in this patch are more SMP latency fixes. ... kernel, even with CONFIG_PREEMPT enabled, didnt have any spin-nicely ... CPUs in the system. ...
    (Linux-Kernel)
  • Re: [PATCH] O11int for interactivity
    ... > a problem - untarring the Linux distro won't do it, running badblocks won't do it. ... My guess is that xmms is getting throttled in try_to_free_pages. ... The instrumentation to add is page allocation latency. ... anticipatory scheduler is currently rather tuned for throughput. ...
    (Linux-Kernel)
  • Re: ZFS performance weirdness on a a Netra X1
    ... (E3500 with 400 MHz CPUs). ... I achieved with ZFS a write throughput ... responsive during the test (kernel time at ~35%) ...
    (comp.unix.solaris)