|
|
Home » Developing U++ » U++ Developers corner » What does SSE2 usage enhance?
What does SSE2 usage enhance? [message #39622] |
Wed, 10 April 2013 13:31 |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
A question got up to me. What exactly are the pro's of using SSE2 as flag in your build? What kind of things can it speed up if the processor supports it?
|
|
|
|
|
|
|
|
|
|
|
Re: What does SSE2 usage enhance? [message #39702 is a reply to message #39700] |
Thu, 18 April 2013 11:43 |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
Here is a small code snippet. If you see anything that is strange or wrong I would appreciate feedback.
The memcpy line is the line where I copy, in this case, 4 bytes from the address of i in array buffer to float variable tempStore.
template<>
void MemoryScanner::ScanWorker(const MemoryRegion& region, const float& value)
{
Byte *buffer = (Byte*)MemoryAlloc(region.MemorySize);
if (!ReadProcessMemory(this->mOpenedProcessHandle, (void*)region.BaseAddress, buffer
, region.MemorySize, NULL))
{
MemoryFree(buffer);
return;
}
Vector<MemoryBlockBase*> localResults;
for (int i = 0; i < region.MemorySize; i++)
{
float tempStore;
memcpy(&tempStore, &(buffer[i]), sizeof(float));
if (TemplateCompare(tempStore, value)) // WRITES TO FREED BLOCKS DETECTED
{
MemoryBlock<float>* mb = new MemoryBlock<float>();
mb->Address = static_cast<unsigned int>(region.BaseAddress + i);
mb->Size = sizeof(float);
mb->Buffer = tempStore;
localResults.Add(mb);
}
}
MemoryFree(buffer);
AtomicInc(this->ThreadFinishCount);
if (localResults.GetCount() > 0)
{
this->AddThreadSpecificSearchResults(localResults);
}
this->UpdateScanningProgress(this->ThreadFinishCount);
}
|
|
|
|
Goto Forum:
Current Time: Wed Jun 05 05:25:46 CEST 2024
Total time taken to generate the page: 0.02039 seconds
|
|
|