Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » External resources » Software optimization resources
Software optimization resources [message #30511] Thu, 06 January 2011 04:03 Go to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
http://agner.org/optimize/

This web site contains five manuals, which describe everything you need to know about optimizing code for x86 and x86-64 family microprocessors, including optimization advices for C++ and assembly language, details about the microarchitecture and instruction timings of Intel, AMD and VIA processors, and details about different compilers and calling conventions.

If you liked Bit Twiddling Hacks you might like these manuals Smile


Regards,
Novo

[Updated on: Thu, 06 January 2011 06:22]

Report message to a moderator

Re: Software optimization resources [message #30523 is a reply to message #30511] Thu, 06 January 2011 13:33 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Thanks Novo, it looks quite interesting.

Especially the assembler library caught my attention. It replaces some common c functions (mem{cpy,move,set},str{cat,copy,len,cmp}) with assembler versions using advanced instruction sets. Out of curiosity I launched a benchmark code from the NTL/STL comparison page. But to my great disappointment, it turns out there was no recognizable gain in speed Sad If there is someone interested enough to try to figure out why, I would be very interested Wink

But anyway, the manuals look good Wink

Best regards,
Honza
Re: Software optimization resources [message #30530 is a reply to message #30523] Thu, 06 January 2011 22:52 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi Novo,

I haven't tried the samples you are talking about but for special assembler functions to work (SSE, or whatever, ....) the memory has to be aligned on 4 bytes or 64 bytes or 128 bytes or more maybe.
The alignement depends on the assembler instructions used.

If the memory is not aligned correctly either you get bad results or just poor execution timings.

Maybe this is what happens in you're case
Re: Software optimization resources [message #30535 is a reply to message #30530] Fri, 07 January 2011 11:01 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Didier wrote on Thu, 06 January 2011 22:52

Hi Novo,

I haven't tried the samples you are talking about but for special assembler functions to work (SSE, or whatever, ....) the memory has to be aligned on 4 bytes or 64 bytes or 128 bytes or more maybe.
The alignement depends on the assembler instructions used.

If the memory is not aligned correctly either you get bad results or just poor execution timings.

Maybe this is what happens in you're case

Hi Didier,
I believe you react on my post, even though I'm not Novo Wink

The asmlib functions take the alignment into consideration. Their internals first take care of the unaligned part using clasic instructions and then process the rest using SSE or whatever available.

After some more thinking I believe that the real reason why there was no noticeable change was badly chosen benchmark. There was probably majority of the time spent in other functions than memory and string handling. I will try again with better constructed test code.

Honza
Re: Software optimization resources [message #30541 is a reply to message #30535] Fri, 07 January 2011 17:44 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Oups !!!! Embarassed

Sorry for the mistake Honza.

Re: Software optimization resources [message #30685 is a reply to message #30511] Mon, 17 January 2011 05:53 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
I found another interesting resource related to vectorization. It was referenced in a book about the Cell processor.

http://www.freevec.org/

This is a C library, which has vectorized code for most popular functions. And it can handle unaligned data (in a petty simple way). The hardest part was to figure out how to download it.

http://www.ohloh.net/p/libfreevec (there is a "Download Page" link on top right)


Regards,
Novo
Previous Topic: Bit Twiddling Hacks
Next Topic: C++ Resyntaxed
Goto Forum:
  


Current Time: Thu Mar 28 13:05:50 CET 2024

Total time taken to generate the page: 0.01180 seconds