Is it possible to use the new SSE registers from Visual Studio 2010 inline assembler? If so, how and what else conditions must be satisfied? I don't know for example if new registers are av开发者_JAVA技巧ailable in both x86 and x64 modes.
Inline assembly is not allowed when compiling for the x64 platform in Visual Studio (since VS 2005).
I would recommend that you use intrinsics instead. It makes the compiler handle the CPU registers for you, and does some instruction reordering (the optimizer gets to process the code, which is never the case with inline assembly).
As regards your 2nd question:
I don't know for example if new registers are available in both x86 and x64 modes.
The 'new' registers xmm8
- xmm15
are only available in 64-bit mode.
Note however, the situation with the new AVX registers (for CPUs and OSes that support AVX, e.g. Sandy Bridge CPU + Win7 SP1):
ymm0
- ymm7
are available in both 32-bit and 64-bit mode.
ymm8
- ymm15
are available only in 64-bit mode.
精彩评论