Dead Journal Dead Journal Dead Journal




Enter the Crypt
    - OpenID

The Cemetery
    - The Morgue
    - Join the Undead
    - Offerings
    - Download
    - DJ News
    - Advertise on DJ

Morgue Directory
    - Random Grave
    - Place of Death
    - Search Morgue
    - Interests

Botched Murders
    - FAQ
    - Lost Info?
    - Spoon Feeding
    - Hauntings





liquidchile ([info]pikachu75751) wrote,
@ 2009-04-27 21:17:00

Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Its snowing in hell...I hear...
Hell must have frozen over... Believe it or not I was trying to look something up and guess where I found the information I needed? At microsoft.com! Believe it or not! I kid you not:
http://msdn.microsoft.com/en-us/library/03a2xda2(VS.80).aspx
http://msdn.microsoft.com/en-us/library/590b9ks9(VS.80).aspx

So I was trying to write to memory without polluting the cache. There is a SSE intrinsic function in gcc which lets one do this:
_mm_stream_pi (__m64 *p, __m64 a)

It uses the instruction movntq which moves a quadword (ie. 64 bits) with non-temporal storage (ie, try not cache it). The problem was that after I started using this intrinsic in my code I started seeing weird floating point behaviour all over the program. I couldn't figure it out and finding documentation on these esoteric routines proved extremely difficult (at least the first page of google didn't show much, and who looks at more than one page of search results?)
Well there was a msdn.microsoft.com link which I avoided since a) it is microsoft and b) it is probably irrelevant. Well desperate as I was I followed the links and lo behold found my answer.

In case you were wondering, the MMX instructions muck around with the floating point register set to allow the use of the __m64 data type and thus to enable correct floating point behaviour you have to restore the register states by calling _mm_empty().
Well that is it more or less.

Anyway, I was delightfully pleased and surprised. Leave it to microsoft to have documentation readily available for such a unusual and infrequently used instruction. (Well of course Intel has tons of documentation on this, no doubt tucked away in pdfs away from google's prying eye).


(Read comments)

Post a comment in response:

From:
Help
Identity URL: 
Username:
Password:
Subject:
No HTML allowed in subject
  
Message:

Notice! This user has turned on the option that logs your IP address when posting. This means they will know where you are posting from!

Terms of Service  |   Private Policy  |   Site Options  |   Login/Logout/OpenID

© 2001-2009 DeadJournal, A Service of Warped, Inc. - All Rights Reserved.