Changeset 9061


Ignore:
Timestamp:
Apr 8, 2008, 5:08:01 AM (12 years ago)
Author:
gb
Message:

HARDER-CTYPE-SUBTYPE: use CSUBTYPEP to catch cases that may have
been missed by the simpler CTYPE-SUBTYPE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/sysutils.lisp

    r9016 r9061  
    752752(setq *type-system-initialized* t)
    753753
     754;;; Try to map from a CTYPE describing some array/stream
     755;;; element-type to a target-specific typecode, catching
     756;;; cases that CTYPE-SUBTYPE missed.
     757
     758(defun harder-ctype-subtype (ctype)
     759  (cond ((csubtypep ctype (load-time-value (specifier-type 'bit)))
     760         target::subtag-bit-vector)
     761        ((csubtypep ctype (load-time-value (specifier-type '(unsigned-byte 8))))
     762         target::subtag-u8-vector)
     763        ((csubtypep ctype (load-time-value (specifier-type '(unsigned-byte 16))))
     764         target::subtag-u16-vector)
     765        ((csubtypep ctype (load-time-value (specifier-type '(unsigned-byte 32))))
     766         target::subtag-u32-vector)
     767        #+64-bit-target
     768        ((csubtypep ctype (load-time-value (specifier-type '(unsigned-byte 64))))
     769         target::subtag-u64-vector)
     770        ((csubtypep ctype (load-time-value (specifier-type '(signed-byte 8))))
     771         target::subtag-s8-vector)
     772        ((csubtypep ctype (load-time-value (specifier-type '(signed-byte 16))))
     773         target::subtag-s16-vector)
     774        #+32-bit-target
     775        ((csubtypep ctype (load-time-value (specifier-type `(integer ,target::target-most-negative-fixnum ,target::target-most-positive-fixnum))))
     776         target::subtag-fixnum-vector)
     777        ((csubtypep ctype (load-time-value (specifier-type '(signed-byte 32))))
     778         target::subtag-s32-vector)
     779        #+64-bit-target
     780        ((csubtypep ctype (load-time-value (specifier-type `(integer ,target::target-most-negative-fixnum ,target::target-most-positive-fixnum))))
     781         target::subtag-fixnum-vector)
     782        #+64-bit-target
     783        ((csubtypep ctype (load-time-value (specifier-type '(signed-byte 64))))
     784         target::subtag-s64-vector)
     785        (t target::subtag-simple-vector)))
     786
     787
    754788#+count-gf-calls
    755789(progn
Note: See TracChangeset for help on using the changeset viewer.