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 » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Optimized memcmp for x86
Re: Optimized memcmp for x86 [message #14457 is a reply to message #14366] Tue, 26 February 2008 22:07 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
mr_ped wrote on Sat, 23 February 2008 17:23



If you get truly 13B from end of 4kB chunk, the starting address will be not aligned => classic memcmp will be called.

If starting pointer is aligned and you know the whole 4kB chunk is readable, you may safely read 4bytes even if the last 3 are beyond the original buffer, you can't cross 4kB chunk boundary in any case.

Those gibberish data are masked out before comparison. Smile
You should probably check the original routine and my suggestion firstly to get idea what's the problem with that last double word read from memory.


Yes. I believe you are correct.

(This is post-2008.1 stuff anyway, but it is nice to get ready Smile

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: multiple classes include-problem
Next Topic: What does , means?
Goto Forum:
  


Current Time: Sun Jun 16 14:05:00 CEST 2024

Total time taken to generate the page: 0.02082 seconds