]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/cpu-x86.32.S
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / cpu-x86.32.S
index 10cd7f23833b01a51320e3b38bc6682a886b031d..f308bf0b9252e5c3fbcfc0565acdf1fb9c1e0990 100644 (file)
@@ -57,9 +57,39 @@ DEF(void,primitive_inline_cache_miss_tail,(void)):
        add $12,%esp
        jmp *%eax
 
+DEF(void,get_sse_env,(void*)):
+    movl 4(%esp), %eax
+    stmxcsr (%eax)
+    ret
+
+DEF(void,set_sse_env,(const void*)):
+    movl 4(%esp), %eax
+    ldmxcsr (%eax)
+    ret
+
+DEF(void,get_x87_env,(void*)):
+    movl 4(%esp), %eax
+    fnstsw (%eax)
+    fnstcw 2(%eax)
+    ret
+
+DEF(void,set_x87_env,(const void*)):
+    movl 4(%esp), %eax
+    fldcw 2(%eax)
+    movb 4(%eax), %dl
+    test %dl, %dl
+    jz 1f
+    fnclex
+1:
+    ret
+
 #include "cpu-x86.S"
 
 #ifdef WINDOWS
        .section .drectve
        .ascii " -export:read_timestamp_counter"
+       .ascii " -export:get_sse_env"
+       .ascii " -export:set_sse_env"
+       .ascii " -export:get_x87_env"
+       .ascii " -export:set_x87_env"
 #endif