Changeset 4174


Ignore:
Timestamp:
Apr 11, 2006, 12:45:42 PM (15 years ago)
Author:
gb
Message:

Try to unscramble MXCSR bits/masks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/compiler/X86/x86-arch.lisp

    r3922 r4174  
    1 ;;;-*- Mode: Lisp; Package: (PPC32 :use CL) -*-
     1;;;-*- Mode: Lisp; Package: (X86 :use CL) -*-
    22;;;
    33;;;   Copyright (C) 2005 Clozure Associates and contributors.
     
    1818  (:use "CL"))
    1919
     20(in-package "X86")
     21
    2022(require "ARCH")
    21 
    22 (in-package "X86")
    2323
    2424;;; Kernel globals are allocated "below" nil.  This list (used to map
     
    143143)
    144144
    145 (defconstant mxcsr-status-byte (byte 6 0))
    146 (defconstant mxcsr-control-bit-shift 7)
    147 (defconstant mxcsr-control-byte (byte 6 mxcsr-control-bit-shift))
    148 (defconstant mxcsr-control-and-rounding-byte (byte 8 mxcsr-control-bit-shift))
     145(defconstant mxcsr-status-mask
     146  (logior (ash 1 mxcsr-ie-bit)
     147          (ash 1 mxcsr-de-bit)
     148          (ash 1 mxcsr-ze-bit)
     149          (ash 1 mxcsr-oe-bit)
     150          (ash 1 mxcsr-ue-bit)
     151          (ash 1 mxcsr-pe-bit)))
    149152
    150 (defconstant mxcsr-write-mask (dpb -1 mxcsr-status-byte
    151                                    (dpb -1 mxcsr-control-and-rounding-byte 0)))
     153(defconstant mxcsr-control-and-rounding-mask
     154  (logior (ash 1 mxcsr-im-bit)
     155          (ash 1 mxcsr-dm-bit)
     156          (ash 1 mxcsr-zm-bit)
     157          (ash 1 mxcsr-om-bit)
     158          (ash 1 mxcsr-um-bit)
     159          (ash 1 mxcsr-pm-bit)
     160          (ash 1 mxcsr-rc0-bit)
     161          (ash 1 mxcsr-rc1-bit)))
     162
     163;;; There's a fairly hairy method of determining which MXCSR bits are
     164;;; available on a given proccessor version.  In practice, the bits
     165;;; that might not be supported are bits that select non-IEE754-compliant
     166;;; behavior (DenormsAreZeros and FlushtoZerop), and we don't really
     167;;; want to activate either of those things, anyway.
     168
     169(defconstant mxcsr-write-mask (lognot (logior (ash 1 mxcsr-daz-bit)
     170                                              (ash 1 mxcsr-fz-bit))))
     171
     172
    152173
    153174;;; Condition bitfields, used in jcc, cmovcc, setcc.
Note: See TracChangeset for help on using the changeset viewer.