# roundps, roundpd, roundss, roundsd, ptest are in SSE4.1
+#####################################################################
+# Intel XSAVE instructions
+#####################################################################
+add_insn("xgetbv", "threebyte", modifiers=[0x0F, 0x01, 0xD0],
+ cpu=["XSAVE", "386"])
+add_insn("xsetbv", "threebyte", modifiers=[0x0F, 0x01, 0xD1],
+ cpu=["XSAVE", "386", "Priv"])
+add_insn("xsave", "twobytemem", modifiers=[4, 0x0F, 0xAE],
+ cpu=["XSAVE", "386"])
+add_insn("xrstor", "twobytemem", modifiers=[5, 0x0F, 0xAE],
+ cpu=["XSAVE", "386"])
+
#####################################################################
# AMD 3DNow! instructions
#####################################################################
EXTRA_DIST += modules/arch/x86/tests/xchg64.hex
EXTRA_DIST += modules/arch/x86/tests/xmm64.asm
EXTRA_DIST += modules/arch/x86/tests/xmm64.hex
+EXTRA_DIST += modules/arch/x86/tests/xsave.asm
+EXTRA_DIST += modules/arch/x86/tests/xsave.hex
EXTRA_DIST += modules/arch/x86/tests/gas32/Makefile.inc
EXTRA_DIST += modules/arch/x86/tests/gas64/Makefile.inc
--- /dev/null
+xsave [0]
+xrstor [0]
+xgetbv
+xsetbv
--- /dev/null
+0f
+ae
+26
+00
+00
+0f
+ae
+2e
+00
+00
+0f
+01
+d0
+0f
+01
+d1
#define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */
#define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */
#define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */
+#define CPU_XSAVE 33 /* Intel XSAVE instruction */
/* Technically not CPU capabilities, they do affect what instructions are
* available. These are tested against BITS==64.
BitVector_Bit_On(cpu, CPU_Prot);
if (data >= PROC_386)
BitVector_Bit_On(cpu, CPU_SMM);
- if (data >= PROC_nehalem)
+ if (data >= PROC_nehalem) {
BitVector_Bit_On(cpu, CPU_SSE42);
+ BitVector_Bit_On(cpu, CPU_XSAVE);
+ }
if (data >= PROC_penryn)
BitVector_Bit_On(cpu, CPU_SSE41);
if (data >= PROC_conroe)
nosse4, x86_cpu_clear_sse4, 0
sse5, x86_cpu_set, CPU_SSE5
nosse5, x86_cpu_clear, CPU_SSE5
+xsave, x86_cpu_set, CPU_XSAVE
+noxsave, x86_cpu_clear, CPU_XSAVE
%%
void