]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorJoe Groff <arcata@gmail.com>
Tue, 8 Sep 2009 20:37:32 +0000 (15:37 -0500)
committerJoe Groff <arcata@gmail.com>
Tue, 8 Sep 2009 20:37:32 +0000 (15:37 -0500)
1  2 
vm/cpu-x86.32.S
vm/errors.cpp

diff --combined vm/cpu-x86.32.S
index 44155519d7ad1694f6abd542a075f6bcb28c28c5,10cd7f23833b01a51320e3b38bc6682a886b031d..f308bf0b9252e5c3fbcfc0565acdf1fb9c1e0990
@@@ -44,17 -44,6 +44,6 @@@ DEF(void,set_callstack,(F_STACK_FRAME *
        add $12,%esp                       /* pop args from the stack */
        ret                                /* return _with new stack_ */
  
- /* cpu.x86.32 calls this */
- DEF(bool,check_sse2,(void)):
-       push %ebx
-       mov $1,%eax
-       cpuid
-       shr $26,%edx
-       and $1,%edx
-       pop %ebx
-       mov %edx,%eax
-       ret
  DEF(long long,read_timestamp_counter,(void)):
        rdtsc
        ret
@@@ -68,40 -57,9 +57,39 @@@ DEF(void,primitive_inline_cache_miss_ta
        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:check_sse2"
        .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
diff --combined vm/errors.cpp
index 04a6ebb89bc901a400ac2e3e214830e6b7301d30,410886e88afed17c4052a2725f89b66fac50aab5..1dcee889a374de4bbc3dc6afb7ba5257341360cd
@@@ -41,8 -41,8 +41,8 @@@ void throw_error(cell error, stack_fram
                gc_off = false;
  
                /* Reset local roots */
-               gc_locals = gc_locals_region->start - sizeof(cell);
-               gc_bignums = gc_bignums_region->start - sizeof(cell);
+               gc_locals.clear();
+               gc_bignums.clear();
  
                /* If we had an underflow or overflow, stack pointers might be
                out of bounds */
@@@ -130,11 -130,6 +130,11 @@@ void divide_by_zero_error(
        general_error(ERROR_DIVIDE_BY_ZERO,F,F,NULL);
  }
  
 +void fp_trap_error()
 +{
 +      general_error(ERROR_FP_TRAP,F,F,NULL);
 +}
 +
  PRIMITIVE(call_clear)
  {
        throw_impl(dpop(),stack_chain->callstack_bottom);
@@@ -156,9 -151,4 +156,9 @@@ void misc_signal_handler_impl(
        signal_error(signal_number,signal_callstack_top);
  }
  
 +void fp_signal_handler_impl()
 +{
 +    fp_trap_error();
 +}
 +
  }