Thursday, February 17, 2011

Why did Windows 64 choose to require xmm6 and xmm7 to be saved/restored?

Why did Windows 64 choose to require xmm6 and xmm7 to be saved/restored?

In Windows 32, you could write assembly routines which clobbered xmm0...xmm7. But if you take that same assembly code and run it in Windows 64, it will usually cause an application fault because VS2007 stores double-precision values in xmm6 and xmm7.

It seemed to me that since X64 has 16 xmm registers xmm0...xmm15 (whereas X32 only has 8 xmm registers), then Microsoft could have chosen to allow users to clobber xmm0..xmm7 (so that they could reuse assembly routines from Win32 without thinking about it) but require users to save/restore xmm8...xmm15.

So, to satisfy my own curiousity, why did Windows 64 choose to require xmm6 and xmm7 to be saved/restored?

From stackoverflow

0 comments:

Post a Comment