Re: Zahl gerade oder ungerade?



> 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)
  • 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: Make pipe data structure be a circular list of pages, rather than
    ... Many latency critical apps use FIFO's for IPC; ... Ardour's GUI, control, and audio threads interact via a ... meaning "increased throughput albeit with more latency". ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: SSE2
    ... latency and 1 throughput, so pmuludq gives you the same throughput for the ... It *might* be possible to use pmullw/pmulhuw with some swizzling ... > However, if SSE2, MMX and FP can all happily co-exist, then I might ... SSE 2 is a possibility although it has higher latency. ...
    (comp.lang.asm.x86)