News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Are SSE registers preserved?

Started by Alloy, October 01, 2005, 10:53:27 AM

Previous topic - Next topic

Alloy

  I was wondering if the SSE registers need to be preserved when calling Windows API functions.
We all used to be something else. Nature has always recycled.

Farabi

Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Alloy

 The XMM0 through XMM7 registers.
We all used to be something else. Nature has always recycled.

roticv

I'm not really sure and wouldn't count on it.

bozo

Its possible that the floating point area of the processor could be modified with an api call.
Therefore..you should save the FPU state beforehand, just to be safe.

it wasn't really an issue up until 64-bit version of windows (AFAIK)
but the FPU and MMX are pretty much the same area..i think.

if you modify st(0) for example, you also modify MM0

Under the debugger, XMM0 seemed unchanged..

maybe someone else knows more about it.

OceanJeff32

Don't quote me on this, but I think I read somewhere, that Windows API doesn't yet use the SSE/SSE2 because of compatibility reasons...?

I was under the impression that unless you call Direct X or other graphic functions, you don't need to worry.  But I'm not sure where I read that.

I guess if you search through the API listing at microsoft.com for SSE, that would tell you, but I've never seen any references to the SSE architecture in all the books I've read on Windows Programming, unless they talk about Graphics.

Later,

Jeff C
:green

P.S. Of course
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

MazeGen

It is really strange that msdn doesn't document it for x32. As for x64, it is clear, look here.


bozo

QuoteAs for x64, it is clear

i wonder does this mean that using MMX is not recomended by microsoft
on 64-bit platform??

MazeGen

Exactly :(

The FPU and MMX state is not preserved accross context switches, what means FPU and MMX is useless under win x64.