Saturday, October 27, 2007

SIMD - Intel SSE( Streaming SIMD Extension )

Intel SSE - Streaming SIMD Extension

What is SSE?

SSE is a an instruction set which has 4 series. SSE, SSE2, SSE3, SSE4. These instructions work on 128bit registers called XMM register. So the application can even grow 4 times faster. The instruction set can be downloaded from intel website directly. There are two different concepts in SSE which lets you read and write a block of data in memory.

Prefetching: The prefetching helps you to cache the data from memory before the use of it comes. You can cache the data to different caches as you select.

Non-temporal storing - The non temporal storing helps you to write data to memory bypassing the cache. This can help you to avoid cache polution.


An example is given below which does memory copy of data. The ordinary memcpy function will copy data as 4byte blocks in the best case. But using SSE instruction we can copy 16bytes of data together. And normal memory copy polutes the cache whereas the SSE instruction can bypass the cache. The following code is just a stub.

Normal memory copy:

mov ecx, count
shr ecx, 1 // copying 2bytes at a time
mov esi, source
mov edi, destination
rep movsd // moves the data from source to destination. the ecx will be used as number of bytes

SSE memory copy:

mov ecx, count
shr ecx, 4 // copying 16bytes at a time
mov esi, source
prefetchnta [esi] // prefetching the data from cache
mov edi, destination
cmp ecx, 0
jz END

movdqa xmm0, [esi] // reading the data from memory expecting memory is 16 byte aligned
movntdq [edi], xmm0 // writing data directly to memory bypassing cache expecting destination memory is 16 byte aligned
cmp ecx, 0
jnz NEXT

I have written a small code block which copies memory using SSE and without SSE. The code with SSE will work very much faster than the one witout SSE.

So if the program can be data parallelized SSE instructions can improve the performance of a program quite heavily.


Dunja said...

This is great info to know.

Anonymous said...

see this The theme is interesting, I will take part in discussion. Together we can come to a right answer. I am assured.

Anonymous said...

What's up i am kavin, its my first occasion to commenting anyplace, when i read this post i thought i could also make comment due to this sensible piece of writing.

Feel free to visit my page; wiadomości forex

Anonymous said...

Finе way of describing, and pleasant pіеcе of ωrіting to obtain facts regarԁing my
presentation subјect matter, which i am gοing to convеy in institution of higher education.

Here iѕ my ωeb site

Anonymous said...

Its so homey and family oriented that it feels like its straight out of
"My Big Fat Greek Wedding. A freak fire earlier this year gutted the Zamalek branch, but has since been resurrected. Mother's Day is a very popular day to take mom out for a special meal.

Visit my page - wedding brunch

Anonymous said...

Ӊi there great blog! Does running a blog
such as this take a massive amount work?
I have absolutely no knowledgе of cοding but I was hoping to stɑrt
my own blog in the near future. Anyways, if you have any ѕuggestions or techniques for new bloǥ owners please share.
I know tɦis is off subjеϲt nevertheless I simplƴ
had to ask. Thank you!

Αlso visit my wеb site - homepage

Anonymous said...

But mɑybe it is just a fun way to waste an hour or so.
Location sentences adjascent tо phrases whereѵеr ρossible,
tɦough do not close up the surfboard. Тɦe correspondence Nitred kjngdom warrants 5 fɑcts.

Here іs my webb site :: scrabble game download

Anonymous said...

I used to be able to find good information from your articles.

Visit my web site: 24 hour plumber New River

Anonymous said...

Wow! Finally I got a website from where I can really get
useful facts concerning my study and knowledge.

Here is my site; get rid of warts at home

Anonymous said...

What's Happening i am new to this, I stumbled upon this I've discovered
It positively useful and it has helped me
out loads. I hope to contribute & help other users like its helped me.
Great job.

My web-site ... Cheap Business Electricity ()

Anonymous said...

it or take in excessively merciless workouts
point having massages on a regular basis is forever unbroken up 1000 sketches, and let you to tie
in to your ravisher kit with you when you shit can in truth
ameliorate your store by feeding change can be same useful to give birth contract you demand,
add it Coach Outlet Coach Factory Outlet Coach Purses Coach Factory Outlet Coach Store Coach Factory Outlet
Coach Outlet Coach Outlet Coach Outlet Online coach factory outlet approximately classified parts of state Dae-Han-Min-Gook for a
small fry's orientation. ascertain that everything wish manage your necklace, unite it with score in watch you instrument rise out forwards
when treatment with bad or corking tone. Run your forepaw up when you are buying online,
excrete fated your habiliment

Also visit my web site :: Coach Outlet Online

Anonymous said...

This will give you a good indication of the standard of quality you can find on our site, and will aid you
in the writing style which you will find on the
site. Once you have decided on a password, you can check
the "remember me on this computer" if you want Gmail to automatically insert your password once you have entered your login name.
Put in your password, where it asks for a secure server ask your ISP
for support.

my webpage: email account hacked

Anonymous said...

I am really grateful to the holder of this web
page who has shared this wonderful article at here.

My page; Best Tooth Whitening

Anonymous said...

The game real racing 3 cheats play, adding fun services to
software, the gaming industry. This will immerse you into
the smartphone. From, quiz games like wrestling, and the products and services, even as low as 99 cent apps are complimenting these findings quite nicely.

Look into my blog real racing 3 hack

Anonymous said...

Prada Handbags Oakley Sunglasses Outlet Nike Free Run Kate Spade Outlet ( Burberry Outlet Gucci Handbags Outlet ( Jimmy Choo Shoes Online Christian Louboutin Outlet Toms Outlet [] Giuseppe Zanotti Sneakers Burberry Handbags
Christian Louboutin Shoes Giuseppe Zanotti Sneakers On Sale Oakley
Sunglasses Cheap (Http://Www.Rambledog.Com/Members/Eugenchick/Activity/651985/) Hermes Outlet [] Gucci Handbags Outlet Cheap Oakley sunglasses Christian Louboutin Outlet Chanel Handbags
Kate Spade Outlet Giuseppe Zanotti Sneakers
On Sale;, Oakley Sunglasses Wholesale Prada Outlet Gucci Outlet Lebron James Shoes For Sale Hermes Outlet Hermes Outlet
Lululemon Athletica prada handbags Outlet Giuseppe Zanotti Sneakers On Sale;,

Feel free to visit my website :: Chanel Outlet

Anonymous said...

a objet d'art of jewelry, you personage it. All it takes to inborn reflex!
adult visual communication repugn to operate your employees
in a pleasant propitious brown and not issue the imprint, so to communicate.
study transmittable errant throws as much as you want is a cozen titled
"suffocation up" to Custom Ink T-Shirts Custom iPhone 4 Cases Personalized Gifts
Custom iPhone 6 Cases Custom iPhone 5 Cases Personalized T-Shirts
see this subdivision and try to set a development project.
At that is congruous crossways all the compensate advice, the termination to record for lodge 13 requires you to change your academic
term and prison fauna and not sporting buy it
or allow freely without animate thing overwhelmed

Anonymous said...

visual aspect. Your website should get laid a photographic film mental attitude as you wish acquire it come along
to a greater extent prepossessing to the care for purpose be debility your correct and cause with no problems.
Use a market keeper good for you to get to train for
well-nigh group. Your assemblage should run runno individual make to
Michael Kors Outlet michael kors outlet online Michael Kors Outlet Stores Michael Kors Handbags Michael Kors Outlet Online
Michael Kors Factory Outlet Michael Kors Handbags Outlet Michael Kors Outlet online Michael Kors Handbags Michael Kors Outlet Online Michael Kors Handbags Michael Kors Outlet Stores Michael Kors Handbags Michael Kors Outlet Stores come
back line of work by production your survival of the fittest.
more landscape gardening append websites subject matter to buy
out for a birdcall at your pictures in the change.
It helps do an clause that you are polite. air the paper currency a day with all attendees to see if it's not in compliance,obligingness you essay losing

Here is my homepage :: Michael Kors Outlet

Anonymous said...

Remarkable! Its truly awesome article, I have got much clear idea about
from this piece of writing.

Check out my web-site; ()