Ignore:
Timestamp:
Sep 10, 2008, 4:10:59 AM (11 years ago)
Author:
gb
Message:

Fix #+/#- nesting in XP-FLAGS-REGISTER.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/x86-trap-support.lisp

    r10635 r10682  
    241241  #+windows-target (pref xp #>CONTEXT.EFlags)
    242242  #-windows-target
     243  (progn
    243244  #+x8664-target
    244245  (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8664::fixnumshift)))
    245246  #+x8632-target
    246   (%get-signed-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8632::fixnumshift))))
     247  (%get-signed-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8632::fixnumshift)))))
    247248 
    248249
     
    277278  (values 'unknown nil))
    278279
     280(eval-when (:compile-toplevel :execute)
     281  (progn
     282    (defun conditional-os-constant (alternatives)
     283      (dolist (c alternatives (error "None of the constants in ~s could be loaded" alternatives))
     284        (if (load-os-constant c t)
     285          (return (load-os-constant c)))))
     286
     287    (defconstant integer-divide-by-zero-code
     288      (conditional-os-constant '(os::EXCEPTION_INT_DIVIDE_BY_ZERO os::FPE_INTDIV))
     289)
     290    (defconstant float-divide-by-zero-code
     291      (conditional-os-constant '(os::EXCEPTION_FLT_DIVIDE_BY_ZERO os::FPE_FLTDIV)))
     292    (defconstant float-overflow-code
     293      (conditional-os-constant '(os::FPE_FLTOVF os::EXCEPTION_FLT_OVERFLOW)))
     294    (defconstant float-underflow-code
     295      (conditional-os-constant '(os::FPE_FLTUND os::EXCEPTION_FLT_UNDERFLOW)))
     296    (defconstant float-inexact-code
     297      (conditional-os-constant '(os::FPE_FLTRES os::EXCEPTION_FLT_INEXACT_RESULT)))))
     298
    279299;;; UUOs are handled elsewhere.  This should handle all signals other than
    280300;;; those generated by UUOs (and the non-UUO cases of things like SIGSEGV.)
     
    291311               (decode-arithmetic-error xp xcf)
    292312             (let* ((condition-name
    293                      (cond ((or (= code #$FPE_INTDIV)
    294                                 (= code #$FPE_FLTDIV))
     313                     (cond ((or (= code integer-divide-by-zero-code)
     314                                (= code float-divide-by-zero-code))
    295315                            'division-by-zero)
    296                            ((= code #$FPE_FLTOVF)
     316                           ((= code float-overflow-code)
    297317                            'floating-point-overflow)
    298                            ((= code #$FPE_FLTUND)
     318                           ((= code float-underflow-code)
    299319                            'floating-point-underflow)
    300                            ((= code #$FPE_FLTRES)
     320                           ((= code float-inexact-code)
    301321                            'floating-point-inexact)
    302322                           (t
Note: See TracChangeset for help on using the changeset viewer.